Skip to content

feat(bitbucket): add Data Center review state writes - #1746

Open
KatalKavya96 wants to merge 1 commit into
apache:mainfrom
KatalKavya96:feat-bitbucket-datacenter-review-state
Open

KatalKavya96 wants to merge 1 commit into
apache:mainfrom
KatalKavya96:feat-bitbucket-datacenter-review-state

Conversation

@KatalKavya96

Copy link
Copy Markdown
Contributor

Summary

  • Add Bitbucket Data Center support for pull-request approval and change-request state writes.
  • Reuse the existing backend-neutral commands:
    • pr approve
    • pr unapprove
    • pr request-changes
    • pr remove-request-changes
  • Use the Data Center participant-status API for the authenticated reviewer.
  • Add direct API and CLI coverage for all four operations.
  • Update Bitbucket capability documentation to reflect Cloud + Data Center support.

Type of change

  • Skill change (.claude/skills/<name>/)
  • Tool / bridge contract (tools/<system>/*.md)
  • Python package (tools/*/ with pyproject.toml)
  • Groovy reference impl
  • Cross-cutting
  • Documentation
  • Project template
  • CI / dev loop
  • Other

Implementation

Bitbucket Data Center review state is updated through the pull-request participant resource for the authenticated user.

The command mappings are:

  • pr approve → APPROVED
  • pr unapprove → UNAPPROVED
  • pr request-changes → NEEDS_WORK
  • pr remove-request-changes → UNAPPROVED

The bridge first resolves the authenticated Data Center user's slug, then updates that user's participant state on the target pull request.

This avoids the deprecated approval-specific endpoints and keeps the existing normalized approval/change-request output contracts unchanged across Cloud and Data Center.

Test plan

  • Ruff checks pass
  • Ruff formatting passes
  • Mypy passes
  • Focused Data Center review-state tests pass
  • Full tools/bitbucket/tests/test_bitbucket.py suite passes
  • CLI coverage added for all four Data Center commands
  • git diff --check passes
  • Repository hooks pass

Scope

This PR adds standalone Data Center review-state mutations only.

The combined:

pr review <id> --verdict {comment,approve,request-changes} --body-file <path>

path remains Cloud-only because Data Center review-body + verdict semantics are a separate follow-up.

Data Center decline/reject and merge writes also remain separate follow-ups.

Refs #606

@KatalKavya96

Copy link
Copy Markdown
Contributor Author

Hi @potiuk,

This is the next focused #606 Data Center parity follow-up.

It enables the existing standalone review-state commands on Data Center through the participant-status API:

  • approve → APPROVED
  • unapprove → UNAPPROVED
  • request-changes → NEEDS_WORK
  • remove-request-changes → UNAPPROVED

The implementation keeps the existing backend-neutral CLI and normalizers, adds API + CLI coverage for all four operations, and avoids the deprecated approval-specific endpoints.

The combined pr review --body-file path remains Cloud-only and is intentionally left for a separate follow-up.

Refs #606

@github-actions github-actions Bot added family:tools tools/* family:docs Docs, MISSION.md, READMEs contract:tracker Tool capability: issue / board / label backend contract:change-request Tool capability: proposed-change review + merge gate (PR / MR / Gerrit change) labels Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contract:change-request Tool capability: proposed-change review + merge gate (PR / MR / Gerrit change) contract:tracker Tool capability: issue / board / label backend family:docs Docs, MISSION.md, READMEs family:tools tools/*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant