Bitbucket Integration
RunnerHub integrates with Bitbucket Cloud using OAuth 2.0, enabling automatic builds on push and pull request events.
How It Works
Section titled “How It Works”RunnerHub uses OAuth 2.0 to securely authenticate with Bitbucket:
You click "Connect Bitbucket" in RunnerHub ↓Redirected to Bitbucket login ↓Grant RunnerHub access to your workspace ↓Bitbucket redirects back to RunnerHub ↓RunnerHub shows your repositories ↓You select a repository ↓Webhook automatically configured ↓Builds trigger on push/PR eventsInstallation
Section titled “Installation”Step 1: Start the OAuth Flow
Section titled “Step 1: Start the OAuth Flow”- Go to your RunnerHub app
- Click Repository → Connect
- Select Bitbucket
You’ll be redirected to Bitbucket to log in and authorize.
Step 2: Authorize RunnerHub
Section titled “Step 2: Authorize RunnerHub”On Bitbucket:
- Log in with your Bitbucket credentials
- Review the permissions requested by RunnerHub
- Click Grant access
You’ll be redirected back to RunnerHub.
Step 3: Select a Repository
Section titled “Step 3: Select a Repository”- RunnerHub displays a list of repositories from your Bitbucket workspace
- Find the repository you want to connect
- Click Select
RunnerHub will:
- Store your Bitbucket access token (encrypted)
- Automatically configure a webhook on the repository
- Start listening for push and pull request events
Permissions
Section titled “Permissions”When you authorize RunnerHub, Bitbucket grants access to:
| Permission | Purpose |
|---|---|
account | Access your workspace information |
repository | Read repository data and code |
webhook | Configure webhooks on repositories |
Permissions are workspace-scoped — RunnerHub can only access repositories you have access to.
How Builds Are Triggered
Section titled “How Builds Are Triggered”Builds start automatically on:
| Event | Trigger |
|---|---|
| Push | New commits to any branch |
| Pull Request | PR opened or updated |
| Manual | Via RunnerHub dashboard |
| Scheduled | Cron-based triggers (app config) |
Filter Branches:
In your pipeline YAML, specify which branches should trigger builds:
triggers: - event: push branches: - main - develop - release/*Webhook Configuration
Section titled “Webhook Configuration”Webhooks are automatically configured when you connect a repository.
Webhook Details:
- Events: push, pull_request:created, pull_request:updated
- Active: Yes
To view the webhook manually:
- Go to your Bitbucket repository
- Settings → Webhooks
- Find “RunnerHub” in the list
Build Status Reporting
Section titled “Build Status Reporting”Commit Status
Section titled “Commit Status”When a build completes, RunnerHub posts the status to your commit:
- Go to your Bitbucket repository
- Navigate to Commits
- Click a commit hash
- The build status appears under “Build status”
Status Options:
INPROGRESS— Build runningSUCCESSFUL— Build passedFAILED— Build failedSTOPPED— Build was cancelled
Pull Request Status
Section titled “Pull Request Status”When you open a pull request:
- RunnerHub automatically starts a build
- Build status appears in the PR description area
- Click the status to see detailed logs in RunnerHub
Setting Required Build Status:
You can require builds to pass before PR merge:
- Go to repository → Settings → Merge checks
- Check “Build status must succeed”
- Save
Token Management
Section titled “Token Management”RunnerHub handles OAuth token management automatically:
- Token Storage: Encrypted at rest
- Token Refresh: Automatic refresh before expiration
- Token Expiry: RunnerHub handles rotation transparently
If you experience build failures due to token issues:
- Disconnect the repository: App → Repository → Disconnect
- Reconnect: Click Connect and authorize again with Bitbucket
Troubleshooting
Section titled “Troubleshooting””Webhook Not Triggering Builds”
Section titled “”Webhook Not Triggering Builds””If builds don’t start after commits:
-
Verify webhook was created:
- Go to repository → Settings → Webhooks
- Look for “RunnerHub” webhook
- Check that it’s Enabled (blue toggle)
-
Check webhook delivery logs:
- Click the RunnerHub webhook
- Scroll to “Recent deliveries”
- Look for success/failure status
- Click an entry to see request/response details
-
Reconnect the repository:
- Go to your RunnerHub app
- Click Repository → Disconnect
- Wait a few seconds
- Click Repository → Connect → Bitbucket → Select the same repository
- RunnerHub will reconfigure the webhook
”Repository List Empty”
Section titled “”Repository List Empty””If you can’t see your repositories:
-
Verify Bitbucket OAuth:
- Make sure you’re logged into Bitbucket
- You must have Write or higher access to the repository
- Go to your Bitbucket workspace settings to check your role
-
Re-authorize RunnerHub:
- Disconnect the current OAuth session (see app settings)
- Click Connect again
- Complete the OAuth flow
-
Check workspace permissions:
- Go to Bitbucket workspace settings → Members
- Verify your account has access to the repositories
”Permission Denied Error”
Section titled “”Permission Denied Error””If you get permission errors:
-
Check your Bitbucket workspace role:
- You need Write access to configure webhooks
- Contact your workspace admin if needed
-
Verify the OAuth scopes:
- Disconnect the repository
- Re-authorize and ensure you grant all requested permissions
”Build Logs Missing”
Section titled “”Build Logs Missing””If RunnerHub created a build but logs aren’t showing:
-
Verify the webhook was received:
- Go to Bitbucket repository → Settings → Webhooks → RunnerHub
- Check “Recent deliveries” for a push event
- Verify status code is 200
-
Check repository access:
- In RunnerHub app settings, verify the clone URL
- Try cloning manually:
git clone <clone_url>
-
Check for network issues:
- Verify your RunnerHub instance can reach Bitbucket
- If self-hosted, check firewall rules
Security Considerations
Section titled “Security Considerations”Token Encryption
Section titled “Token Encryption”- Bitbucket OAuth tokens are encrypted at rest
- Never stored in plain text
- Only decrypted when authenticating with Bitbucket
Webhook Security
Section titled “Webhook Security”RunnerHub verifies webhook authenticity using Bitbucket’s:
X-Request-UUIDheader for idempotency- Webhook signature validation (if configured in Bitbucket)
Revoking Access
Section titled “Revoking Access”To remove RunnerHub’s access:
Option 1: Disconnect in RunnerHub
- Go to your app
- Click Repository → Disconnect
- The webhook is removed from Bitbucket
Option 2: Revoke in Bitbucket
- Go to Bitbucket Personal Settings → Authorized OAuth Apps
- Find “RunnerHub”
- Click “Revoke”
- All RunnerHub repositories go offline immediately
Multiple Workspaces
Section titled “Multiple Workspaces”You can connect the same Bitbucket repository to different RunnerHub workspaces:
- Each workspace maintains separate OAuth tokens
- Webhooks are independent
- Both workspaces will receive events
To set this up:
- Authorize RunnerHub in each workspace separately
- Connect the same Bitbucket repository to apps in different workspaces
- Each workspace will trigger its own builds
Bitbucket Cloud vs Server
Section titled “Bitbucket Cloud vs Server”RunnerHub supports Bitbucket Cloud with OAuth. For Bitbucket Server or Data Center:
- You can still integrate using webhooks
- Manual webhook configuration required
- OAuth flow not available
- Contact support for Server/Data Center options
Best Practices
Section titled “Best Practices”1. Enable Build Status Checks
Require builds to pass before merging:
- Go to repository → Settings → Merge checks
- Check “Build status must succeed”
- Select “RunnerHub” as the required check
- Save
2. Monitor Webhook Health
Periodically verify webhooks are working:
- Go to repository → Settings → Webhooks → RunnerHub
- Click “Recent deliveries”
- Verify recent events show HTTP 200 status
- If you see failures, reconnect the repository
3. Use Scheduled Builds
Beyond push triggers, set up scheduled builds:
- Go to your RunnerHub app → Schedules
- Create a new schedule
- Set the time and days of week
- Configure the branch to build
4. Review Commits with Status
When reviewing commits before merge:
- Go to Commits tab
- Look for RunnerHub build status badge
- Click status to see full build logs
- Merge only when status is SUCCESSFUL
Comparison with Other Providers
Section titled “Comparison with Other Providers”| Feature | Bitbucket | GitHub | GitLab |
|---|---|---|---|
| Auth Type | OAuth 2.0 | GitHub App | OAuth 2.0 |
| Webhook | Automatic | Automatic | Automatic |
| Status Reports | Commit + PR | PR Checks | Commit + MR |
| Branch Filtering | Yes | Yes | Yes |
| Token Refresh | Automatic | N/A | Automatic |
| Self-hosted | Cloud only | App-based | Enterprise option |