Repository navigation
fix(cli): say unauthenticated in the run header when a credential variable is unset - #330
Merged
Merged
Conversation
Owner
Author
|
Follow-up commit: the local-server sample in |
goldbarth
added a commit
that referenced
this pull request
Oct 6, 2026
…e unless asked (#335) Closes #334 Splits the publishing half off #249, which keeps the interactive review of flags. - **Why:** `generate` on a tag whose release is already published replaced its notes in public, with no draft in between and without asking. Hand-written notes were gone, and the README listed it as a known limitation. A first run by someone new to Chartula, on a repository with published releases, could hit it. - **Stop before the first model call:** `EnsureCanWriteAsync` already runs before any model call to check the token. It now also looks the release up by tag (GitHub's lookup by tag finds published releases only) and refuses unless replacing was asked for. The run costs nothing and says what to do: the release's link, `--replace-published`, and, from the pipeline, `--no-publish`. - **Checked again at the write:** `WriteAsync` refuses the same way, so a release someone published while the run was rendering is not replaced either. - **`--replace-published`, not a question:** an explicit option works the same in a terminal and in CI, where no one could answer. It is a `generate` option only; the other commands refuse it like any option they do not take. - **A required parameter on the port:** `replacePublished` has no default on either method, so every caller decides; `doctor` passes `false`, since it checks what a plain `generate` would do. - **Drafts are unchanged:** a draft from an earlier run is still found and updated without the option. - **`doctor`:** the "GitHub write" check warns about a published release the way it warns about a token that may not publish, with the same message a run would print. - **Docs:** the README limitation is gone and the `generate` paragraph says what happens instead; `github.md`, `ci.md` and `cli.md` (new section `--replace-published`) describe it. A second commit rewrites the launch section of `ROADMAP.md`: the points done since #330, and the ones left before the announcement. **Verified:** - Reproduced with the built CLI before the change: a scratch repository whose `v1.2.0` holds one `chore:` commit, GitHub on a local stub that answers `GET /releases/tags/v1.2.0` with a published release. `generate --tag v1.2.0 --audience technical` sent `PATCH /releases/1` with the new body. - After the change, the same run stops with exit code 1 after `POST /generate-notes` and `GET /releases/tags/v1.2.0`; nothing is written, no `PATCH` is sent. - With `--replace-published`, the run writes the files and sends the `PATCH`. - `doctor --tag v1.2.0` against the same stub shows `warn GitHub write` with the same message. Tests: `GitHubReleaseNotesWriterTests` gains a test for the check and one for the write, each with and without the option, and the existing draft tests run without it; the passing check now expects the lookup after the permission request. `ReleasePipelineTests` holds that the check and the write are told the same; `CommandLineArgumentsTests` covers the option for `generate` and its refusal for `doctor`. All tests pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #210
GITHUB_TOKENprintedGitHub: ..., token from GITHUB_TOKENdirectly above the warning that no token was found. The header named a source for a credential the run did not have, and theModel:line did the same for a missing model key.unauthenticated, <VARIABLE> is not setwhen the variable is unset or blank,key from/token from <VARIABLE>as before when it is set. The variable stays named in both cases, so the line says what to set; a value is still never printed.GitHubTokenNoticeand the HTTP client, so the header, the warning and the request agree on whether a token is sent.providers.mdsaid the header names the variable "not whether it is set"; it now says what the line reads without one.Verified:
previewwithoutANTHROPIC_API_KEYandGITHUB_TOKENprintedkey from ANTHROPIC_API_KEYandtoken from GITHUB_TOKEN.unauthenticated, ANTHROPIC_API_KEY is not setandunauthenticated, GITHUB_TOKEN is not set; with both set, the header is unchanged.Tests:
EndpointNoticeTestsgains one test for an unset and a blank variable; the default test now sets both keys. All 945 tests pass.