feat(cli): authenticate mint status against /v1/status with GitHub credentials - #7074
feat(cli): authenticate mint status against /v1/status with GitHub credentials#7074fullsend-ai-coder[bot] wants to merge 3 commits into
Conversation
|
🤖 Finished Review · ✅ Success · Started 11:09 AM UTC · Completed 11:27 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $6.22 |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Risk Assessment: elevated (3/5) DetailsTier 1 signals unchanged from prior assessment (BLAST=large, PROTECTED_PATH_COUNT=1, TEST_FILE_RATIO=0.18, bot author); Tier 2 continues to show high fix-commit churn (22 commits/30d, 39 fix/reverts/90d) on mint.go/mintclient.go with no reduction; prior score of 3 preserved per re-review anchoring rules despite raw composite of 2.45. Previous runRisk Assessment: elevated (3/5) DetailsTier 1 signals unchanged from prior assessment (BLAST=large, PROTECTED_PATH_COUNT=1, TEST_FILE_RATIO=0.20, bot author); Tier 2 shows high fix-commit churn on mint.go/mintclient.go; Tier 3 well-scoped; prior score of 3 preserved despite lower raw composite (2.23). Previous run (2)Risk Assessment: elevated (3/5) DetailsScore raised from prior 2 to 3: PROTECTED_PATH_COUNT is now 1 (prior rationale cited zero protected paths as a key offset), and raw composite (2.53) rounds to elevated; very high fix/revert churn on mint.go/mint_test.go and large blast radius remain primary drivers, partially offset by bot authorship, no security or CI/dependency changes, and tight acceptance-criteria alignment with the well-scoped GitHub auth issue. Previous run (3)Risk Assessment: moderate (2/5) DetailsModerate risk preserved from prior assessment: large blast radius and very high fix-commit churn on mint files remain the primary risk drivers, offset by bot authorship, zero protected or security-sensitive paths, no CI or dependency changes, and tight acceptance-criteria alignment with the well-scoped GitHub auth issue. Previous run (4)Risk Assessment: moderate (2/5) DetailsModerate risk preserved from prior assessment: large blast radius and very high fix-commit churn on mint files remain the primary risk drivers, offset by bot authorship, zero protected or security-sensitive paths, no CI or dependency changes, and tight acceptance-criteria alignment with the well-scoped GitHub auth issue. Previous run (5)Risk Assessment: moderate (2/5) DetailsModerate risk preserved from prior assessment: large blast radius and high fix-commit churn on mint.go remain the primary risk drivers, offset by bot authorship, zero protected or security-sensitive paths, no CI or dependency changes, and full acceptance-criteria alignment with the well-scoped GitHub auth issue. Previous run (6)Risk Assessment: moderate (2/5) DetailsModerate risk unchanged from prior assessment: large blast radius from new mintclient package and high fix/revert churn on mint.go remain, offset by bot authorship, no security-sensitive or protected paths, and full acceptance-criteria coverage of the well-scoped GitHub auth issue. Previous run (7)Risk Assessment: moderate (2/5) DetailsModerate risk driven primarily by a large blast radius from the new mintclient package and high fix/revert churn on mint.go, substantially offset by a 0.50 test-file ratio, bot authorship, no security-sensitive files, and a clearly scoped issue with a safe fallback auth chain. |
ReviewFindingsMedium
Low
Next steps:
Previous runReviewFindingsMedium
Low
Next steps:
Previous run (2)ReviewFindingsMedium
Low
Next steps:
Previous run (3)ReviewFindingsLow
Next steps:
Previous run (4)ReviewFindingsLow
Next steps:
Previous run (5)ReviewFindingsLow
Next steps:
Previous run (6)ReviewFindingsMedium
Low
Next steps:
Previous run (7)ReviewFindingsHigh
Medium
Low
Next steps:
|
|
🤖 Finished Fix · ✅ Success · Started 11:29 AM UTC · Completed 11:39 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $1.68 |
🔧 Fix agent — iteration 1 (bot-triggered)Addressed all 7 review findings: fixed error sentinel to use errors.New/errors.Is, added org-argument validation for --mint-url mode, guarded OIDC env vars in tests, and documented the new --mint-url flag across CLI reference, administration guide, and CLI internals command tree Fixed (7):
Tests: passed Decision points
Next steps:
|
- Use errors.New for errUnauthorized sentinel and errors.Is for identity checks instead of fragile string matching - Reject [org] argument when --mint-url is provided instead of silently discarding it - Guard OIDC env vars in mint status API tests to prevent flakes in GitHub Actions environments - Document --mint-url flag and API-based mode in CLI reference, mint administration guide, and CLI internals command tree Addresses #7074
|
🤖 Review · ❌ Terminated · Started 11:41 AM UTC · Ended 11:57 AM UTC Commit: |
Site previewPreview: https://b601e6d7-site.fullsend-ai.workers.dev Commit: |
|
🤖 Finished Review · ✅ Success · Started 11:41 AM UTC · Completed 11:57 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $6.68 |
|
🤖 Finished Fix · ✅ Success · Started 11:59 AM UTC · Completed 12:09 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $1.67 |
🔧 Fix agent — iteration 2 (bot-triggered)Addressed all 4 review findings: added IAM footnote for mint status GCP-only roles in operations.md, cleared FULLSEND_MINT_URL env var in test, fixed internal consistency between docs and code about env var behavior, and corrected fmt.Errorf wrapping order in callStatus Fixed (4):
Tests: passed Decision points
Next steps:
|
- Add IAM footnote to operations.md clarifying GCP viewer roles for mint status apply only in --project mode - Clear FULLSEND_MINT_URL env var in TestMintStatusCmd_RequiresProjectOrMintURL to prevent host-env leakage - Fix prose in docs/cli/mint.md and mint.go long help text: env var activates API mode when --mint-url is not provided (regardless of --project), not only when neither flag is provided - Fix fmt.Errorf wrapping order in callStatus to match codebase convention (context first, then %w) Addresses #7074
|
🤖 Finished Review · ✅ Success · Started 12:11 PM UTC · Completed 12:29 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $7.30 |
|
🤖 Finished Fix · ✅ Success · Started 12:31 PM UTC · Completed 12:41 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $1.83 |
🔧 Fix agent — iteration 3 (bot-triggered)Addressed 3 of 4 review findings with fixes: added CLI verification docs to standalone-mint.md, added org+mint-url error test, and added GCP-mode clarification to mint-administration.md. Disagreed with scope-incomplete finding (interactive login) as the remediation suggests a follow-up issue, which is out of scope. Fixed (3):
Disagreed (1):
Tests: passed Decision points
Next steps:
|
|
🤖 Finished Fix · ✅ Success · Started 1:35 PM UTC · Completed 1:46 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $1.98 |
🔧 Fix agent — iteration 5 (bot-triggered)Addressed both review findings. Added a warning when --project is silently ignored due to FULLSEND_MINT_URL env var, following the existing warnIrrelevantFlags pattern. Updated the mint-enroll skill to document the API-based mode alternative. Fixed (2):
Tests: passed
Decision points
Next steps:
|
… var When FULLSEND_MINT_URL is set in the environment and the user explicitly passes --project, the command now emits a warning to stderr explaining that --project is ignored and how to use GCP-based mode instead. This follows the warnIrrelevantFlags pattern used by mint deploy. Also adds API-based mode documentation to the mint-enroll skill's pre-check step so SREs know the simpler invocation is available. Note: pre-commit hooks were not run. pre-commit could not complete (infrastructure failure), and the direct-execution fallback was used for gofmt/go vet. Addresses #7074
|
🤖 Finished Review · ✅ Success · Started 1:48 PM UTC · Completed 2:06 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $5.25 |
|
🤖 Finished Fix · ❌ Failure (running pre-script: exit status 1) · Started 2:09 PM UTC · Completed 2:09 PM UTC Commit: Effort: high |
|
/fs-fix rebase and squash commits, fix outstanding review issues |
|
🤖 Finished Fix · ✅ Success · Started 4:01 AM UTC · Completed 4:15 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $2.87 |
…edentials Add GitHub-based authentication to fullsend mint status so it can query the mint /v1/status API endpoint without requiring GCP cloud viewer IAM. When --mint-url (or FULLSEND_MINT_URL) is provided, the command auto-discovers GitHub credentials: trying GitHub Actions OIDC first, then falling back to GH_TOKEN / GITHUB_TOKEN / gh auth token. Changes: - Add StatusResult, StatusRequest, StatusAuthMethod types, hasOIDCEnv, QueryStatus, and callStatus in internal/mintclient for authenticated GET /v1/status with OIDC to GitHub token fallback chain - Add --mint-url flag and FULLSEND_MINT_URL env var support to mint status; route to runMintStatusAPI when mint URL is provided - Guard env-var fallback with cmd.Flags.Changed so --mint-url can force GCP mode when FULLSEND_MINT_URL is set - Emit --project-ignored warning via ui.Printer.StepWarn not os.Stderr - Add 12 test functions covering auth paths, fallback, validation, env var resolution, and flag-overrides-project routing - Update docs: cli/mint.md, cli-internals.md, operations.md, mint-administration.md, standalone-mint.md, and mint-enroll skill Closes #5884 Addresses #7074
🔧 Fix agent — iteration 6 (human-triggered)Fixed 5 outstanding review findings (--mint-url="" escape hatch, StepWarn for warnings, unexport hasOIDCEnv, omitempty on Roles, section divider style) and squashed 6 commits into a single clean feat(cli) commit per human instruction. The gh auth login fallback suggestion is out of scope per the issue spec. Fixed (6):
Disagreed (1):
Tests: passed
Decision points
Next steps:
|
5f237a2 to
4f1a563
Compare
|
🤖 Finished Review · ✅ Success · Started 4:17 AM UTC · Completed 4:40 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $8.69 |
|
🤖 Finished Fix · ✅ Success · Started 4:42 AM UTC · Completed 4:55 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $3.14 |
- Emit --project-ignored warning to stderr (matching warnIrrelevantFlags pattern) so CI log-scraping pipelines can distinguish it from status output - Add workflow_host_repos, version, commit to /v1/status JSON examples in infrastructure-reference.md - Add StatusResult field listing to API-based mode section in mint-administration.md and fix dangling cross-reference - Add TestMintStatusCmd_MintURLEmptyEscapeHatch test for --mint-url="" escape hatch when FULLSEND_MINT_URL is set - Mention FULLSEND_MINT_URL in mint status Short description - Fix mintStatusResolveToken comment to active-verb style - Rename Test_hasOIDCEnv to TestHasOIDCEnv for naming consistency Addresses #7074
🔧 Fix agent — iteration 2 (bot-triggered)Addressed all 8 review findings: fixed 7 (stderr warning, stale API reference, escape hatch test, Short description, comment style, test naming, documentation cross-reference) and recorded 1 disagreement (protected-path acknowledgment requiring human approval). Fixed (7):
Disagreed (1):
Tests: passed Decision points
Next steps:
|
|
🤖 Finished Review · ✅ Success · Started 4:57 AM UTC · Completed 5:12 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $4.83 |
| return nil | ||
| } | ||
|
|
||
| // runMintStatusAPI queries the mint's /v1/status endpoint using |
There was a problem hiding this comment.
[low] Naming conventions
runMintStatusAPI has a two-line doc comment, but every sibling runMint* runner function in the same file (runMintDeployGCP, runMintDeployCloudflare, runMintEnrollOrg, runMintEnrollRepo, runMintUnenrollOrg, runMintUnenrollRepo, runMintStatus) has none. The file's established sub-pattern is: helper/utility unexported functions get doc comments; command-runner functions do not.
Suggested fix: Remove the doc comment from runMintStatusAPI to match the pattern, or alternatively add doc comments to all sibling runMint* runner functions — but the lighter fix is removal.
|
🤖 Finished Fix · ✅ Success · Started 5:14 AM UTC · Completed 5:22 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $1.48 |
Sibling runMint* runner functions in mint.go do not have doc comments; only helper/utility functions do. Remove the two-line doc comment from runMintStatusAPI to match the established pattern. Note: pre-commit hooks were not run. `pre-commit` could not complete (infrastructure failure: HTTP 403 fetching remote hooks), and the direct-execution fallback was used for go vet and gofmt instead. Addresses #7074
🔧 Fix agent — iteration 3 (bot-triggered)Removed doc comment from runMintStatusAPI to match file convention where sibling runMint* runner functions have no doc comments. The protected-path finding for skills/mint-enroll/SKILL.md is acknowledged — it requires human approval per policy. Fixed (1):
Disagreed (1):
Tests: passed Decision points
Next steps:
|
|
🤖 Review · Started 5:24 AM UTC Commit: |
Summary
Add GitHub-based authentication to
fullsend mint statusso it can query the mint's/v1/statusAPI endpoint without requiring GCP cloud viewer IAM. When--mint-url(orFULLSEND_MINT_URL) is provided, the command auto-discovers GitHub credentials: trying GitHub Actions OIDC first, then falling back toGH_TOKEN/GITHUB_TOKEN/gh auth token.Related Issue
Closes #5884
Changes
internal/mintclient/mintclient.go: AddStatusResult,StatusRequest,StatusAuthMethodtypes,HasOIDCEnv(),QueryStatus(), andcallStatus()for authenticated GET/v1/statuswith OIDC → GitHub token fallback chaininternal/cli/mint.go: Add--mint-urlflag andFULLSEND_MINT_URLenv var support tomint status; route to newrunMintStatusAPI()when mint URL is provided; keep--projectGCP path as fallbackinternal/mintclient/mintclient_test.go: Add 8 tests covering OIDC path, GitHub token path, OIDC→GitHub fallback, all-methods-fail, no-resolve-func, validation errors, non-401 terminal errors, andHasOIDCEnvinternal/cli/mint_test.go: Add 4 tests for API-based status success/failure, env var resolution, and flag-overrides-project routing; update existing flag and error message testsTesting
go test -race ./internal/mintclient/passesgo test -race ./internal/cli/passesgofmt,go vet,gitleakspass on all changed filesChecklist
Closes #5884
Post-script verification
agent/5884-mint-status-github-auth)30ed01e3b9fbb775f5629a69cf3e0291b37f9e75..HEAD)