feat(bitbucket): add read-only cloud issue comments fetch#864
Conversation
|
Hi @potiuk, I opened the next Bitbucket follow-up for #606. This adds read-only Cloud issue comment fetching: magpie-bitbucket issue comments <id>It keeps the same partial Targeted pytest, ruff, mypy, and |
potiuk
left a comment
There was a problem hiding this comment.
Approve — with a few optional nits. Clean, narrowly-scoped read-only addition that faithfully follows the existing Bitbucket bridge patterns and is well-tested. No blocking issues.
Correctness looks solid:
- Pagination reuses the vetted
_validated_next_urlloop-guard (same scheme/host enforcement + repeated-URL rejection) — no infinite-loop or redirect risk. - URL construction uses
quote_pathand hits the correct Cloud endpoint; DC rejects before any normalize call. - Helper reuse (
_cloud_user,_cloud_issue_content,_cloud_timestamp,_cloud_link,_participants) is all correct —_participantskeys off theauthorfield the normalizer sets.
Nits (none blocking):
_cloud_issue_commentsets"deleted": raw.get("deleted")raw, bypassing the_bool_or_noneconvention used elsewhere for optional booleans. Suggest_bool_or_none(raw.get("deleted"))for consistency/robustness — this is the one I'd actually fold in.- The
kind != "cloud"branch innormalize.issue_comments(_unsupported_issue_comment) is unreachable via the CLI, sincedatacenter.get_issue_commentsraises first. Harmless, but it's dead/untested in practice — worth dropping or a one-line note on why it's kept. - Optional: a CLI-level test for
issue comments <id>against a Data Center env (non-zero exit + guidance message) would mirror the Cloud CLI test; the backend-level test already covers the raise.
Docs are consistently updated across labels-and-capabilities.md, the tool README, and adapters.md, and the README renumbering is correct. Read-only / no-mutation scope matches the RFC-AI-0004 claims. Thanks!
Summary
magpie-bitbucket issue comments <id>for read-only Bitbucket Cloud issue comment fetching where the repository issue tracker is enabled.contract:trackercoverage added by Cloud issue list/get with read-only issue discussion context, while keeping Bitbucket Data Center native issue comments explicitly unsupported with linked Jira handoff guidance.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 -q -k "issue_comments or issue_comment"PYTHONPATH=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)
git diff --checkpassesRFC-AI-0004 compliance
contract:change-request/ partialcontract:trackerbridge without claiming complete backend parityLinked issues
Refs #606
Notes for reviewers
This follows the recently merged Bitbucket Cloud issue read PR and adds the next conservative tracker-side read.
The new command is:
Scope is intentionally narrow:
The normalized output includes issue ID, comment ID, author, body, timestamps, permalink, participants, labels/coverage context, and raw backend payloads.
This remains partial read-only. It does not add issue comment creation, edits, deletion, assignment changes, state transitions, linked Jira handoff, PR mutation, build mutation, or repository content changes.