fix(#6617): stop flagging legitimate GitLab variables as orphans - #6620
Conversation
|
🤖 Finished Review · ✅ Success · Started 1:44 AM UTC · Completed 2:04 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $7.76 |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Risk Assessment: moderate (2/5) DetailsScore unchanged from prior assessment at 2 (moderate). Tier 1 signals identical to prior run: same file count, similar line count, bot author, zero protected/security/CI/dependency signals. Tier 2 confirms high churn on forge.go and install.go but single-author dominance and no revert history keep contention risk low. Previous runRisk Assessment: moderate (2/5) DetailsTier 1 signals unchanged from prior run (same file count, similar line count 371-406, same bot author, zero protected/security/CI/dependency signals). Tier 2 confirms high churn on install.go and forge.go but single-author dominance and no revert history offset contention risk. No signals warrant deviation from prior score of 2. Previous run (2)Risk Assessment: moderate (2/5) DetailsBug fix in repos management addressing false-positive orphan detection on GitLab. Bot author with no protected paths, CI changes, or dependency modifications. Moderate file count (19 files, 371 lines) with acceptable test coverage. High churn in install.go and multi-author contention on forge.go are offset by very detailed acceptance criteria, no revert history, and safe rollback characteristics. Anchored to prior score of 2 with no signals warranting deviation. Previous run (3)Risk Assessment: moderate (2/5) DetailsBug fix in repos management addressing false-positive orphan detection on GitLab. Bot author with no protected paths, CI changes, or dependency modifications. Moderate file count (19 files, 371 lines) with good test coverage (37% test files). Standard bug fix scope with clear acceptance criteria from linked issue. Previous run (4)Risk Assessment: elevated (3/5) DetailsElevated risk driven by high git churn: changed files are hotspots with heavy 30-day commit activity, many distinct authors, and numerous fix/revert commits. The PR itself is moderate in size (19 files, 346 lines) with no protected paths, no security-sensitive files, and no CI/dependency changes, keeping the metadata tier low. The linked issue is well-scoped and the PR addresses its four-part fix scope with tests. Previous run (5)Risk Assessment: elevated (3/5) DetailsBug fix for false-positive GitLab drift detection with medium blast radius and high churn history in the repos module, partially mitigated by focused scope, comprehensive tests, and bot authorship. |
ReviewFindingsLow
Previous runLooks good to me Previous run (2)ReviewFindingsLow
Previous run (3)ReviewFindingsLow
Previous run (4)ReviewFindingsLow
Previous run (5)ReviewFindingsMedium
Low
|
|
/fs-fix - Rebase. Fix all the review issues. Resolve all the conversations. |
|
🤖 Finished Fix · ✅ Success · Started 2:20 AM UTC · Completed 2:32 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $2.92 |
🔧 Fix agent — iteration 1 (human-triggered)Addressed all 5 review findings: fixed latent slice-mutation bug with slices.Concat, removed stale FULLSEND_PER_REPO_INSTALL from 2 doc files, added 4 missing GitLab variables to infrastructure-reference.md, and migrated remaining bare string literals in converge.go and status.go to forge.* constants. Fixed (6):
Tests: passedNext steps:
|
- Replace append(requiredSecrets, ...) with slices.Concat to prevent
latent slice-mutation bug when uninstallSecrets aliases the same
backing array (slice-mutation finding)
- Remove FULLSEND_PER_REPO_INSTALL from operations.md and
infrastructure-reference.md since it is no longer set by the
installer (stale-doc findings)
- Remove FULLSEND_FORGE from GitLab variable docs (also stale)
- Add FULLSEND_DISPATCHED_KEYS_{FAST,FULL} and
FULLSEND_FAILED_KEYS_{FAST,FULL} to infrastructure-reference.md
(incomplete-doc finding)
- Migrate remaining bare string literals in converge.go and status.go
to forge.* constants for consistency (incomplete-scope finding)
Addresses review feedback on #6620
|
🤖 Review · ❌ Terminated · Started 2:34 AM UTC · Ended 2:53 AM UTC Commit: |
Site previewPreview: https://eca7f3d6-site.fullsend-ai.workers.dev Commit: |
|
🤖 Finished Review · ✅ Success · Started 2:34 AM UTC · Completed 2:53 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $8.51 |
|
/fs-fix - Rebase. Fix all the review issues. Resolve all the conversations. |
|
🤖 Finished Fix · ✅ Success · Started 3:03 AM UTC · Completed 3:12 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $3.41 |
- consumer-completeness: convergeSecrets now checks c.Present before emitting the "exists" detail, so FULLSEND_FORGE_TOKEN is not misleadingly reported as present when only GCP secrets exist. - missing-switch-case: add VarDispatchedKeysFast, VarDispatchedKeysFull, VarFailedKeysFast, VarFailedKeysFull to gitlabRequiredVariables and initialVarValue so convergence can repair them if missing. - stale-comment: remove "(or the guard variable)" from OrphanVar and CheckOrphanVars doc comments since the guard var is caught by the FULLSEND_ prefix check naturally. - Update test fixtures for the expanded gitlabRequiredVariables set. Addresses review feedback on #6620
🔧 Fix agent — iteration 2 (human-triggered)Addressed all 3 review findings from the second review cycle: fixed misleading convergeSecrets detail for absent secrets, added 4 new GitLab variables to gitlabRequiredVariables and initialVarValue for convergence repair support, and removed stale guard-variable references from drift.go doc comments. Updated test fixtures accordingly. Fixed (3):
Tests: passedNext steps:
|
|
🤖 Finished Fix · ✅ Success · Started 4:43 PM UTC · Completed 4:56 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $2.90 |
- Replace bare string literals with forge.* constants in TestCheckInstallComponents_GitLab_FullyInstalled, TestCheckInstallComponents_GitLab_MissingSecrets, and TestProbeComponents_GitLab_SkipsThinCallers for consistency - Add missing dispatched/failed keys variables to TestCheckInstallComponents_GitLab_MissingSecrets so it isolates the missing-secrets scenario - Reflow CheckOrphanVars doc comment to fix awkward mid-sentence line break Addresses review feedback on #6620
🔧 Fix agent — iteration 3 (human-triggered)Addressed all 8 review findings. 4 were already fixed in previous iterations (slice-mutation, missing-switch-case, consumer-completeness, stale-comment). Fixed the remaining 4: replaced bare string literals with forge.* constants in install_test.go and probe_test.go for consistency, added missing test variables to TestCheckInstallComponents_GitLab_MissingSecrets to properly isolate the missing-secrets scenario, and reflowed the CheckOrphanVars doc comment. Fixed (8):
Tests: passedNext steps:
|
|
🤖 Finished Review · ✅ Success · Started 5:06 PM UTC · Completed 5:22 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $4.24 |
repos status reported 7 false-positive orphan variable drifts on
GitLab repos because the managed variable set was incomplete.
Four changes fix this:
1. Add runtime state variables (DISPATCHED_KEYS_*, FAILED_KEYS_*)
to managedVarsForForge for GitLab with Dynamic: true and initial
value "{}". This makes CheckOrphanVars aware of them and seeds
them for the poller.
2. Exclude required secrets from orphan detection. On GitLab,
secrets are stored as masked CI/CD variables, so
ListRepoVariables returns them. CheckOrphanVars now adds
requiredSecretsForForge names to the managed set.
FULLSEND_FORGE_TOKEN is added to requiredSecretsForForge for
GitLab since it is stored via CreateRepoSecret.
3. Remove PerRepoGuardVar (FULLSEND_PER_REPO_INSTALL) from
managedVarsForForge for both forges per ADR-0044. The guard
variable remains in uninstall lists for cleanup of older
installs.
4. Define all managed variable and secret names as typed constants
in internal/forge/forge.go, replacing bare string literals
across internal/repos/, internal/poll/, and
internal/cli/repos*.go. Scoped to repos management — enrollment
and admin CLI references are unchanged.
Closes #6617
- Replace append(requiredSecrets, ...) with slices.Concat to prevent
latent slice-mutation bug when uninstallSecrets aliases the same
backing array (slice-mutation finding)
- Remove FULLSEND_PER_REPO_INSTALL from operations.md and
infrastructure-reference.md since it is no longer set by the
installer (stale-doc findings)
- Remove FULLSEND_FORGE from GitLab variable docs (also stale)
- Add FULLSEND_DISPATCHED_KEYS_{FAST,FULL} and
FULLSEND_FAILED_KEYS_{FAST,FULL} to infrastructure-reference.md
(incomplete-doc finding)
- Migrate remaining bare string literals in converge.go and status.go
to forge.* constants for consistency (incomplete-scope finding)
Addresses review feedback on #6620
- consumer-completeness: convergeSecrets now checks c.Present before emitting the "exists" detail, so FULLSEND_FORGE_TOKEN is not misleadingly reported as present when only GCP secrets exist. - missing-switch-case: add VarDispatchedKeysFast, VarDispatchedKeysFull, VarFailedKeysFast, VarFailedKeysFull to gitlabRequiredVariables and initialVarValue so convergence can repair them if missing. - stale-comment: remove "(or the guard variable)" from OrphanVar and CheckOrphanVars doc comments since the guard var is caught by the FULLSEND_ prefix check naturally. - Update test fixtures for the expanded gitlabRequiredVariables set. Addresses review feedback on #6620
- Replace bare string literals with forge.* constants in TestCheckInstallComponents_GitLab_FullyInstalled, TestCheckInstallComponents_GitLab_MissingSecrets, and TestProbeComponents_GitLab_SkipsThinCallers for consistency - Add missing dispatched/failed keys variables to TestCheckInstallComponents_GitLab_MissingSecrets so it isolates the missing-secrets scenario - Reflow CheckOrphanVars doc comment to fix awkward mid-sentence line break Addresses review feedback on #6620
8ad4b0c to
d757887
Compare
|
🤖 Finished Review · ✅ Success · Started 8:14 PM UTC · Completed 8:32 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $8.05 |
|
🤖 Finished Retro · ✅ Success · Started 9:12 PM UTC · Completed 9:26 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $4.40 |
|
PR #6620 (fix #6617: GitLab orphan variable false positives) completed same-day with a solid 19-file implementation by the code agent. The review agent found 1 medium-severity latent slice-mutation bug and ~10 low-severity findings across 6 review rounds. Three human-triggered Cost breakdown: ~$55 total ($10.76 code, $9.23 fixes, $44.30 reviews, $1.45 triage). Review costs were 4.8× fix costs. Evidence supporting existing open issues:
Other observations: The human reviewer instructed the fix agent not to include Signed-off-by trailers on the third Proposals filed
|
Summary
Fix false-positive orphan variable detection on GitLab repos.
repos statuswas flagging 7 legitimate variables as drifted because the managed variable set was incomplete for GitLab.Changes
FULLSEND_DISPATCHED_KEYS_FAST,FULLSEND_DISPATCHED_KEYS_FULL,FULLSEND_FAILED_KEYS_FAST,FULLSEND_FAILED_KEYS_FULLtomanagedVarsForForgefor GitLab withDynamic: trueand initial value{}CheckOrphanVarsnow addsrequiredSecretsForForgenames to the managed set, since on GitLab secrets are stored as masked CI/CD variables andListRepoVariablesreturns them.FULLSEND_FORGE_TOKENis added torequiredSecretsForForgefor GitLabPerRepoGuardVarfrommanagedVarsForForgefor both forges per ADR-0044 (per-org mode deprecation). Kept in uninstall lists for cleanup of older installsinternal/forge/forge.go, replacing bare string literals acrossinternal/repos/,internal/poll/, andinternal/cli/repos*.goTesting
TestCheckOrphanVars_GitLabSecretsNotFlagged: verifies all legitimate GitLab variables (runtime state, secrets-as-variables, bot token) are not flagged as orphansTestCheckOrphanVars_GitLabDetectsGenuineOrphan: verifies a truly unknown variable is still correctly flaggedTestCheckOrphanVars_PerRepoGuardVarFlaggedAsOrphan: verifies the deprecated guard variable is flagged when present from a previous installTestInstallVarsForForge_GitLabto assert all 7 GitLab managed variables are presentFULLSEND_FORGE_TOKENas a required secretinternal/repos/,internal/poll/, andinternal/cli/tests pass withgo test -raceCloses #6617
Post-script verification
agent/6617-fix-gitlab-orphan-vars)bfa5a2afa6f0e1ae46c6d7d7d142aded36372663..HEAD)