Skip to content

Bitbucket Cloud plugin support #89

@ewega

Description

@ewega

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

  • gh devlake configure connection add --plugin bitbucket --username myuser creates 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

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions