Skip to content

Update Bitbucket cloud UpdatePullRequest to properly able to close PR - #203

Merged
eranturgeman merged 3 commits into
jfrog:masterfrom
eranturgeman:bitbucket-cloud-decline-fix
Sep 9, 2026
Merged

eranturgeman merged 3 commits into
jfrog:masterfrom
eranturgeman:bitbucket-cloud-decline-fix

Conversation

@eranturgeman

@eranturgeman eranturgeman commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

BB cloud UpdatePullRequest api works a bit different and needs a dedicated api in order to close PRs.
This is required for BB cloud integration tests coverage jfrog/frogbot#1421

  • All tests passed. If this feature is not already covered by the tests, I added new tests.
  • I used go fmt ./... for formatting the code before submitting the pull request.
  • This feature is included on all supported VCS providers - GitHub, Bitbucket cloud, Bitbucket server, GitLab and Azure Repos.
  • I added the relevant documentation for the new feature.

Summary by CodeRabbit

  • Bug Fixes

    • Closing a pull request in Bitbucket Cloud now updates its metadata before applying the platform’s dedicated decline action, ensuring both changes are processed correctly.
  • Tests

    • Added coverage confirming that closing a pull request sends the metadata update request before the decline request.

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 7646e8f5-bc4f-48bb-8ced-704415861d21

📥 Commits

Reviewing files that changed from the base of the PR and between 2b8a69f and 2123508.

📒 Files selected for processing (2)
  • vcsclient/bitbucketcloud.go
  • vcsclient/bitbucketcloud_test.go

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

UpdatePullRequest now calls the generic Bitbucket Cloud update endpoint for every state. For closed pull requests, it then calls Decline. Tests verify this request order. GetModifiedFiles adds a lint directive without changing behavior.

Changes

Bitbucket Cloud pull request updates

Layer / File(s) Summary
Closed pull request update and decline flow
vcsclient/bitbucketcloud.go, vcsclient/bitbucketcloud_test.go
UpdatePullRequest calls the generic update endpoint before Decline for closed pull requests. The test verifies both request paths and their order. GetModifiedFiles adds a //nolint:staticcheck directive without a behavior change.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 21235

Closed Bitbucket Cloud pull requests now apply metadata changes before being declined, so changes such as title updates are retained when closing. No actionable current-head risk remains.

Suggested reviewers: jordanh1996

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title identifies the Bitbucket Cloud UpdatePullRequest change and its purpose of closing pull requests. The wording is grammatically awkward but remains clear and related to the main change.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

Comment thread vcsclient/bitbucketcloud.go Outdated
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

👍 Frogbot scanned this pull request and did not find any new security issues.


@eranturgeman
eranturgeman merged commit 7d982ce into jfrog:master Sep 9, 2026
8 checks passed
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