fix: give GitLab/Bitbucket pipelines the review job, and stop cleanup lying - #1432
Merged
Conversation
… lying
Two unrelated defects, both the "existed and was never reached" shape.
`ciTemplateFor` has taken a `{ review }` option since the GitLab and
Bitbucket templates were written, and its only call site never passed it.
A repository on either platform set up by `buddy setup` got a pipeline that
scheduled updates and never reviewed a merge request, while the GitHub
workflow has carried the review job from the start. The option is now
passed. The command honours `ai.review` at run time and works without a
key, so the job is as safe to include there as it is on GitHub.
GitHub's `deleteBranch` swallowed every failure — the comment said "branch
deletion failures are not critical" — so `cleanupStaleBranches`, whose
per-branch `catch` fills the `failed` bucket, could never reach it. Every
branch was reported deleted whether the push succeeded or not, and
`buddy update-check` printed "N branches deleted, 0 failed" over a remote
that still had them. GitLab and Bitbucket already throw here; GitHub now
does too, with one exception: a branch that is already gone is the outcome
the caller wanted, so that failure is a success. Failing cleanup over it
would leave the same branch "failing" on every run.
Three of the four callers already wrapped the call in `try`/`catch`. The
fourth — auto-closing a superseded pull request — is now guarded the same
way, because the pull request is closed either way and a branch that would
not delete is worth a warning rather than a failed run.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UWouahBJT3msK7V2VDYY6T
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two unrelated defects, both the "existed and was never reached" shape.
GitLab and Bitbucket pipelines had no review job
ciTemplateForhas taken a{ review }option since those templates were written:Its only call site:
So a repository on either platform set up by
buddy setupgot a pipeline that scheduled updates and never reviewed a merge request — while the GitHub workflow has carried the review job from the start. Passed now. The command honoursai.reviewat run time and works without a key, so it's as safe there as on GitHub.Cleanup reported deletions that didn't happen
GitHub's
deleteBranch:cleanupStaleBrancheshas a per-branchcatchthat fills itsfailedbucket. It could never reach it. Every branch was reported deleted whether the push succeeded or not, andbuddy update-checkprinted "N branches deleted, 0 failed" over a remote that still had them.GitLab and Bitbucket already throw here. GitHub now does too, with one exception: a branch that's already gone is the outcome the caller wanted, so that failure is a success — failing cleanup over it would leave the same branch "failing" on every run.
Three of the four callers already wrapped the call. The fourth — auto-closing a superseded PR — is now guarded the same way: the PR is closed either way, and a branch that won't delete is a warning, not a failed run.
Tests
2160 → 2166.
Lint ✓ · typecheck ✓ ·
check:docs✓ · 0 fail🤖 Generated with Claude Code
https://claude.ai/code/session_01UWouahBJT3msK7V2VDYY6T