Bitbucket
Connect Bitbucket Cloud so your agents can clone, push and open pull requests in its repositories, and so a pull request on Bitbucket can start their work: a person opens a pull request or names Kadmo in a comment, an agent reviews it or works on it, and the result comes back on the pull request. This page covers installing and connecting Kadmo for Bitbucket, the card, the repositories, what agents get, the merge gate and a skill pack kept on Bitbucket, what starts work, disconnecting and the limits. The filters of a Bitbucket rule are under Automations.
Where the app is offered
Open Integrations → Git Hosting → Bitbucket. Where the dialog offers Install Kadmo for Bitbucket, the app is how Bitbucket connects: a workspace admin installs it, and a Kadmo Admin confirms the workspace.
| Kadmo for Bitbucket | |
|---|---|
| Who sets it up | A Bitbucket workspace admin installs the app; a Kadmo Admin confirms the workspace |
| Whose name Bitbucket shows | Kadmo for Bitbucket, on pull requests, comments and build statuses |
| Credential | A token for the workspace that the app sends Kadmo every hour |
| Reach | Each connected workspace, all of its repositories |
| Repositories to pick from on Add project | Yes |
| Events and automation rules | Yes |
| Send to Kadmo and the run's card on a pull request | Yes |
| The build status Kadmo review | Yes |
| Agents, the merge gate, a skill pack on Bitbucket | Yes |
| What Bitbucket needs | A shared workspace linked to an Atlassian organization |
An account can connect several workspaces through the app. The app serves a workspace's repositories while it is connected there and its token is current.
Install Kadmo for Bitbucket
Where the card offers Install Kadmo for Bitbucket, the app is installed in Bitbucket and then connected to your Kadmo account in a second step.
- A Kadmo Admin opens the Bitbucket dialog and presses Install Kadmo for Bitbucket. Bitbucket's install page opens in a new tab. Once one workspace is connected, the button reads Install on another workspace.
- A workspace admin in Bitbucket picks the workspace and approves the app.
Atlassian's rule, not Kadmo's: an app of this kind installs only on a shared workspace that is linked to an Atlassian organization. A personal workspace cannot take it. A workspace made from the organization's own Add app is linked from the start; linking an older one is done in Atlassian Administration and cannot be undone.
The app asks Bitbucket for these scopes, once, at install:
| Scope | Why |
|---|---|
read:repository:bitbucket | List the workspace's repositories, clone them, read a repository's default branch and a build status |
write:repository:bitbucket | Push the agents' branches and a skill-pack edit |
read:pullrequest:bitbucket | Read a pull request, its description and its comments, for a rule and for the merge gate |
write:pullrequest:bitbucket | Open a pull request, and comment on one |
read:workspace:bitbucket | Name the workspace, and tell a workspace member from someone else |
With these, the app also sets the build status Kadmo review on a pull request's commit, and Bitbucket adds the scope that lets the app send its own token. Kadmo for Bitbucket is not listed on the Atlassian Marketplace yet: the card's button is the way to install it.
An installed app reports to Kadmo from the start, but until a workspace is connected, Kadmo starts nothing from it.
Connect the workspace
The connect is pressed in Bitbucket and confirmed in Kadmo, so that a workspace joins only the account an admin chose:
- In Bitbucket, open Workspace settings → Kadmo. The page Connect Kadmo has one button: Connect your Kadmo account.
- Press it. Kadmo opens in a new tab. When the browser blocks that, the page shows the link instead (Open this link to finish connecting:). The link works once, for ten minutes; press the button again for a new one.
- Signed out of Kadmo, you are asked to sign in first. This browser keeps the install for seven days, so after signing in you come back to the same step.
- Kadmo's page Connect Kadmo for Bitbucket names the Bitbucket workspace and the Kadmo account, and warns: Connect only a workspace you recognise. Whoever installed Kadmo for Bitbucket chose the workspace; it joins whichever account connects it.
- Press Connect this workspace. The Integrations page opens on the Bitbucket dialog with … is connected through Kadmo for Bitbucket. Add a project from its repositories on a workspace's Git projects.
Only an Admin of the Kadmo account can confirm. The page answers every other case with a heading of its own:
| The page says | Why, and what to do |
|---|---|
| An admin has to finish this | You are a User. Send the link to an admin within its ten minutes, or ask one to press the button in Bitbucket |
| This workspace belongs to another account | A workspace is connected to one Kadmo account at a time. An admin of that account disconnects it there first |
| This workspace is already connected | Nothing to do: attach its repositories from Add project |
| This link has expired · This link has already been used · This link is not valid | Press Connect your Kadmo account in Bitbucket again |
| … was removed from this workspace | The app was uninstalled, or installed again since the link was made. Install it, then connect from its page |
| This sign-in has no Kadmo account yet | Create an account where sign-up is open, or ask your team's Kadmo admin to invite you |
| The workspace was not connected | Nothing was saved. Press the button in Bitbucket again in a moment |
What the connect sets up:
- Two rules, the first time the account connects a workspace: a review of each pull request a person opens, and work on a comment that names Kadmo (The two rules a connect adds).
- The agents, which hear at once that the app now serves this workspace (What agents get).
What the card says
The card's line reads Kadmo for Bitbucket or a manual setup where the app is offered. Once a workspace is connected, its subtitle names the workspaces through Kadmo for Bitbucket, and its health is the newest hourly token: renewed ….
The dialog lists each workspace with its state:
| State | The words under the workspace |
|---|---|
| Connected | Connected: agents reach …'s repositories as Kadmo for Bitbucket. With when it was connected and when its token was last renewed |
| Not renewed | Kadmo for Bitbucket's token for … was not renewed. Nothing goes through the app there until Bitbucket sends a new one: check that the app is still installed on the workspace. |
| Removed | Kadmo for Bitbucket was removed from … in Bitbucket. Install it again and connect it, or save a manual setup. With a manual setup saved, the sentence ends Install it again and connect it; the manual setup serves its repositories meanwhile. |
A token counts as current until ten minutes before it ends, and the app sends a new one every hour. A workspace that is Not renewed or Removed also turns the card red with its sentence. With no workspace connected, the dialog says No workspace is connected through the app yet.
Below the workspaces, Attached repositories lists each Bitbucket repository the account's workspaces have as a project, with its Kadmo workspace and the way that serves it: through Kadmo for Bitbucket, through the manual setup, or in red the reason nothing does.
Repositories
A repository reaches your agents when a workspace has it as a project: on the workspace's Code & files tab, press Add project (Git projects).
- From Kadmo for Bitbucket. For an admin, the dialog lists the repositories of each workspace the app connects, newest change first: pick the workspace, filter by name, More for the next page. A pick fills in the Repo URL and the default branch. Pasting an address works too.
- Show repositories under a connected workspace in the Bitbucket dialog lists the same names, to look up what is there.
What agents get
Agents fetch a Bitbucket token from Kadmo at the moment they use it, behind git and behind their calls to Bitbucket's API, and keep none on disk. There is nothing to add to their environment.
- Which repositories. A repository a workspace has as a project, on a workspace the agent works in, and the account's own skill pack where it lives on Bitbucket. Anything else gets no token: … is not attached to a workspace this agent works in, so no token is handed out for it.
- Which token. The app's token for the repository's workspace, under the name Kadmo for Bitbucket.
- The commit's author. Bitbucket has no no-reply address, so where neither GitHub nor GitLab gives the agents a commit identity, they commit under the agent's own name with a no-reply address of Kadmo's. A person's own e-mail never goes into a commit.
- When it changes. Connecting or disconnecting a workspace reaches online agents at once.
The merge gate and your skill pack
The merge gate. A step whose gate passes on a merge checks the live pull request first (Playbooks). On Bitbucket it reads the pull request with the app's token for its workspace. A token that is not renewed, or one Bitbucket refuses, reads as cannot verify, with the reason in the gate's evidence, and is never counted as merged.
A skill pack on Bitbucket. Under Own repo, pick Bitbucket as the provider (Repository Source). An account with only the app is offered Bitbucket too, named with the workspaces it is connected on. Kadmo reads the pack with the app's token for its workspace. With Portal write access, Commit pushes to the tracked branch and Pull request pushes an edit branch and opens a pull request; turning either on tries a push first and says when the credential cannot push. When nothing serves the pack's workspace, the pack card says why in the sentences of the rule's table.
What starts work
Kadmo for Bitbucket forwards the workspace's pull request events to Kadmo, and a rule on the Bitbucket trigger decides (Automations). A rule's work needs the repository attached to a workspace; an event from a repository no workspace has is skipped, and the rule's log says no_workspace.
The two rules a connect adds
The first connect of a workspace adds two rules to the account, switched on:
| Review new Bitbucket pull requests | When Kadmo is named on Bitbucket | |
|---|---|---|
| Starts on | PR opened by anyone but your agents, a person or another app, and not from a fork | Comment added naming Kadmo, by someone with access to the repository |
| What it runs | The workflow Review PR (comments only): comments on the pull request's lines, and the build status Kadmo review | It continues the live session that wrote the pull request, or starts the workflow Implement Fix + PR, and replies on the pull request to say it was seen |
Each pull request a person opens in an attached repository then starts a review, which uses credit. They are ordinary rules: change, switch off or delete them on Automations. They are written once per account: connecting another workspace, or the same one again after a reinstall, adds no second pair, nor does a manual setup's first webhook (Bitbucket manual setup), and a rule you deleted or switched off stays that way. A rule that already does the same work counts, so nothing is added beside it. The other rules Kadmo writes are on Rules Kadmo creates for you.
Send to Kadmo
On a pull request, Send to Kadmo in its more-actions menu starts one of the two rules by hand.
- Under What should Kadmo do?, choose Review it (An agent reads the change and leaves its findings as comments. It pushes nothing.) or Work on it (An agent works on the pull request as your note asks, as if you had mentioned Kadmo in a comment.).
- For Work on it, write Your note, up to 2,000 characters.
- Press Send. The form says Kadmo queued a run for this pull request., or Kadmo handed your note to the run that is already working on this pull request., with Open the run in Kadmo.
A press goes through the rule as an event would, with its filters and limits: Review it needs a switched-on rule that runs Review PR (comments only) on PR opened, and Work on it a switched-on rule on comments that name Kadmo. Only a member of the workspace, or someone given access to a private repository, may press. When nothing can start, the form says why, for example Your Kadmo account has no rule switched on for this. …, A review of this pull request is already queued or running., This pull request is not open, so there is nothing to send. or This repository is not attached to a workspace in Kadmo, so no agent can work on it. ….
The run's card
The pull request's right sidebar carries a card, Kadmo, with the newest Kadmo run for the pull request: its kind (Review or Run), its state (Queued, Running, Waiting for an answer, Finished, Failed or Cancelled), a review's verdict, since when, and Open the run in Kadmo. While the run is queued or running, the card asks again every 15 seconds. Before any run it says No Kadmo run for this pull request yet.
Kadmo review
A review a rule starts answers on the pull request with one build status per commit, Kadmo review, which links the run:
| The review | The status |
|---|---|
| Running | In progress: Kadmo is reviewing this pull request |
| Nothing that has to change | Successful: No finding that has to change |
| Findings that have to change | Failed: 2 findings that have to change, with the count the report gives |
| Nothing to review, blocked, ended without a report, did not finish, cancelled | Stopped, with those words |
A failed status holds a merge only where your Bitbucket workspace requires passing builds before a merge. A review started by hand from Kadmo, not from a rule or Send to Kadmo, writes its comments and no status, and so does a review of a pull request from a fork.
What a run writes back
Any other workflow a Bitbucket rule starts writes no status. When its job ends, Kadmo posts one comment on the pull request as Kadmo for Bitbucket: how the run ended, the report's verdict and summary when the agent gave one, the other pull requests the job reported, and the job's link. An @ in the agent's text notifies nobody. A comment that reached the live session which wrote the pull request starts no job, and so gets no such comment.
Disconnect and uninstall
- Disconnect on a workspace's row releases that workspace once you confirm: Kadmo stops using the app there, and the app itself remains on the workspace until a workspace admin uninstalls it in Bitbucket. The workspaces and their projects stay. The installed app goes on sending its hourly token, which Kadmo keeps sealed and unused until the app is removed or 30 days pass with nothing from it. Connecting again is the same press in Bitbucket.
- Uninstalling the app in the workspace's settings in Bitbucket ends its events and its token: Kadmo deletes the stored token and the workspace's unused connect links and kept installs, and the row reads Removed. An install made again is a new installation: connect it again from its page. It adds no second pair of rules.
- Deleting the Kadmo account releases every workspace it connected (Delete account); the app remains on each workspace until it is uninstalled there.
Automations, workspaces and their projects survive every disconnect.
Limits
- Bitbucket Cloud only. Bitbucket Data Center cannot be connected.
- A workflow, not a playbook. A Bitbucket rule runs a workflow; a playbook is refused, since a pull request is not a ticket.
- No Trigger now. A Bitbucket rule runs on an event: test it on a real pull request, or with Send to Kadmo.
- Neither labels nor reactions. A Bitbucket rule has no label filter, and it answers a comment with a reply, never an emoji.
- Forks left out. A pull request from a fork starts nothing unless the rule lets forks in.
- No push or deployment trigger. A rule hears pull requests, their comments and reviews, and a build's result on a pull request's commit (Build finished). A push or a deployment starts nothing.
- No run budget per pull request. A rule cannot cap its runs on one pull request yet.
- One account per workspace. An account can connect several workspaces; a workspace belongs to one account at a time.
- The workflow git steps. The
git.*steps of a workflow (Steps) have no Bitbucket provider: agents work on Bitbucket with git and its API from their machine. - Not on the Marketplace yet. The app installs from the card's button.
What leaves Bitbucket, and what Kadmo keeps
| Read from Bitbucket | Kept | |
|---|---|---|
| The app's install and connect | The workspace's id, slug and name, the app's own user, and the app's token every hour | The installation with the workspace's names, the account it is connected to, who connected it and when, and the newest token, sealed. A removed installation is kept without a token, so a late message from it changes nothing |
| A connect started signed out | — | The install, for seven days, behind a cookie in that browser |
| Events | Each pull request, comment, reviewer, build and repository event of the workspace. For a rule that would act: the repository, the pull request, the comment's text and author, and whether the author is a workspace member | The delivery on the installation's row, and the work a rule starts, with the account's other work |
| Agents | The repositories of their workspaces and their pull requests, cloned and read on the agent's machine | The clones, on the agent's machine. No token |
| A skill pack on Bitbucket | The pack repository | Kadmo's clone of it |
Kadmo's privacy policy says how Kadmo handles personal data. Where your agents run is covered under Where an agent can run.
Troubleshooting
| Symptom | Cause and fix |
|---|---|
| The dialog has no Install Kadmo for Bitbucket | The app is not offered here. |
| Bitbucket will not install the app on the workspace | The workspace is personal, or not linked to an Atlassian organization. Link it in Atlassian Administration. |
| Kadmo is not accepting connections from this app yet. on the app's page in Bitbucket | Kadmo has not finished its side of the app's setup. Try again later, or write to the address the message gives. |
| The connect page says This link has expired | A link works for ten minutes. Press Connect your Kadmo account in Bitbucket again. |
| The connect page says This workspace belongs to another account | An admin of that account disconnects the workspace on its Bitbucket card first. |
| A workspace reads Not renewed | Bitbucket has sent no fresh token for a while. Check that the app is still installed on the workspace; the next hourly token clears it. If it stays, install the app again and connect it. |
| A workspace reads Removed | The app was uninstalled from the workspace, or installed again and not connected yet. Install it and press Connect your Kadmo account. |
| An agent reports … is not attached to a workspace this agent works in, so no token is handed out for it. | Add the repository as a project to a workspace the agent works in. |
| Opening a pull request starts no review | The rule needs the app, a person as the author, a repository a workspace has, and no fork. Read the rule's log on Automations: no_workspace means no workspace has the repository. |
| A comment that names Kadmo does nothing | Check the rule's Mention and Minimum comment author; a comment by the app itself starts nothing. |
| Send to Kadmo says This Bitbucket workspace is not connected to a Kadmo account yet. … | A workspace admin connects it under Workspace settings → Kadmo, and a Kadmo admin confirms. |
| Send to Kadmo says Your Kadmo account has incoming events switched off, so nothing starts from Bitbucket. … | The account's Webhooks switch is off: see Pause all webhooks. |
| No Kadmo review status on a pull request | The review was started by hand from Kadmo, or the pull request is from a fork. Neither gets a status. |
Instead of installing the app, an admin of your Kadmo account can connect Bitbucket by a manual setup on Kadmo's card, outside the app: see Bitbucket manual setup.