Repository navigation
chore(#7381): delete poll-state branches; bot PAT Developer(30) - #7400
Conversation
GitLab uninstall now deletes the two poll-state branches (fullsend-poll-state-slash / fullsend-poll-state-events) via DeleteRef, treating a missing branch as success so older installs still uninstall cleanly. Legacy CI/CD variable deletion is unchanged. The created bot PAT is lowered from Maintainer(40) to Developer(30) now that poller state no longer requires Maintainer-only CI/CD variable writes. Expiry is computed from UTC so a local-timezone date cannot produce a token that GitLab already considers expired. Tests cover uninstall branch deletion (including not-found and hard-error paths) and Developer(30)/UTC-expiry PAT creation. Docs and ADR 0067 are annotated to match. Note: pre-commit could not fetch remote hook repos (git fetch origin --tags returned HTTP 403). Hooks were run directly: gofmt, go vet, gitleaks, lychee, ADR lint scripts. golangci-lint is not installed in this sandbox. Closes #7381
|
🤖 Finished Review · ✅ Success · Started 12:17 PM UTC · Completed 12:38 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $6.65 |
Site previewPreview: https://3ecbae23-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) DetailsRe-review: Tier 1 signals are identical to the prior assessment (bot author, medium blast radius, zero protected/security/CI/dependency paths) and Tier 2 shows the same high-churn, actively-maintained files with no new fix/revert pattern; the single new commit since the prior review is a docs-only wording fix to docs/cli/repos.md with no code or behavior change, so per re-review anchoring the score is preserved at 2 (moderate). Previous runRisk Assessment: moderate (2/5) DetailsRe-review: Tier 1 and Tier 2 signals are unchanged from the prior assessment (bot author, no protected/security/CI/dependency paths, medium blast radius, high historical churn on the touched files); the one additional commit since the prior review is a small, non-functional follow-up (doc annotation + reusing an existing package var) that does not change risk characteristics, so per re-review anchoring the score is preserved at 2 (moderate). Previous run (2)Risk Assessment: moderate (2/5) DetailsTier 1 is low (bot author, no protected/security/CI/dependency paths, modest size) but touched docs/Go files show high historical churn and the PR modifies existing uninstall/PAT-permission behavior with no feature flag, while tightly matching a well-scoped linked issue; composite rounds to 2 (moderate). |
|
Looks good to me Previous runReviewFindingsMedium
Next steps:
Previous run (2)ReviewFindingsMedium
Low
Next steps:
|
|
🤖 Finished Fix · ✅ Success · Started 12:40 PM UTC · Completed 12:51 PM UTC Commit: Runtime: claude · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $1.68 |
…se poll-state branch list Address review feedback on PR #7400: ADR 0067 and docs/cli/repos.md now call out that the Developer 30 bot PAT still depends on the target repo's branch protection granting Developers merge or push access to the default branch, since the poller creates pipelines via CreatePipeline on that protected branch. The number 5556 permission requirement is independent of the CI/CD variable rationale this PR resolves. A Maintainers-only merge and push configuration will 403 on pipeline creation; operators in that situation need to grant Developer merge or push access, or keep the PAT at Maintainer 40. internal/repos/uninstall.go: deleteGitLabPollStateBranches now reuses the existing package-level gitlabPollStateBranches var from install.go instead of a duplicate inline slice literal, dropping the now-unused internal/poll import. Addresses #7400
🔧 Fix agent — iteration 1 (bot-triggered)Fixed the medium logic-error finding by documenting, in ADR 0067, docs/cli/repos.md, and a code comment, that the Developer(30) bot PAT still depends on branch protection granting Developers merge/push access to the default branch for pipeline dispatch to keep working. Fixed the low code-organization finding by reusing the existing gitlabPollStateBranches var instead of a duplicate inline slice in uninstall.go. Recorded reasoned disagreements on the optional verify/fallback code suggestion and the optional PR retitle suggestion, both explicitly framed as optional by the reviewer. Fixed (2):
Disagreed (2):
Tests: passed Decision points
Next steps:
|
|
🤖 Finished Review · ✅ Success · Started 12:53 PM UTC · Completed 1:12 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $4.96 |
|
🤖 Finished Fix · ✅ Success · Started 1:14 PM UTC · Completed 1:22 PM UTC Commit: Runtime: claude · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $0.98 |
Review found docs/cli/repos.md told operators facing a Maintainers-only merge+push branch-protection setup to "pass a Maintainer-level --gitlab-bot-token" to work around the Developer(30) pipeline-dispatch 403. That flag is not an access-level override: setupGitLabBotToken always creates its own Developer(30) project access token when CreateProjectAccessToken succeeds and only falls back to the provided token when creation fails or no GitLab client is available (internal/cli/repos_gitlab.go). On Premium/Ultimate the docs were recommending a no-op. Replace the workaround with options that actually work: grant Developers merge/push access to the default branch, or manually replace FULLSEND_FORGE_TOKEN in GitLab after install (converge never re-touches an existing bot PAT on already-enrolled repos). Addresses #7400
🔧 Fix agent — iteration 2 (bot-triggered)Fixed the one active review finding: the GitLab bot-token doc section recommended passing a Maintainer-level --gitlab-bot-token to work around strict branch protection, but that flag is ignored whenever the automatic Developer(30) project-access-token creation succeeds (the common Premium/Ultimate path this PR ships). Replaced it with the two options that actually work and explained why the flag doesn't help. No code changes were needed or made; verified via secret scan, direct-execution pre-commit hook equivalents (docs-link lint, markdown-link lint via lychee, broken-symlink lint, EOF/whitespace checks), and a Go build sanity check of the touched packages. Fixed (1):
Tests: passed Decision points
Next steps:
|
|
🤖 Finished Review · ✅ Success · Started 1:24 PM UTC · Completed 1:35 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $2.86 |
Superseded by updated review
|
🤖 Finished Retro · ✅ Success · Started 2:40 PM UTC · Completed 2:47 PM UTC Commit: Runtime: claude · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $1.59 |
|
PR #7400 (GitLab poller-state phase 3c: delete poll-state branches on uninstall, lower bot PAT to Developer(30)) is part of a 3-phase sequence under parent #7343 (preceded by #7383/phase 3a and #7395/phase 3b). The workflow ran 9 agent dispatches (3 triage, 1 code, 3 review, 2 fix, ~$27 total, ~3h13m active elapsed from unblock to merge). Review quality was strong: Review #1 caught a real medium-severity gap (Developer(30) PAT may still lack merge/push rights under strict branch protection) plus a minor code-organization nit; the fix agent addressed both but its own documentation edit introduced a non-functional workaround ( |
Summary
Complete GitLab poller-state phase 3c: uninstall deletes the two poll-state branches, and the created bot PAT is lowered from Maintainer(40) to Developer(30) with a UTC expiry.
Related Issue
#7381 (part of #7343; follows #7379 / #7380)
Changes
repos uninstalldeletesfullsend-poll-state-slashandfullsend-poll-state-eventsviaDeleteRef(missing branches are ignored so older installs still uninstall cleanly). Legacy CI/CD variable deletion is unchanged.expires_atis computed from UTC so a local-timezone date cannot produce a token GitLab already considers expired (active: false).docs/cli/repos.md, uninstall guides, infrastructure reference, architecture) and a minor annotation on ADR 0067 match the new behavior.Testing
go test -race ./internal/repos/— uninstall branch deletion, not-found, and hard-error paths (deleteGitLabPollStateBranches100%,uninstallRepoResources100%).go test -race ./internal/cli/ -run 'GitLabBot|SetupGitLabBot'— Developer(30) PAT creation and UTC vs local expiry (gitlabBotPATExpiresAt100%,setupGitLabBotToken96.8%).go vet ./internal/repos/ ./internal/cli/ ./internal/forge/gitlab/Checklist
!for breaking changes)Closes #7381
Post-script verification
agent/7381-gitlab-pat-developer-uninstall)1e22c35bcbe38f08a8fedb6f2b4253f9476fbfaa..HEAD)