Repository navigation
fix(#7378): set per-repo guard during shared GitHub install - #7382
fullsend-ai-coder[bot] wants to merge 1 commit into
Conversation
managedVarsForForge omitted FULLSEND_PER_REPO_INSTALL, so repos.Install (used by repos migrate) never wrote the ADR-0033 guard. After migrate set enabled: false, per-org reconcile opened offboard PRs that deleted the freshly installed shim. Include the guard in the GitHub managed-var list so every shared install path (migrate, repos install, admin install) writes it. Note: pre-commit could not fetch remote hook repos (HTTP 403). Hooks were run directly (gofmt, go vet, gitleaks, lychee, trailing-whitespace). golangci-lint is not installed in this sandbox; go vet ./internal/repos passed. Closes #7378
|
🤖 Finished Review · ✅ Success · Started 6:55 PM UTC · Completed 7:12 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $4.96 |
Site previewPreview: https://aceaefa4-site.fullsend-ai.workers.dev Commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Risk Assessment: moderate (2/5) DetailsTier 1 is low risk (small, non-protected, non-security, bot-authored bugfix with moderate test coverage); Tier 2 is elevated by high historical churn/fix-revert rates in the touched package; Tier 3 is low risk given an exact, well-scoped, high-priority bugfix matching a same-day issue with no open discussion, offset only by the lack of a rollback flag for the behavior change; weighted composite rounds to a moderate score of 2. |
ReviewFindingsMedium
Low
Next steps:
|
There was a problem hiding this comment.
Note: The following review comments could not be posted on the diff (GitHub returned 422) and are included here instead:
internal/repos/install.go(file-level): Line 519 · [medium] logic-error
FULLSEND_PER_REPO_INSTALL was added to managedVarsForForge (so Install/migrate/admin install write it on new/refreshed installs), but it was not added to the GitHub requiredVariables list, which remains only FULLSEND_MINT_URL. ProbeComponents presence-checks only names in requiredVarsForForge; the guard now appears in expectedVarValues via staticExpectedVarValues, so it falls into the 'extra variables' loop, which explicitly skips reporting absence ('these are optional, so absence is not a problem'). A repo already migrated/installed before this fix -- the exact konflux-ci production incident described in #7378 -- has FULLSEND_MINT_URL present but the guard missing, and neither repos status nor repos converge will detect or repair it, since convergeVariables only acts on components ProbeComponents already returned. The fix protects future installs/migrates but does not close the gap for repos already affected by the bug it targets.
Suggested fix: Add forge.PerRepoGuardVar to the GitHub requiredVariables list in internal/repos/install.go (not to gitlabRequiredVariables) so ProbeComponents treats its absence as drift, enabling repos converge to backfill it and repos status to report it. Add a test where FULLSEND_MINT_URL is present and the guard is absent, asserting converge/status add/report it.
| │ │ FULLSEND_GCP_REGION │ │ | ||
| │ │ FULLSEND_MINT_URL │ │ | ||
| │ │ FULLSEND_REVIEW_CLIENT_ID (best-effort) │ │ | ||
| │ │ FULLSEND_PER_REPO_INSTALL=true (GitHub) │ │ |
There was a problem hiding this comment.
[low] docs-correctness
The new line FULLSEND_PER_REPO_INSTALL=true (GitHub) was added under 'Both modes write the same credential set' in the Phase 6 diagram, but the guard is per-repo-only by design (per-org must not write it). The diagram's existing per-repo-only sub-box still references the variable under a stale name, FULLSEND_PER_REPO_GUARD=true, so the new line duplicates/conflicts with that entry rather than correcting it.
Suggested fix: Move FULLSEND_PER_REPO_INSTALL=true (GitHub) out of the shared credential list and into the per-repo-only sub-box, replacing FULLSEND_PER_REPO_GUARD=true so the diagram reflects the correct variable name in the correct scope.
|
🤖 Finished Fix · ✅ Success · Started 7:14 PM UTC · Completed 7:27 PM UTC Commit: Runtime: claude · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $2.49 |
|
Closing this PR because the guard-only fix does not implement the intended solution for #7378. After successful migration, The issue description is being corrected to make those acceptance criteria explicit. The missing guard identified in the original report led triage and implementation toward a different solution; setting the guard alone does not satisfy the requested source-config cleanup. |
|
🤖 Finished Retro · ✅ Success · Started 7:25 PM UTC · Completed 7:33 PM UTC Commit: Runtime: claude · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $1.39 |
Address review feedback on PR #7382: - Add forge.PerRepoGuardVar to the GitHub requiredVariables list so ProbeComponents (and therefore repos status/converge) reports its absence as drift instead of silently skipping it as an optional extra variable. This closes the gap left by the original fix: repos installed/migrated before the guard existed (e.g. the konflux-ci incident in #7378) now get detected and repaired, not just future installs. uninstall.go's explicit PerRepoGuardVar entry is dropped since it's now pulled in via requiredVariables, avoiding a double delete. Added converge/status tests reproducing the pre-existing install scenario and updated shared "fully installed" test fixtures to include the guard. - Fix docs/guides/dev/cli-internals.md: move FULLSEND_PER_REPO_INSTALL=true out of the "both modes" shared credential list (it's per-repo-only by design) and into the per-repo-only sub-box, replacing the stale FULLSEND_PER_REPO_GUARD name. Addresses #7382
🔧 Fix agent — iteration 1 (bot-triggered)Fixed the drift-detection gap: FULLSEND_PER_REPO_INSTALL is now in the GitHub requiredVariables list so repos status/converge detect and repair it on repos migrated before the guard existed (the exact konflux-ci scenario from #7378), with new tests covering that case. Fixed uninstall.go's now-redundant explicit guard entry. Corrected the cli-internals.md diagram to place the guard variable in the per-repo-only scope with the correct name. Fixed (2):
Tests: passed Decision points
Next steps:
|
|
PR #7382 fixed issue #7378 exactly as the issue's original diagnosis suggested (add the |
Summary
repos migrate(and every other caller ofrepos.Install) now writesFULLSEND_PER_REPO_INSTALL=trueon GitHub repos. Migrating a repo to per-repo install no longer leaves it unprotected against still-live per-org reconcile, which was opening offboard PRs that deleted the freshly installed shim.Related Issue
#7378
Changes
FULLSEND_PER_REPO_INSTALL=trueto the GitHub managed-variable list inmanagedVarsForForge, the shared source of truth used by install, migrate, converge, and status.Testing
go test -race -count=1 -coverprofile=coverage.out ./internal/repos/— pass (90.0% package coverage;managedVarsForForge100%).go vet ./internal/repos/— pass.pre-commit runcould not fetch remote hook repos (HTTP 403);golangci-lintis not installed in this sandbox.Checklist
fix(#7378): ...)Closes #7378
Post-script verification
agent/7378-migrate-per-repo-guard)6aa078bc7dc2a5f0dcf2aea8e78e604e380cb2ff..HEAD)