Repository navigation
feat(bitbucket): add reject contract support - #1594
Conversation
|
Hi @potiuk — next narrow #606 follow-up after #1591. This adds Bitbucket Cloud support for the backend-neutral The confirmed reason is posted as a PR comment first, then the PR is declined. If the decline fails after the comment was posted, the command reports the partial outcome and tells the caller to inspect the PR before retrying, avoiding duplicate rejection comments. Empty reasons are rejected before any write, and Data Center remains fail-closed. Focused/full Bitbucket tests, Ruff, mypy, workspace pytest, validators, spec checks, and the full |
potiuk
left a comment
There was a problem hiding this comment.
LGTM — reject reuses the reviewed comment and decline primitives, an empty reason is refused before any write, and a decline that fails after the reason was posted is reported as a partial outcome naming pr discussion / pr get, the same safe shape as post_review. ok requires both the comment and the declined PR, Data Center fails closed before any request, and the README and adapters.md record the new write. CI is green.
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
reject(id, reason) -> okchange-request contract throughpr reject <id> --reason-file <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-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)
git diff --checkpassesRFC-AI-0004 compliance
reject(id, reason)change-request contractLinked issues
Refs #606
Notes for reviewers (optional)
Bitbucket Cloud does not attach a rejection reason directly to the decline mutation, so the contract is implemented as two explicit steps:
The rejection reason is validated as non-empty before any write.
If the comment succeeds but the decline request fails, the command raises an explicit partial-outcome error directing the caller to inspect
pr discussion <id>andpr get <id>before retrying. This prevents a blind retry from duplicating the already-posted rejection comment.Bitbucket Data Center reject writes remain unsupported in this follow-up to keep the change narrow.