Skip to content

Bitbucket

Only Bitbucket Cloud is supported - AppArch talks to api.bitbucket.org. Bitbucket Data Center / Server is not supported.

Bitbucket accepts two kinds of credential. App passwords are not offered: Atlassian has retired them.

  1. Credentials → Add credential → Bitbucket → Register an application.
  2. In Bitbucket open your workspace’s Workspace settings → OAuth clients → Create OAuth client.
  3. On the Authorization tab, paste the Callback URL the wizard shows, exactly as shown.
  4. On the Scopes tab grant: Account, Repositories, Pull requests, Webhooks. The wizard also asks for Pipelines: Read and write, which AppArch uses to check and write the runner’s Pipelines variables.
  5. Copy the client’s Client ID and Secret into the wizard and save. A workspace slug is optional.
  6. Finish the authorization with Connect with Bitbucket on the credential.

Bitbucket access tokens from this flow live about two hours. AppArch refreshes them automatically with the stored refresh token.

  1. Credentials → Add credential → Bitbucket → Access token.
  2. In Bitbucket create a workspace or repository access token with the repository and pullrequest permissions.
  3. Paste it into the wizard. A workspace slug is optional.

Before the token is stored, AppArch reads what it may do. A token without repository read access is refused; one without pull request write access is accepted with a read-only warning (no ArchPilot comments). AppArch never refreshes an access token.

  • ArchPilot comments on pull requests.
  • ArchScan / ArchSecurity results from CI runs appear in the panel.
pipelines:
pull-requests:
'**':
- step:
image:
name: hub.apparch.io/collectors/dotnet:latest
username: $APPARCH_INSTALLATION_ID
password: $APPARCH_INSTALLATION_KEY
run-as-user: 0 # the clone belongs to root; a PR run fetches the target branch into it
script:
- export APPARCH_Collector__Token="$APPARCH_TOKEN"
- export APPARCH_Collector__ApiUrl="https://api.yourdomain.com"
- apparch "$BITBUCKET_CLONE_DIR"

The runner recognises a pull request run from Bitbucket’s BITBUCKET_PR_ID variable.