Repository navigation
fix(bitbucket): fail closed for removed cloud issues - #1599
KatalKavya96 wants to merge 1 commit into
Conversation
Kaap10
left a comment
There was a problem hiding this comment.
Thanks for working on this @KatalKavya96!
Tested this locally - all 214 tests in tools/bitbucket pass, ruff and mypy are clean, and verified that invoking magpie-bitbucket issue list-open immediately fails closed with the informative error message before any network call. The fail-closed compatibility design is very neat.
Left a couple of observations from my side:
1. Central capability registry sync (docs/labels-and-capabilities.md)
In docs/labels-and-capabilities.md, the tools/bitbucket entry currently still lists the old native Cloud issue capabilities:
"Tracker coverage includes Cloud-only issue listing/fetching, issue comment fetching, issue attachment metadata fetching, and confirmed issue-comment creation."
It would be great to update this line in sync with your changes in tools/bitbucket/README.md and tools/spec-loop/specs/adapters.md, so the central registry also reflects that native Cloud issue operations now fail closed and point to Jira.
2. Optional Nit: End-to-end CLI exit code test
The tests in test_bitbucket.py verify that cloud.list_open_issues(...) raises BitbucketError before calling build_opener. The CLI dispatch tests (test_cli_issue_*_cloud) mock the backend functions to test payload normalization.
As a nice-to-have complement, you could also consider adding a quick test asserting that the unmocked CLI entry point (package_main(["issue", "list-open"])) returns exit_code == 1 when invoked on Cloud, similar to how Data Center unsupported commands are tested in test_cli_pr_merge_datacenter_fails_without_request.
Summary
issueCLI commands as fail-closed compatibility stubs: issue list/get/comments/comment/attachments now reject before making any HTTP request and direct callers toward linked Jira coverage.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 --checkpasses.RFC-AI-0004 compliance
contract:trackercoverage; callers are directed toward the separate linked Jira adapter pathLinked issues
Refs #606
Notes for reviewers (optional)
Atlassian fully removed the native Bitbucket Cloud Issue Tracker API on August 20, 2026. The bridge still contained working implementations for:
issue list-openissue get <id>issue comments <id>issue comment <id> --body-file <path>issue attachments <id>Those commands could therefore attempt requests against API endpoints that no longer exist.
This change intentionally keeps the CLI surface rather than removing the commands outright, so existing callers receive an explicit and actionable error instead of an argparse/command-not-found break. Each native Cloud issue operation now fails closed before constructing or sending an HTTP request and points callers toward linked Jira coverage.
The normalization helpers and historical payload fixtures remain in place; this PR changes the reachable runtime behavior rather than deleting historical response-shape support.
Data Center native issue operations were already unsupported and remain unchanged.