Skip to content

fix: [PIPE-32312]: add Bitbucket workspace extraction support#353

Open
ritek01 wants to merge 2 commits intomasterfrom
pipe32312
Open

fix: [PIPE-32312]: add Bitbucket workspace extraction support#353
ritek01 wants to merge 2 commits intomasterfrom
pipe32312

Conversation

@ritek01
Copy link
Contributor

@ritek01 ritek01 commented Feb 22, 2026

This pull request enhances Bitbucket SCM client support for workspace- and repository-scoped credentials, making it easier to use repo-level tokens without requiring account-wide permissions. The main changes include extending the Bitbucket client to store workspace and repository information, adding a setter for these fields, and updating repository fetching logic and tests accordingly.

Bitbucket Client Enhancements:

  • The wrapper struct now includes workspace and repo fields to store workspace and repository names, enabling support for workspace- or repo-scoped tokens. (scm/driver/bitbucket/bitbucket.go)
  • Added a SetWorkspace function to allow setting the workspace and repo on the Bitbucket client, facilitating the use of workspace-specific API endpoints. (scm/driver/bitbucket/bitbucket.go)

Repository Fetching Logic:

  • Modified fetchReposWithPagination to use the configured workspace directly if set, avoiding unnecessary API calls and supporting repo-scoped tokens. (scm/driver/bitbucket/util.go)

Test Updates:

  • Updated all relevant test helpers and test cases to initialize the wrapper struct with the new workspace and repo fields for consistency and to ensure tests reflect the new structure. (scm/driver/bitbucket/util_helpers_test.go, scm/driver/bitbucket/util_test.go) [1] [2] [3] [4] [5] [6]

  - Add workspace and repo fields to wrapper struct
  - Add SetWorkspace() function to configure workspace
  - Use workspace when available to avoid account scope requirement
  - Fix fetchReposWithPagination to check for configured workspace
  - Update test files to use new wrapper struct format
@ritek01 ritek01 marked this pull request as draft February 22, 2026 19:19
@ritek01 ritek01 marked this pull request as ready for review February 22, 2026 19:41
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.

1 participant