Detect missing auth settings and exit hooks#332
Open
michael-webster wants to merge 3 commits into
Open
Conversation
Adds `chunk auth check` for use in hooks: exits 1 with an actionable message directing users to run `chunk auth set circleci` when no token is configured. Uses a silent-exit error type so main.go exits cleanly without reprinting the message. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
7bdb9b1 to
061a8a6
Compare
michael-webster
commented
May 13, 2026
| // silentExitError carries an exit code. main.go detects ExitCode() and calls | ||
| // os.Exit directly, skipping further error printing. Use after writing your | ||
| // own message to stderr. | ||
| type silentExitError struct{ code int } |
Contributor
Author
There was a problem hiding this comment.
using this since we are controlling the output for the agent.
…mmand chunk validate now exits with ExitAuthError (3) and the existing suggestionCircleCIAuth hint when running as a Stop hook and CircleCI auth is not configured but remote commands are present. Previously the hook would silently fall back to local execution, hiding the auth problem from the agent. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
061a8a6 to
59907e6
Compare
Resolves rc once at the same scope level so the token resolution path is consistent with ensureCircleCIClient and not bypassed by nesting. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
hanabel1
approved these changes
May 13, 2026
Contributor
|
don't know if I'm missing it, but where is the chunk auth check command .. |
Contributor
Author
Ah stale PR description. I decided to instead detect the missing settings directly. |
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.
Detect missing CircleCI auth settings and exits code 1 to indicate a failure.