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 targetinghttps://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 withRetry-Aftersrc/bitbucket/bitbucket.module.ts— NestJS module exportingBITBUCKET_AUTH_PROVIDERandBITBUCKET_SERVICEtokens; 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,NotImplementedExceptionthrowssrc/bitbucket/index.ts— barrel re-export mirroringsrc/github/index.ts
Notes#
- Labels fall back to a
[label]PR-title prefix (case-insensitive matching) since Bitbucket has no first-class label API enableAutoMergeandupdatePRBranchthrowNotImplementedException— Bitbucket has no server-side equivalentcreateOrUpdateFileuses multipartapplication/x-www-form-urlencoded(Bitbucket/srcendpoint) instead of base64 JSON (GitHub/contents)BITBUCKET_AUTH_PROVIDERandBITBUCKET_SERVICEboth resolve tonulluntil BJ-2 wiresBitbucketOAuthAuthProvider
Testing#
- 39 unit tests in
bitbucket.service.spec.ts— all passing - Full suite: 873 tests, 54 suites — all green
- Lint: zero warnings