Repository navigation
feat(bitbucket): add Data Center pull request comments - #1728
Conversation
|
Hi @potiuk, It adds Data Center support for the existing Coverage added for:
The full Bitbucket test suite, ruff, formatting, mypy, Data Center review/approval, decline/reject, and merge writes remain separate follow-ups. Refs #606 |
- Say in the second Bitbucket bullet of the adapters spec that comment creation covers Data Center too, so both bullets agree. - Move the activities-feed comment back above get_pull_request_discussion, the function it describes. - Run the empty-body and missing-body-file CLI tests against both the Cloud and Data Center backends. Generated-by: Claude Opus 5
potiuk
left a comment
There was a problem hiding this comment.
LGTM. The Data Center comment write is correct and well tested, so rather than send it back for the last small points, I pushed a fixup commit (e4f191ef) to your branch:
tools/spec-loop/specs/adapters.md: the second Bitbucket bullet (write-path discipline) still said comment creation was Cloud-only. It now says Cloud and Data Center, matching the bullet this PR updated.tools/bitbucket/src/magpie_bitbucket/datacenter.py: I moved the activities-feed block comment back aboveget_pull_request_discussion, the function it describes. It was sitting above the new POST.tools/bitbucket/tests/test_bitbucket.py: the empty-body and missing-body-file CLI tests now run against both the Cloud and Data Center backends, so the fail-closed check on the newly enabled write path is pinned.
The endpoint and {"text": ...} payload match Data Center's pull-request comments resource.
The write goes through the guarded post_json path, and the response reuses _datacenter_comment, as pr discussion does.
Thanks!
This review was drafted by an AI-assisted tool and
confirmed by an Apache Magpie maintainer. The maintainer
approving this PR has read the findings and signed off. If
something feels off, please reply on the PR and a maintainer
will follow up.More on how Apache Magpie handles maintainer review:
Contributing guide.
Summary
pr comment <id> --body-file <path>command across Cloud and Data Center.Type of change
.claude/skills/<name>/) — eval fixtures updated belowtools/<system>/*.md)tools/*/withpyproject.toml)docs/,README.md,CONTRIBUTING.md)projects/_template/)prek, workflows, validators)Test plan
uv run --group dev ruff check src tests --fixuv run --group dev ruff format src testsuv run --group dev mypy src teststools/bitbucket/tests/test_bitbucket.pysuite passesgit diff --checkpassesImplementation
Bitbucket Data Center now creates a pull-request comment with:
POST /rest/api/1.0/projects/{project}/repos/{repo}/pull-requests/{id}/commentsusing the Data Center payload:
{"text": "<comment body>"}The returned Data Center comment is normalized through the existing pull-request comment output contract so callers continue using the same CLI and normalized response shape regardless of backend.
Write-path discipline is unchanged: the bridge executes the mutation only after the calling skill has obtained explicit user confirmation.
Scope
This PR only adds Data Center top-level pull-request comment creation.
Data Center approval/change-request, review verdict, decline/reject, and merge writes remain separate follow-up work under #606.
Refs #606