Skip to content

feat(bitbucket): add read-only cloud issue fetch#863

Open
KatalKavya96 wants to merge 2 commits into
apache:mainfrom
KatalKavya96:feat-bitbucket-cloud-issue-read
Open

feat(bitbucket): add read-only cloud issue fetch#863
KatalKavya96 wants to merge 2 commits into
apache:mainfrom
KatalKavya96:feat-bitbucket-cloud-issue-read

Conversation

@KatalKavya96

Copy link
Copy Markdown
Contributor

Summary

  • Adds magpie-bitbucket issue list-open and magpie-bitbucket issue get <id> for read-only Bitbucket Cloud issue listing/fetching where the repository issue tracker is enabled.
  • Starts partial contract:tracker coverage for the Bitbucket bridge while keeping Bitbucket Data Center native issue reads explicitly unsupported and pointing linked Jira coverage to separate follow-up work.
  • Normalizes Cloud issue output into stable partial read-only tracker context without adding issue writes, comments, assignment changes, state changes, or repository mutation paths.

Type of change

  • Skill change (.claude/skills/<name>/) — eval fixtures updated below
  • Tool / bridge contract (tools/<system>/*.md)
  • Python package (tools/*/ with pyproject.toml)
  • Groovy reference impl
  • Cross-cutting (RFC, AGENTS.md, sandbox, privacy-LLM)
  • Documentation (docs/, README.md, CONTRIBUTING.md)
  • Project template (projects/_template/)
  • CI / dev loop (prek, workflows, validators)
  • Other:

Test plan

  • prek run --all-files passes
  • For Python packages touched: PYTHONPATH=src uv run --group dev pytest tests/test_bitbucket.py -q
  • For Python packages touched: PYTHONPATH=src uv run --group dev pytest tests/test_bitbucket.py -q -k "issue"
  • For Python packages touched: uv run --group dev ruff check src tests --fix
  • For Python packages touched: uv run --group dev ruff format src tests
  • For Python packages touched: uv run --group dev mypy src tests
  • For Groovy bridges touched: command-line invocation tested end-to-end
  • For skill changes: eval suite passes for the affected skill
    (PYTHONPATH=tools/skill-evals/src python3 -m skill_evals.runner tools/skill-evals/evals/<skill>/)
  • For skill behaviour changes: a new or updated eval fixture is included in this PR
    (a regression test for the bug fixed / the behaviour added — see CONTRIBUTING.md)
  • Other: uv.lock was updated by the current workspace hook/uv resolution used during validation.

RFC-AI-0004 compliance

  • HITL — no mutation behaviour is added; the new commands are read-only
  • Sandbox — no new unrestricted host access; Bitbucket network reach remains declared in the adapter
  • Vendor neutrality — extends the existing Bitbucket contract:change-request / Coverage: partial-read-only bridge with partial Cloud-only contract:tracker reads without claiming complete backend parity
  • Conversational + correctable — agentic-override path remains documented for adopter-tunable behaviour
  • Write-access discipline — this PR only reads Cloud issue context and does not create, edit, comment on, assign, close, reopen, or otherwise mutate issues or repository state
  • Privacy LLM — fetched issue titles/descriptions, reporter/assignee names, links, and raw Bitbucket payloads remain external data and are emitted as read-only bridge output for the caller to handle under existing privacy/approved-LLM rules

Linked issues

Refs #606

Notes for reviewers

This follows the recently merged Bitbucket read-only PR/repo context commands and starts the missing tracker side of #606 conservatively.

The new commands are:

magpie-bitbucket issue list-open
magpie-bitbucket issue get <id>

Scope is intentionally narrow:

  • Bitbucket Cloud: supports read-only issue listing/fetching where the repository issue tracker is enabled.
  • Bitbucket Data Center: native Bitbucket issue reads are explicitly unsupported and return a clear error pointing toward linked Jira coverage instead.

The normalized output includes issue ID, title, state, kind, priority, reporter, assignee, timestamps, permalink, description, labels, and raw backend payloads.

This remains partial read-only. It does not add issue creation, issue edits, comments, assignment changes, state transitions, linked Jira handoff, PR mutation, build mutation, or repository content changes.

@KatalKavya96

Copy link
Copy Markdown
Contributor Author

Hi @potiuk, I opened the next Bitbucket follow-up for #606.

This PR adds read-only Bitbucket Cloud issue reads:

magpie-bitbucket issue list-open
magpie-bitbucket issue get <id>

It starts partial contract:tracker coverage for the Bitbucket bridge by listing/fetching Cloud issues where the repository issue tracker is enabled. Bitbucket Data Center native issue reads are kept explicitly unsupported and point toward linked Jira coverage instead.

This remains partial read-only and does not add issue creation, edits, comments, assignment changes, state transitions, PR mutations, build mutations, or repository content changes.

prek run --all-files and targeted Bitbucket pytest/ruff/mypy checks are passing.

@KatalKavya96 KatalKavya96 force-pushed the feat-bitbucket-cloud-issue-read branch from 1d126fb to 120df75 Compare July 14, 2026 12:18

@potiuk potiuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — clean, conservative Cloud issue read that follows the established Bitbucket bridge patterns. DC correctly rejects native issue reads (surfaces as a clean exit via the entry wrapper), the capability table / docs / spec-loop notes are consistent, and it's well tested. One non-blocking inline note on the open-state filter.

Comment thread tools/bitbucket/src/magpie_bitbucket/cloud.py Outdated
@KatalKavya96

Copy link
Copy Markdown
Contributor Author

Thanks @potiuk, that makes sense. I added state="on hold" to the Cloud issue list-open query and updated the test so unresolved on-hold issues are included in active issue reads too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants