Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

[bitbucket cloud] Support workspace access tokens#58465

Merged
pjlast merged 9 commits into
mainfrom
pjlast/58321-support-bitbucket-cloud-access-tokens
Nov 24, 2023
Merged

[bitbucket cloud] Support workspace access tokens#58465
pjlast merged 9 commits into
mainfrom
pjlast/58321-support-bitbucket-cloud-access-tokens

Conversation

@pjlast

@pjlast pjlast commented Nov 21, 2023

Copy link
Copy Markdown
Contributor

Closes #58321

This PR adds support for Bitbucket Cloud Premium Workspace access tokens.

A new code host config option is added: accessToken, and when set instead of username and appPassword, will be used to sync and clone repositories.

Test plan

VCR test added.

Preview 🤩

Preview Link

@cla-bot cla-bot Bot added the cla-signed label Nov 21, 2023
@github-actions github-actions Bot added the team/source Tickets under the purview of Source - the one Source to graph it all label Nov 21, 2023
@sourcegraph-bot

sourcegraph-bot commented Nov 21, 2023

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff d9c1d28...f4a1ff3.

Notify File(s)
@eseliger internal/batches/sources/bitbucketcloud.go
internal/extsvc/bitbucketcloud/client.go
internal/repos/bitbucketcloud.go
internal/repos/bitbucketcloud_test.go
@unknwon internal/authz/providers/authz_test.go
internal/authz/providers/authz_test.go

@pjlast pjlast requested a review from a team November 22, 2023 07:46

@eseliger eseliger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, so quick!

Can you make sure to start a backport so we can ship this next Wednesday for the customer? Thanks :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<3 for docs

"type": "object",
"additionalProperties": false,
"required": ["url", "username", "appPassword"],
"required": ["url"],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could probably use a oneOf to make it require either username AND appPassword, or accessToken, but never none of the two, and never both.

If that takes less than 30 min, might be worth it for the improved UX of getting at least some validation that you're lacking some fields?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added it! much better now I think 😬

@pjlast pjlast force-pushed the pjlast/58321-support-bitbucket-cloud-access-tokens branch from 7d2876c to f4a1ff3 Compare November 24, 2023 11:41
@pjlast pjlast merged commit 85587e8 into main Nov 24, 2023
@pjlast pjlast deleted the pjlast/58321-support-bitbucket-cloud-access-tokens branch November 24, 2023 12:24
sourcegraph-release-bot pushed a commit that referenced this pull request Nov 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

backport 5.2 cla-signed team/source Tickets under the purview of Source - the one Source to graph it all

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for auth tokens for bitbucket cloud

3 participants