Repository navigation
feat: park Bitbucket Cloud ship lanes while awaiting review - #20
Merged
Merged
Conversation
# Conflicts: # FORK.md # docs/fork-configuration.md
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 #17, which the upstream sync (PR #16) surfaced. Issue content:
a9ae3c0cfeat(crew): park ship lanes while awaiting review (feat(crew): park ship lanes while awaiting review kunchenguid/firstmate#7965). Newbin/fm-park.shparks a ship lane from a verified clean state once its PR only awaits human review, relaunches a fresh worker on review activity, and cleans the lane up on merge.fm_parkrefuses any PR that is not GitHub or GitLab (parking supports GitHub pull requests and GitLab merge requests only). A Bitbucket Cloud lane can never be parked, so it holds a worker slot for the whole review wait. The gate reads a forge snapshot with only a GitHub normalizer (GraphQL) and a GitLab normalizer (glab api); there is no Bitbucket normalizer. The snapshot must provide: no merge conflict and not behind base, mergeability computed, CI green on the current head, no changes requested, zero unresolved review threads (all read), and a reviewer-bot quiet window.bitbucketbranch in the snapshot function that reads the PR throughtwg bb pull-requests get/mergeability/...the waybin/fm-pr-health.shalready does (conflict, failed merge check, failed build, unresolved review threads), and a Bitbucket normalizer producing the same snapshot shape. Review-trigger relaunch (new comment, changes requested) and merge detection should reuse the existing Bitbucket merge poll and the fork's review-thread observer. Requested-changes and reviewer-bot detection need a decision on what Bitbucket exposes (reviewer approval state; bot accounts), and the bounded read timeFM_PARK_READ_SECSmust still hold giventwglatency.bin/fm-park.sh(provider check near theparking supports GitHub ...refusal,GITHUB_QUERY/GITHUB_NORMALIZE/GITLAB_NORMALIZE,snapshot, gate evaluation),bin/fm-pr-health.sh(existing Bitbucket reads to reuse),bin/fm-pr-lib.sh(shared PR helpers),tests/fm-park.test.sh(add a Bitbucket case with a stubbedtwg),docs/configuration.md(park-on-review section),docs/fork-configuration.mdandFORK.md(user-facing note when it ships).Found during the upstream sync in #16 (upstream range 913bb7a..427056c).
What Changed
bin/fm-park.shno longer refuses Bitbucket Cloud pull requests. It adds a Bitbucket snapshot branch that reads the PR throughtwg(two reads run together under the singleFM_PARK_READ_SECSlimit) and a normalizer that produces the same snapshot shape as GitHub and GitLab. It covers conflict, failed merge check, build state on the current head, changes requested, unresolved review threads, and review-bot handling. A read that runs over the limit counts as unreadable, so the lane is not parked.bin/fm-t3-mcp.mjs:waitRunnow starts with its first wait slice capped at the total timeout, then recomputes the slice from the remaining deadline after each timed-out wait.tests/fm-park.test.shusing a stubbedtwg. Documented Bitbucket parking indocs/configuration.md,docs/fork-configuration.md(settings, parking conditions, examples) andFORK.md.🤖 Generated with Claude Code
Risk Assessment
Testing
I ran the real fm-park.sh test suite, which drives the actual script against a stubbed twg. The Bitbucket cases cover the gate, relaunch triggers and the FM_PARK_READ_SECS bound. All 37 tests passed. I did not run a live Bitbucket or Herdr lab session, so real twg latency and real Bitbucket data were not exercised.
Evidence: fm-park test transcript
Source: fm-park test transcript
Pipeline
Updates from git push no-mistakes
Run outcome: ✅ pipeline passed on
85c4feaf.✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-t3-mcp.mjs:1000- Two changes in this branch are not needed by the Bitbucket parking intent. (1) bin/fm-t3-mcp.mjs waitRun slice arithmetic is a T3 wait-budget change with no link to Bitbucket parking. (2) bin/fm-park.sh action_start gets an extra2>/dev/nullon the subshell to hide setpgid warnings. Neither serves the issue Bitbucket: support parking ship lanes while awaiting review #17 requirements (Bitbucket snapshot/normalizer, review-trigger and merge reuse, bounded read time). Smallest honest remedy is to move them to their own change; confirm whether they are intended to ship here.✅ **Test** - passed
✅ No issues found.
bash tests/fm-park.test.sh(37 tests, exit 0, nonot ok)✅ **Document** - passed
✅ No issues found.
⏭️ **Lint** - skipped
✅ **Push** - passed
✅ No issues found.
Also in this PR
bin/fm-t3-mcp.mjs: thewaitRunslice arithmetic now keeps the T3 wait budget exact on the first slice. This is the pipeline's CI-round fix for a flaky timing test, kept here because flakiness is fixed even when unrelated.bin/fm-park.sh:action_startsilences its subshell's stderr so a bashsetpgidwarning under load does not leak into the watcher output. It sits in the file this change owns.Closes #17