feat(bitbucket): add guarded cloud PR merge - #1471
KatalKavya96 wants to merge 3 commits into
Conversation
|
Hi @potiuk — next narrow #606 follow-up after #1194. This adds guarded Bitbucket Cloud Focused/full Bitbucket tests, Ruff, mypy, repository hooks, and workspace pytest are green. Would appreciate your review when you get a chance. |
Kaap10
left a comment
There was a problem hiding this comment.
Thanks for working on this @KatalKavya96!
The overall structure and Data Center fail-closed handling look solid. However, there are two discrepancies between the documented contract shape and the implementation:
-
Missing
--strategyin CLI & Payload:README.mdand the PR summary documentpr merge <id> --strategy {merge,squash,rebase}, but--strategyis missing from_build_parser()incli.py.cloud.merge_pull_request()currently hardcodespayload={"type": "pullrequest"}without accepting or mapping the strategy parameter to Bitbucket's API values (merge_commit,squash,fast_forward).
-
Missing
landed_refnormalization:- The documentation mentions returning the merge commit as
landed_refwhen available, but innormalize.py(merged_pull_request),landed_refis not extracted fromresult_data.get("merge_commit", {}).get("hash").
- The documentation mentions returning the merge commit as
Could you add --strategy to cli.py / cloud.py and extract landed_ref in normalize.py along with matching tests?
|
Thanks @Kaap10 I updated the PR to:
Thanks for catching the contract/implementation mismatch. |
Summary
magpie-bitbucket pr merge <id> --strategy {merge,squash,rebase}.land(id, strategy) -> landed_refcontract shape, including extraction of the resulting merge commit when available.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-filespassesuv run pytest/ruff check/mypypasses(
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)
landed_ref, Data Center fail-closed behavior, and CLI dispatchgit diff --checkpassesRFC-AI-0004 compliance
landcontract rather than introducing a new framework-level vendor