Skip to content

feat(#6958): add --inference-wif-provider to repos install, drop --inference-project-number - #6960

Merged
ggallen merged 2 commits into
mainfrom
agent/6958-wif-provider-repos-install
Sep 3, 2026
Merged

ggallen merged 2 commits into
mainfrom
agent/6958-wif-provider-repos-install

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

Add --inference-wif-provider flag to repos install for parity with github setup, allowing callers to pass a full WIF provider resource name used verbatim for all repos instead of deriving per-repo providers. Remove the redundant --inference-project-number flag — the project number is either auto-derived from --inference-project or embedded in the WIF provider path.

Changes

  • internal/cli/repos.go: Replace --inference-project-number CLI flag with --inference-wif-provider, reuse validateWIFProvider from admin.go, skip project number derivation when WIF provider is set
  • internal/repos/converge.go: Add WIFProvider field to ConvergeConfig, use it directly in the WIF computation (skipping per-repo derivation and collision check), relax inference flag validation when WIFProvider is set
  • internal/repos/converge_test.go: Add 4 tests covering explicit WIF provider usage, collision check bypass, no-project-number-required path, and per-repo fallback
  • internal/cli/repos_test.go: Update tests for new flag validation, add flag presence/absence assertions
  • docs/cli/repos.md, docs/guides/dev/cli-internals.md: Replace --inference-project-number with --inference-wif-provider in flag tables

Testing

  • All repos-related CLI tests pass
  • All converge tests pass (including 4 new tests for explicit WIF provider)
  • go vet and gofmt pass
  • Patch coverage above 80% threshold

Closes #6958

Post-script verification

  • Branch is not main/master (agent/6958-wif-provider-repos-install)
  • Secret scan passed (gitleaks — 2a103497560b9bcca901372c70a6e073b1a73cde..HEAD)
  • PR body secret scan passed (gitleaks — no-git)

…ference-project-number

Add --inference-wif-provider flag to `repos install` so callers can
pass a full WIF provider resource name that is used verbatim for all
repos, bypassing per-repo provider derivation via
BuildRepoProviderID. This brings `repos install` to parity with
`github setup`, which already supports the flag.

Remove --inference-project-number as a CLI flag — it was always
auto-derived from --inference-project and is now also unnecessary
when --inference-wif-provider is set (the project number is
embedded in the provider path). The internal field remains for the
auto-derivation codepath.

Changes:
- repos.go: replace --inference-project-number flag with
  --inference-wif-provider, reuse validateWIFProvider from admin.go,
  skip project number derivation when WIF provider is set
- converge.go: add WIFProvider field to ConvergeConfig, use it
  directly in the WIF computation switch (skipping collision check),
  relax inference flag validation when WIFProvider is set
- converge_test.go: add tests for explicit WIF provider path,
  collision check bypass, and per-repo fallback
- repos_test.go: update tests for new flag, add flag presence and
  absence assertions
- docs/cli/repos.md, docs/guides/dev/cli-internals.md: replace
  --inference-project-number with --inference-wif-provider

Closes #6958
@fullsend-ai-coder
fullsend-ai-coder Bot requested a review from a team September 3, 2026 13:20
@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Triggers review agent dispatch label Sep 3, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 1:22 PM UTC · Completed 1:43 PM UTC

Commit: d3aa527 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $7.63

@codecov

codecov Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

Site preview

Preview: https://d32282fe-site.fullsend-ai.workers.dev

Commit: 865355ad469b836010cc64ff33646bac9c17c292

@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Sep 3, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Well-scoped bot-authored feature change to an unreleased CLI command with good test coverage and all acceptance criteria met; elevated git history signals reflect active monorepo development rather than instability, and the issue explicitly confirms no breaking-change risk.

Previous run

Risk Assessment: moderate (2/5)

Details

Well-scoped bot-authored feature change to an unreleased CLI command with good test coverage and all acceptance criteria met; elevated git history signals reflect active monorepo development rather than instability, and the issue explicitly confirms no breaking-change risk.

@fullsend-ai-review

fullsend-ai-review Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

Review

Findings

Low

  • [code-organization] internal/repos/converge.go:237 — The WIF-provider validation branch and the non-WIF else-branch both call IsValidGCPProjectID and IsValidGCPRegion with identical format strings. This duplication means the validation logic must be kept in sync in two places. The entry conditions differ between branches (WIF requires InferenceProject unconditionally; non-WIF checks it conditionally after the all-or-nothing gate), so hoisting is not entirely straightforward, but the shared calls could be extracted.

  • [privilege-scope-change] internal/repos/converge.go:376 — The new WIFProvider branch uses the provided WIF provider verbatim for all repos in the batch, bypassing per-repo derivation and the collision check. This is intentional for org-scoped WIF providers and is documented in the field comment. Risk is mitigated by explicit opt-in via --inference-wif-provider flag, strict regex validation via WIFProviderPattern, and the feature being unreleased.

  • [code-organization] internal/repos/converge.go:376 — The new case cfg.WIFProvider != "" in the switch applies to all forges (GitHub and GitLab), while the existing cases are forge-gated. The comment says "use it verbatim for all repos" but does not explicitly mention cross-forge applicability. A brief clarification would improve readability for future readers.

Previous run

Review

Findings

Medium

  • [logic error] internal/repos/converge.go:235 — When cfg.WIFProvider is set but cfg.InferenceProject is empty, the validation branch at line 235 allows the configuration through without error. However, both secret-writing paths (installSecretsForForge in install.go and the converge secret-repair path) gate on cfg.InferenceProject != "", so the WIF provider value is computed and carried through but never written to the repo's FULLSEND_GCP_WIF_PROVIDER secret. The install silently completes without the required inference secrets. All existing tests pass InferenceProject alongside WIFProvider, so this path is untested.
    Remediation: Add a validation error in the cfg.WIFProvider != "" branch when cfg.InferenceProject is empty, or ensure the secret-writing paths handle the WIFProvider-only case.

Low

  • [edge case] internal/repos/converge.go:242 — In the cfg.WIFProvider != "" validation branch, InferenceRegion is only validated when non-empty (if cfg.InferenceRegion != "" && !IsValidGCPRegion(...)), whereas the non-WIFProvider branch validates it unconditionally (rejecting empty values via IsValidGCPRegion("")). This is not a practical bug when invoked through the CLI (which defaults region to "global"), but callers invoking Converge directly would see inconsistent behavior.

  • [privilege scope change] internal/repos/converge.go:376 — The new case cfg.WIFProvider != "" branch uses the provided WIF provider verbatim for all repos in the batch, bypassing per-repo derivation and the collision check. This is intentional for org-scoped WIF providers and is documented in the field comment, but means a user-supplied repo-scoped WIF provider would be applied to all repos. Requires explicit opt-in via the CLI flag.


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-coder

fullsend-ai-coder Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 1:44 PM UTC · Completed 1:54 PM UTC

Commit: d3aa527 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $2.39

… is set

Address review finding: WIFProvider-without-InferenceProject silently
skipped secret writes. Add explicit validation error and make
InferenceRegion validation unconditional in the WIFProvider branch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 1 (bot-triggered)

Fixed two review findings in internal/repos/converge.go: (1) Added validation requiring --inference-project when --inference-wif-provider is set, preventing silent secret-write skips. (2) Made InferenceRegion validation unconditional in the WIFProvider branch for consistency. Added a new test covering the WIFProvider-without-InferenceProject error path. The third finding (privilege scope change) was acknowledged as intentional behavior requiring no code change.

Fixed (2):

  1. [medium] logic error: WIFProvider without InferenceProject silently skips secret writes (internal/repos/converge.go): Added explicit validation error when WIFProvider is set but InferenceProject is empty. The secret-writing paths gate on InferenceProject != "", so without this check the install would silently complete without writing the required FULLSEND_GCP_WIF_PROVIDER secret. Also added a new test TestConverge_WIFProviderRequiresInferenceProject to cover this path.
  2. [low] edge case: InferenceRegion validated inconsistently in WIFProvider branch (internal/repos/converge.go): Made InferenceRegion validation unconditional in the WIFProvider branch (removed the cfg.InferenceRegion != "" guard), matching the behavior of the non-WIFProvider branch. Now both paths reject invalid or empty regions consistently.

Disagreed (1):

  1. [low] privilege scope change: WIF provider applied verbatim to all repos: This is intentional and documented behavior. The --inference-wif-provider flag exists specifically for org-scoped WIF providers that should be applied to all repos. The reviewer acknowledged this is 'intentional for org-scoped WIF providers and is documented in the field comment' and noted it 'requires explicit opt-in via the CLI flag'. No code change needed.

Tests: passed

Decision points
  • Chose to require InferenceProject when WIFProvider is set rather than making the secret-writing paths handle the WIFProvider-only case (alternatives: Modify secret-writing paths to handle WIFProvider without InferenceProject; rationale: The secret-writing paths need InferenceProject for the GCP project ID secret. Making InferenceProject required is the simpler and safer fix — it fails fast with a clear error message rather than requiring changes across multiple code paths.)

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push
    Updated by fullsend fix agent

@fullsend-ai-review

fullsend-ai-review Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 1:55 PM UTC · Completed 2:12 PM UTC

Commit: 865355a · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $6.58

@fullsend-ai-review fullsend-ai-review Bot added the ready-for-merge All reviewers approved — ready to merge label Sep 3, 2026
@ggallen
ggallen added this pull request to the merge queue Sep 3, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 3, 2026
@ggallen
ggallen added this pull request to the merge queue Sep 3, 2026
Merged via the queue into main with commit 48eac1a Sep 3, 2026
54 checks passed
@ggallen
ggallen deleted the agent/6958-wif-provider-repos-install branch September 3, 2026 14:52
@fullsend-ai-retro

fullsend-ai-retro Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 2:54 PM UTC · Completed 3:03 PM UTC

Commit: 865355a · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $2.54

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #6960 — feat(#6958): add --inference-wif-provider to repos install

Timeline

  1. 12:39 — Issue #6958 created by ggallen
  2. 12:40 — Triage agent runs ($0.80)
  3. 12:44 — Triage analysis posted — incorrectly flagged removal of --inference-project-number as a breaking change, despite the issue explicitly stating the command is unreleased with no external users
  4. 12:49 — Human (ggallen) corrects the triage: "Not a breaking change... No feat!: prefix needed. Please re-triage."
  5. 12:56 — Re-triage completes ($0.53)
  6. 13:03 — Human dispatches code agent via /fs-code
  7. 13:20 — PR #6960 opened by code agent ($6.89), +250/-51 lines across 6 files
  8. 13:43 — Review agent completes ($7.63): 1 medium + 2 low findings. The medium finding identified a real logic bug — setting WIFProvider without InferenceProject would silently skip secret writes
  9. 13:44–13:54 — Fix agent ($2.39) addresses 2 of 3 findings, correctly disagrees with the privilege-scope-change finding (intentional behavior)
  10. 14:11 — Re-review approves ($6.58), 3 low informational findings only
  11. 14:23 — Human (ggallen) approves
  12. 14:52 — PR merged

Total agent cost: ~$24.82 | Time to merge: ~2h13m | Rework iterations: 1

What went well

  • Review agent caught a genuine correctness bug — the medium finding about WIFProvider set without InferenceProject causing silent secret-write skips was high-quality: it traced data flow across files, identified the gating condition, noted the test gap, and suggested a concrete fix.
  • Fix agent handled findings correctly — fixed the two actionable findings and appropriately disagreed with the intentional privilege-scope change.
  • Good test coverage — Codecov confirmed all modified lines covered. The code agent wrote 4 tests; the fix agent added a 5th for the validation gap.
  • CI stability — all CI, E2E, and functional test runs passed on both commits with no flakiness.

Evidence for existing issues

  • #2873 (code agent should trace consumers of modified gating variables): This PR is a direct instance. The code agent's test TestConverge_ExplicitWIFProviderNoProjectNumberRequired shows it intentionally designed the WIF path to not require InferenceProject, but downstream secret-writing code gates on cfg.InferenceProject != "". Tracing that consumer would have prevented the rework iteration.
  • #477 (correctness sub-agent should detect absent-input silent pass-through): The review agent's medium finding is exactly this pattern — validation allowed empty InferenceProject through, but downstream code silently skipped the work.
  • Re-review cost (#6950, agents #1092, agents #343): The re-review cost $6.58 (86% of the initial $7.63 review) for a fix commit that addressed exactly 2 specific findings. An incremental re-review scoped to the fix delta would have been substantially cheaper.

Proposals filed

This branch was successfully deployed

1 active and 1 inactive deployments
site-preview — 865355ad Deployed Sep 3, 2026 by github-actions[bot]
dev — 865355ad Deployed Sep 3, 2026 by fullsend-ai-coder[bot] via behaviour #11708
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-merge All reviewers approved — ready to merge ready-for-review Triggers review agent dispatch risk/moderate PR risk: moderate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add --inference-wif-provider to repos install, drop --inference-project-number

1 participant