Repository navigation
feat(bin): settle captain holds from Bitbucket Cloud PR events - #19
Merged
Merged
Conversation
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.
Intent
Close the Bitbucket Cloud gap tracked in #18, which the upstream sync (PR #16) surfaced. Issue content:
34c77d54feat(bin): settle declared captain holds from forge PR events (feat(bin): settle declared captain holds from forge PR events kunchenguid/firstmate#8422). Withconfig/hold-pr-settlepresent,bin/fm-captain-hold.sh pr-policydeclares which PR event (merge, unmerged close, or either) answers a captain hold, andsettle-prapplies it from the contribution observer's durable terminal evidence. The observer also gains aclosedpending event for unmerged closure.pr-policyaccepts only a canonicalgithub.comPR URL (pr-policy requires a canonical github.com PR URL), so a hold linked to a Bitbucket PR can never carry a policy. Separately, the observer only counts a Bitbucket PR while review-thread tracking is on (config/contributions-reply-ageset; see the--if-ownedpath andbitbucket_known), and the newmerged/closedterminal evidence andclosedevent are built for the GitHub observation path. The fork'sobserve_bitbucketalready mapsMERGEDtomergedandDECLINED/SUPERSEDEDtoclosed, so the raw state exists; it is just not wired into settlement.https://bitbucket.org/<workspace>/<repo>/pull-requests/<n>inpr-policy; make the observer retain terminal Bitbucket evidence (merged, and DECLINED/SUPERSEDED as closed) for held tasks even when reply-age tracking is off; emit the sameclosedpending event once per owner; and makesettle-praccept that evidence. The "never changes the PR" Bitbucket rule is unaffected, because settlement only changes the captain hold.bin/fm-captain-hold.sh(pr-policyURL check,settle-previdence read),bin/fm-contributions.sh(observe_bitbucket,known/bitbucket_known,--if-ownedgating,closedevent),bin/fm-contributions.jq(Bitbucket state reduction),tests/fm-contributions.test.shandtests/fm-contributions-bitbucket.test.sh(terminal-state and closed-event cases),docs/captain-hold-lifecycle.md,docs/configuration.md,docs/fork-configuration.md,FORK.md.Found during the upstream sync in #16 (upstream range 913bb7a..427056c).
What Changed
bin/fm-captain-hold.sh:pr-policynow acceptshttps://bitbucket.org/<workspace>/<repo>/pull-requests/<n>as well as canonical GitHub PR URLs, andsettle-prreads Bitbucket terminal evidence.bin/fm-contributions.shandbin/fm-contributions.jq: the observer keeps terminal Bitbucket state for held tasks even whenconfig/contributions-reply-ageis unset. It treats MERGED asmergedand DECLINED/SUPERSEDED asclosed, and emits theclosedpending event.tests/fm-contributions-bitbucket.test.shadds terminal-state and closed-event cases.FORK.md,docs/configuration.mdanddocs/fork-configuration.mddocument the Bitbucket behavior.Risk Assessment
✅ Low: The change is narrowly scoped to Bitbucket hold settlement. It is gated on config/hold-pr-settle and a held task, never writes to the forge, and has behavioral tests that exercise the real scripts.
Testing
I ran the three targeted shell suites: Bitbucket contributions, captain-hold lifecycle and GitHub contributions. All passed. The Bitbucket suite drives the real scripts, and its new cases cover everything in the change. It ran twice, both times clean. I did not run the full repository test suite or any Herdr/tmux lab. The product has no UI, so there are no screenshots.
Evidence: Bitbucket suite output
Source: Bitbucket suite output
Pipeline
Updates from git push no-mistakes
Run outcome: ✅ pipeline passed on
5c981102.✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-contributions-bitbucket.test.sh(14 ok, 0 not ok, run twice)bash tests/fm-captain-hold-lifecycle.test.shbash tests/fm-contributions.test.sh✅ **Document** - passed
✅ No issues found.
⏭️ **Lint** - skipped
✅ **Push** - passed
✅ No issues found.
Closes #18