-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Description
Summary
Add Bitbucket Cloud as a supported DevOps tool in the CLI. Bitbucket is the third most popular Git platform, especially prevalent in Atlassian/Jira shops.
Upstream Plugin
bitbucket in incubator-devlake/backend/plugins/bitbucket/
| Property | Value |
|---|---|
| Plugin slug | bitbucket |
| Auth | BasicAuth (username + app password) |
| Scope type | Repositories (BitbucketId string = full_name) |
| Scope ID field | bitbucketId |
| Default endpoint | https://api.bitbucket.org/2.0/ |
| Remote-scope API | Yes |
| Connection test | Yes |
| Extra field | usesApiToken bool |
Dependencies
Blocked by:
- Generalize auth model for multi-plugin support #85 — Auth generalization (Bitbucket requires BasicAuth with username + app password)
- Generic scope ID extraction and remote-scope API client #86 — Scope ID extraction (
bitbucketIdneedsScopeIDField)
Changes
- Add
ConnectionDefforbitbucketinconnectionRegistry:AuthMethod: "BasicAuth"NeedsUsername: trueUsernamePrompt: "Bitbucket username"UsernameEnvVars: []string{"BITBUCKET_USER", "BITBUCKET_USERNAME"}Endpoint: "https://api.bitbucket.org/2.0/"SupportsTest: trueTokenPrompt: "Bitbucket app password"EnvVarNames: []string{"BITBUCKET_TOKEN", "BITBUCKET_APP_PASSWORD"}EnvFileKeys: []string{"BITBUCKET_TOKEN", "BITBUCKET_APP_PASSWORD"}ScopeIDField: "bitbucketId"HasRepoScopes: trueScopeFunc: scopeBitbucketHandler
- Implement
scopeBitbucketHandler:- Use
client.ListRemoteScopes("bitbucket", connID, "", "")to list workspaces, then repos - Let user select repos interactively
- PUT selected repos as scopes
- Use
- Set
Available: true
Acceptance Criteria
-
gh devlake configure connection add --plugin bitbucket --username myusercreates a Bitbucket connection - Bitbucket appears in interactive plugin picker
- Bitbucket scopes list repos for selection
- Connection test works
-
go build ./...,go test ./...,go vet ./...pass
Reactions are currently unavailable
Metadata
Metadata
Labels
enhancementNew feature or requestNew feature or request