Skip to content

feat(bitbucket): add read-only PR commits fetch#797

Merged
potiuk merged 1 commit into
apache:mainfrom
KatalKavya96:feat-bitbucket-pr-commits
Jul 10, 2026
Merged

feat(bitbucket): add read-only PR commits fetch#797
potiuk merged 1 commit into
apache:mainfrom
KatalKavya96:feat-bitbucket-pr-commits

Conversation

@KatalKavya96

@KatalKavya96 KatalKavya96 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds magpie-bitbucket pr commits <id> as a read-only Bitbucket change-request operation.
  • Fetches commits associated with a pull request from both Bitbucket Cloud and Bitbucket Data Center with pagination.
  • Normalizes commit output into commits[] with hash, message, author, date, links, and raw payloads, without adding any write or repository mutation path.

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: uv run pytest / ruff check / mypy passes
  • 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: verified targeted Bitbucket tests with PYTHONPATH=src uv run --group dev pytest tests/test_bitbucket.py

RFC-AI-0004 compliance

  • HITL — no new mutation is added; the command is 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 adapter without introducing a new Bitbucket-specific capability contract
  • Conversational + correctable — no new autonomous decision path is added
  • Write-access discipline — this PR only reads pull-request commits and does not mutate branches, refs, repository history, PR state, comments, approvals, or builds
  • Privacy LLM — fetched commit messages and raw payloads remain external data and are emitted as read-only bridge output for the caller to handle under the existing privacy/approved-LLM rules

Linked issues

Refs #606

Notes for reviewers

This is the next read-only Bitbucket follow-up after the PR discussion and PR status work.

The new command is:

magpie-bitbucket pr commits <id>

It fetches commits associated with a pull request:

  • Bitbucket Cloud: PR commits endpoint with Cloud pagination.
  • Bitbucket Data Center: PR commits subresource with start / nextPageStart pagination.

This intentionally keeps the scope to read-only commit metadata. It does not mutate branches, refs, repository history, PR state, comments, approvals, merge state, or Pipelines/builds.

Docs were updated in the Bitbucket README, spec-loop adapter inventory, and labels/capabilities inventory to reflect the new partial read-only commit coverage.

@KatalKavya96 KatalKavya96 force-pushed the feat-bitbucket-pr-commits branch from cedf014 to a1a88fb Compare July 10, 2026 06:07
@KatalKavya96

Copy link
Copy Markdown
Contributor Author

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

This adds magpie-bitbucket pr commits <id> as a read-only commit fetch operation under the existing contract:change-request + Coverage: partial-read-only model.

The implementation fetches commits associated with a pull request from both Bitbucket Cloud and Bitbucket Data Center with pagination, then normalizes them into commits[] with commit hash, message, author, date, links, and raw payloads.

I also updated the Bitbucket README, spec-loop adapter docs, and labels/capabilities inventory so the documented coverage matches the new behavior. After self-review, I adjusted the README wording to present this as a commits[] supplement rather than implying a new formal get_commits contract verb.

prek run --all-files is passing.

@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.

Nice!

@potiuk potiuk merged commit c677bde into apache:main Jul 10, 2026
9 checks passed
@KatalKavya96 KatalKavya96 deleted the feat-bitbucket-pr-commits branch July 10, 2026 10:50
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