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

[bitbucket cloud] Code host connection updates#55095

Merged
pjlast merged 6 commits into
mainfrom
pjlast/54968-clarify-bitbucket-required-scopes
Jul 19, 2023
Merged

[bitbucket cloud] Code host connection updates#55095
pjlast merged 6 commits into
mainfrom
pjlast/54968-clarify-bitbucket-required-scopes

Conversation

@pjlast

@pjlast pjlast commented Jul 19, 2023

Copy link
Copy Markdown
Contributor

Closes #54968

This PR does a few things to better the Bitbucket Cloud connection experience:

  • Some docs have been updated to reflect the current Bitbucket Cloud setup experience
  • Code host connections no longer automatically clone the repositories of the username the App Password belongs to
    • Way-back-when, a user always had a personal workspace tied to their username. This is no longer the case, and newer Bitbucket Cloud accounts will always produce an error in the code host sync, because there is no workspace associated with their username
  • Also removes the requirement for the Account scope on the App Password, and we use the List Repositories endpoint to verify a connection instead.

Screenshot 2023-07-19 at 11 33 54

Test plan

Update unit tests

@sourcegraph-bot

sourcegraph-bot commented Jul 19, 2023

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff cd7c601...20585fb.

Notify File(s)
@indradhanush internal/repos/bitbucketcloud.go
internal/repos/bitbucketcloud_test.go
@sashaostrikov internal/repos/bitbucketcloud.go
internal/repos/bitbucketcloud_test.go
@unknwon internal/authz/providers/bitbucketcloud/provider.go
internal/authz/providers/bitbucketcloud/provider.go

@pjlast pjlast changed the title Update docs. Update Bitbucket Cloud code host connection instructions… [bitbucket cloud] Code host connection updates Jul 19, 2023
@sourcegraph-bot

sourcegraph-bot commented Jul 19, 2023

Copy link
Copy Markdown
Contributor

📖 Storybook live preview

@sashaostrikov sashaostrikov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Left a minor suggestion.

Comment thread internal/authz/providers/bitbucketcloud/provider.go Outdated
@pjlast pjlast force-pushed the pjlast/54968-clarify-bitbucket-required-scopes branch from ca834b0 to 20585fb Compare July 19, 2023 11:02
@pjlast pjlast enabled auto-merge (squash) July 19, 2023 11:02
@pjlast pjlast merged commit d53d136 into main Jul 19, 2023
@pjlast pjlast deleted the pjlast/54968-clarify-bitbucket-required-scopes branch July 19, 2023 11:17
Comment thread CHANGELOG.md
### Changed

- OpenTelemetry Collector has been upgraded to v0.81, and OpenTelemetry packages have been upgraded to v1.16. [#54969](https://github.com/sourcegraph/sourcegraph/pull/54969), [#54999](https://github.com/sourcegraph/sourcegraph/pull/54999)
- Bitbucket Cloud code host connections no longer automatically syncs the repository of the username used. The appropriate workspace name will have to be added to the `teams` list if repositories for that account need to be synced. [#55095](https://github.com/sourcegraph/sourcegraph/pull/55095)

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.

should we call this out somewhere more prominently as well? I'm scared that this might cause some mass repo deletions for some users, but maybe I'm wrong here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, +1 on this. This is a regression in behaviour, right? Suddenly your repositories disappear when you update and you don't know why. This makes me scared enough that I wonder whether we shouldn't revert this change. Or was there thinking behind as to why this isn't risky?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarify required scopes for Bitbucket.org connection

6 participants