feat(bitbucket): add read-only PR merge-checks fetch#852
Conversation
|
Hi @potiuk, I opened the next Bitbucket follow-up for #606 after the merged PR review-state command. This PR adds a conservative read-only merge-check context command:
It composes the existing read-only PR status and review-state fetches with the PR payload, then normalizes merge-check context such as reported mergeability/conflict fields where exposed, status-check aggregate state, review decision, blockers, and raw backend payloads. I intentionally kept this partial and conservative: if Bitbucket Cloud or Data Center does not expose a clear mergeability/conflict signal, the normalized output keeps it as
|
potiuk
left a comment
There was a problem hiding this comment.
Read-only merge-check composition over existing status/reviews signals plus the DC GET .../merge test endpoint — conservative "keep unknown rather than guess" normalization, consistent with the existing partial-read-only adapter. Green CI, solid test coverage. LGTM.
Summary
magpie-bitbucket pr merge-checks <id>as a read-only Bitbucket pull-request merge-check context command.contract:change-requestBitbucket coverage after PR reviews/status, without adding any merge, approval, comment, branch, build, or other mutation path.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
prek run --all-filespassesPYTHONPATH=src uv run --group dev pytest tests/test_bitbucket.py -quv run --group dev ruff check src tests --fixuv run --group dev ruff format src testsuv run --group dev mypy src tests(
PYTHONPATH=tools/skill-evals/src python3 -m skill_evals.runner tools/skill-evals/evals/<skill>/)(a regression test for the bug fixed / the behaviour added — see CONTRIBUTING.md)
RFC-AI-0004 compliance
contract:change-request/Coverage: partial-read-onlyadapter without introducing a Bitbucket-specific capability contractLinked issues
Refs #606
Notes for reviewers
This follows the recently merged Bitbucket PR review-state command and targets the next PR-management gap: read-only mergeability / merge-check context.
The new command is:
magpie-bitbucket pr merge-checks <id>It composes existing read-only PR status and review-state fetches with the PR payload, then normalizes conservative merge-check context:
mergeable/can_merge/canMergefields where exposedThis intentionally does not claim complete Bitbucket mergeability parity. If the backend does not expose a clear mergeability or conflict field, the normalized output keeps that value as
unknowninstead of guessing.This remains read-only. It does not add merge execution, comment posting, approvals, request-changes actions, branch edits, issue changes, build retries, or any other mutation path.