fix(tpagectl): address CLI issues #634

Merged
fuzzy merged 1 commit from fix/issue-cli into main 2026-08-11 01:34:14 +00:00
Owner

Batch fix for the tpagectl CLI lump of the auditor issues.

  • Offline bootstrap (#582, #611): version, help, completion, docs, and any --examples invocation now skip config/client bootstrap via offlineCommand, so they succeed even with a broken config or unusable --server.
  • Env precedence (#630): TPAGECTL_SERVER_URL/TPAGECTL_SERVER_TOKEN are re-applied after the active context, so env wins over context (documented order: flags > env > context > config).
  • Accessors (#538, #543, #549): configFromContext/clientFromContext now return (T, error) instead of a silent nil.
  • Error output (#603): only the error: prefix is colored, so multi-line error bodies and hint: lines render intact.
  • Global state (#536): cli.VersionPrinter assignment guarded so newCommand() is free of global side effects.
  • Config hygiene (#595): config.ClearToken no longer creates a config file when none exists.
  • Credential recovery (#596): genuine keychain failures on token set/clear/login degrade to the config fallback with a warning instead of failing outright.
  • Context use (#631): validates the context name as a config key, not merely a non-empty URL.
  • TLS (#598, #599): WithTLSConfig clones http.DefaultTransport (preserving proxy/timeouts); --insecure ignores any CA bundle.
  • watch (#625): --once returns the last poll error instead of exiting 0.
  • deployment list (#605): sorts before applying --limit.
  • site create (#550): distinguishes 401 (auth failed) from 403 (not authorized for owner).
  • login (#587): discovery uses a 30s-timeout HTTP client.
  • promote (#569): warns on site-URL fetch failure instead of swallowing it.
  • update (#623): documents the trust model (integrity via checksum; authenticity relies on trusting the configured Forgejo host).

Closes #536, #538, #543, #549, #550, #569, #582, #587, #595, #596, #598, #599, #603, #605, #611, #623, #625, #630, #631

Also closed as already-resolved (comments on the issues): #586, #589, #590, #591, #592.

Batch fix for the tpagectl CLI lump of the auditor issues. - **Offline bootstrap** (#582, #611): `version`, `help`, `completion`, `docs`, and any `--examples` invocation now skip config/client bootstrap via `offlineCommand`, so they succeed even with a broken config or unusable `--server`. - **Env precedence** (#630): `TPAGECTL_SERVER_URL`/`TPAGECTL_SERVER_TOKEN` are re-applied after the active context, so env wins over context (documented order: flags > env > context > config). - **Accessors** (#538, #543, #549): `configFromContext`/`clientFromContext` now return `(T, error)` instead of a silent `nil`. - **Error output** (#603): only the `error:` prefix is colored, so multi-line error bodies and `hint:` lines render intact. - **Global state** (#536): `cli.VersionPrinter` assignment guarded so `newCommand()` is free of global side effects. - **Config hygiene** (#595): `config.ClearToken` no longer creates a config file when none exists. - **Credential recovery** (#596): genuine keychain failures on `token set`/`clear`/`login` degrade to the config fallback with a warning instead of failing outright. - **Context use** (#631): validates the context name as a config key, not merely a non-empty URL. - **TLS** (#598, #599): `WithTLSConfig` clones `http.DefaultTransport` (preserving proxy/timeouts); `--insecure` ignores any CA bundle. - **watch** (#625): `--once` returns the last poll error instead of exiting 0. - **deployment list** (#605): sorts before applying `--limit`. - **site create** (#550): distinguishes 401 (auth failed) from 403 (not authorized for owner). - **login** (#587): discovery uses a 30s-timeout HTTP client. - **promote** (#569): warns on site-URL fetch failure instead of swallowing it. - **update** (#623): documents the trust model (integrity via checksum; authenticity relies on trusting the configured Forgejo host). Closes #536, #538, #543, #549, #550, #569, #582, #587, #595, #596, #598, #599, #603, #605, #611, #623, #625, #630, #631 Also closed as already-resolved (comments on the issues): #586, #589, #590, #591, #592.
fix(tpagectl): address CLI issues
Some checks failed
CI / test (pull_request) Has been cancelled
CI / build (pull_request) Has been cancelled
CI / docker (pull_request) Has been cancelled
CI / lint (pull_request) Has been cancelled
CI / build (push) Has been cancelled
CI / test (push) Has been cancelled
CI / docker (push) Has been cancelled
CI / lint (push) Has been cancelled
9f630a73e9
* offline commands (version, help, completion, docs, --examples) skip
  config/client bootstrap so they work with a broken config (#582, #611)
* env vars are re-applied after the active context so env wins (#630)
* configFromContext/clientFromContext return errors instead of nil (#538, #543, #549)
* error output colors only the "error:" prefix, preserving multi-line bodies (#603)
* guard the global cli.VersionPrinter assignment (#536)
* ClearToken no longer creates a config file (#595)
* keychain store/clear failures degrade to config fallback with a warning (#596)
* context use validates the name as a config key (#631)
* WithTLSConfig clones the default transport, preserving proxy/timeouts (#598);
  insecure TLS ignores any CA bundle (#599)
* watch --once returns the last poll error (#625)
* deployment list sorts before applying --limit (#605)
* site create distinguishes 401 from 403 (#550)
* login discovery uses a 30s timeout client (#587)
* deployment promote warns instead of swallowing URL fetch errors (#569)
* document the update authenticity trust model (#623)

Closes #536, #538, #543, #549, #550, #569, #582, #587, #595, #596,
#598, #599, #603, #605, #611, #623, #625, #630, #631
fuzzy force-pushed fix/issue-cli from 9f630a73e9
Some checks failed
CI / test (pull_request) Has been cancelled
CI / build (pull_request) Has been cancelled
CI / docker (pull_request) Has been cancelled
CI / lint (pull_request) Has been cancelled
CI / build (push) Has been cancelled
CI / test (push) Has been cancelled
CI / docker (push) Has been cancelled
CI / lint (push) Has been cancelled
to fe4e6d0635
All checks were successful
CI / build (pull_request) Successful in 8s
CI / lint (pull_request) Successful in 26s
CI / docker (pull_request) Successful in 3m25s
CI / test (pull_request) Successful in 22m45s
CI / build (push) Successful in 8m56s
CI / test (push) Successful in 8m0s
CI / lint (push) Successful in 18m21s
CI / docker (push) Successful in 25m49s
2026-08-11 01:29:56 +00:00
Compare
fuzzy merged commit fe4e6d0635 into main 2026-08-11 01:34:14 +00:00
fuzzy deleted branch fix/issue-cli 2026-08-11 01:34:14 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/thwap-pagesd!634
No description provided.