AI Agents SDE Task Viewer
      • Pr description
  1. Home
  2. AgentSDE
  3. agent-core
  4. gh-548
  5. changes
  6. pr_description.md
pr_description.md(2.0 KB)· Apr 24, 2026· 1 min read
  • feat: add BitbucketService with full GitHub parity (BJ-8)
  • Problem
  • Task / Link
  • Changes
  • Notes
  • Testing

feat: add BitbucketService with full GitHub parity (BJ-8)#

Problem#

The agent pipeline needs to operate against Bitbucket Cloud repositories using the same interface as GitHub, covering comments, PRs, labels, file operations, branches, and commit/review status. Without this, the Atlassian integration wave cannot dispatch agents to Bitbucket repos.

Task / Link#

Closes #548 — BJ-8: BitbucketService (GitHub parity surface)

Changes#

  • src/bitbucket/bitbucket.service.ts — NestJS injectable service targeting https://api.bitbucket.org/2.0; all 18 public methods (postComment, editComment, findCommentByPrefix, createPR, mergePR, updatePRBranch, closePR, enableAutoMerge, addLabel, removeLabel, getFileContent, getPRFiles, createOrUpdateFile, createBranch, getDefaultBranchSha, deleteBranch, getCheckStatus, getReviewStatus); 401 token-refresh retry and 429 rate-limit retry with Retry-After
  • src/bitbucket/bitbucket.module.ts — NestJS module exporting BITBUCKET_AUTH_PROVIDER and BITBUCKET_SERVICE tokens; auth provider wiring deferred to BJ-2 (BitbucketOAuthAuthProvider)
  • src/bitbucket/bitbucket.service.spec.ts — 39 unit tests covering every public method, 401/429 retry paths, label title-prefix round-trip, NotImplementedException throws
  • src/bitbucket/index.ts — barrel re-export mirroring src/github/index.ts

Notes#

  • Labels fall back to a [label] PR-title prefix (case-insensitive matching) since Bitbucket has no first-class label API
  • enableAutoMerge and updatePRBranch throw NotImplementedException — Bitbucket has no server-side equivalent
  • createOrUpdateFile uses multipart application/x-www-form-urlencoded (Bitbucket /src endpoint) instead of base64 JSON (GitHub /contents)
  • BITBUCKET_AUTH_PROVIDER and BITBUCKET_SERVICE both resolve to null until BJ-2 wires BitbucketOAuthAuthProvider

Testing#

  • 39 unit tests in bitbucket.service.spec.ts — all passing
  • Full suite: 873 tests, 54 suites — all green
  • Lint: zero warnings
PrdAi-done