Repository navigation
fix(pr): report queued merges instead of printing "" (1.6.0) - #7
Merged
Merged
Conversation
Bitbucket answers POST pullrequests/{id}/merge with 202 when it queues the
merge, and names the task only in the Location header. PostAsync dropped
headers, so bbx 1.5.0 printed the empty body as "" and exited 0. On
16 Nov 2026 that hid three queued merges: two were dropped and one landed
40 minutes later, with no task ID to follow any of them.
pr merge now keeps the Location header, polls task-status (default 120s,
--timeout) and prints the merged pull request on success. A merge still
pending at the timeout prints "status": "queued" with the task ID, the
task-status URL and the follow-up command, and exits 75 (EX_TEMPFAIL) so
scripts can tell it from success and from failure. --no-wait returns the
queued record at once. merge-status gains --wait/--timeout and accepts
either the task ID or the URL that merge prints.
deployments changes, the only other 202 write, now says "Queued" rather
than "Updated".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014Mjr3Y5biNhSM8Bmg4xfaw
Live checks on a throwaway repository during the 16 Nov 2026 slowdown found two more ways to lose a queued merge: - Without ?async=true the merge POST blocked past the 30s client timeout, exiting 1 with the outcome unknown. The handler now asks for async, gives the POST 120s, and says the merge may be queued if it still times out. The timeout moved from HttpClient.Timeout into BitbucketClient so one call can wait longer; it keeps the inner TimeoutException that Program uses to tell a timeout (exit 1) from Ctrl+C (exit 130). - After two minutes of PENDING one task-status poll hung for 30s and the error ended the wait, losing the task ID. Timeouts, 5xx and 429 during a poll are now retried until --timeout; the last one is reported as last_poll_error. 4xx still ends the wait, since 400 is a failed task. The final live run got a real 202, polled PENDING for 600s and exited 75 with the task ID in its JSON. The repository was deleted afterwards. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014Mjr3Y5biNhSM8Bmg4xfaw
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.
bbx pr mergeprinted""and exited 0 when Bitbucket queued a merge (HTTP 202), so the task ID was lost. Seen on 16 Nov 2026 during Bitbucket's API slowdown.Changes
?async=true, reads the task from the 202Locationheader (orlinks.self.href) and polls task-status every 3s up to--timeout(default 120)."status": "queued"withtask_id,task_status_urland anextcommand, and exits 75. A failed task exits 1.--no-waitreturns the queued record with exit 0.BitbucketClient.merge-statusgains--waitand--timeout, and--task-idtakes the ID or the URL.deployments changes(the other 202 write) now says "Queued".Testing
solrevdevworkspace, each deleted with a 404 check afterwards: a real 202 came back with a task ID, the task stayed PENDING for 600s, and bbx exited 75 with the task in its JSON. Bitbucket never finished that task, so the SUCCESS path is covered by unit tests only. No foremost-group PR was merged.🤖 Generated with Claude Code
https://claude.ai/code/session_014Mjr3Y5biNhSM8Bmg4xfaw