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:
Changes
- Add
ConnectionDef for bitbucket in connectionRegistry:
AuthMethod: "BasicAuth"
NeedsUsername: true
UsernamePrompt: "Bitbucket username"
UsernameEnvVars: []string{"BITBUCKET_USER", "BITBUCKET_USERNAME"}
Endpoint: "https://api.bitbucket.org/2.0/"
SupportsTest: true
TokenPrompt: "Bitbucket app password"
EnvVarNames: []string{"BITBUCKET_TOKEN", "BITBUCKET_APP_PASSWORD"}
EnvFileKeys: []string{"BITBUCKET_TOKEN", "BITBUCKET_APP_PASSWORD"}
ScopeIDField: "bitbucketId"
HasRepoScopes: true
ScopeFunc: scopeBitbucketHandler
- Implement
scopeBitbucketHandler:
- Use
client.ListRemoteScopes("bitbucket", connID, "", "") to list workspaces, then repos
- Let user select repos interactively
- PUT selected repos as scopes
- Set
Available: true
Acceptance Criteria
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
bitbucketinincubator-devlake/backend/plugins/bitbucket/bitbucketBitbucketIdstring = full_name)bitbucketIdhttps://api.bitbucket.org/2.0/usesApiTokenboolDependencies
Blocked by:
bitbucketIdneedsScopeIDField)Changes
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: scopeBitbucketHandlerscopeBitbucketHandler:client.ListRemoteScopes("bitbucket", connID, "", "")to list workspaces, then reposAvailable: trueAcceptance Criteria
gh devlake configure connection add --plugin bitbucket --username myusercreates a Bitbucket connectiongo build ./...,go test ./...,go vet ./...pass