Skip to content

fix(comments,pipelines): send {} body so resolve/stopPipeline don't 400 - #5

Open
Millon15 wants to merge 1 commit into
zach-snell:mainfrom
Millon15:fix/resolve-empty-body-400
Open

fix(comments,pipelines): send {} body so resolve/stopPipeline don't 400#5
Millon15 wants to merge 1 commit into
zach-snell:mainfrom
Millon15:fix/resolve-empty-body-400

Conversation

@Millon15

Copy link
Copy Markdown
Contributor

Problem

bbkt prs comments resolve always fails with API error 400: Bad Request, so comment threads cannot be resolved from the CLI (or the MCP resolve tool) — you have to open the browser.

Cause

ResolvePRComment (and StopPipeline) POST a nil body. The client then sends Content-Type: application/json with an empty body, which Bitbucket rejects with 400. The approve/decline actions already send an empty JSON object {} and work fine.

Fix

Send map[string]interface{}{} ({}) from ResolvePRComment and StopPipeline, matching the existing approve/decline body-less-action convention.

Verification

  • New regression test TestResolvePRComment_SendsEmptyJSONBody asserts the resolve POST body is {} with a JSON content type.
  • Reproduced live against a real PR: old build → API error 400; patched build → Comment thread N resolved successfully.
  • go test ./... green.

Bitbucket rejects an empty request body sent with Content-Type:
application/json (HTTP 400). ResolvePRComment and StopPipeline posted a
nil body; the approve/decline actions already send an empty JSON object
{}. Align resolve/stopPipeline with that convention.

Adds a regression test asserting resolve POSTs {} with a JSON content type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant