Connect Buildkite to Toolspoke

Read failed builds, job logs and artifacts, and trigger, rebuild, retry or unblock Buildkite builds. Toolspoke gives your agents 17 of its actions, and you decide which ones each project allows.

Connection
Provider REST API
Authentication
API access token
Actions exposed
17
What a call bills
Nothing
Adapter
Maintained by Toolspoke

Connected in three steps

  1. Install Buildkite

    Open the marketplace in your workspace, add Buildkite to the project your agents work in, and it appears on the gateway immediately.

  2. Connect the credential

    Provide the credential Buildkite asks for. Where to get it, and what it has to be able to reach, is the next section.

  3. Give it to an agent

    Describe the job in one sentence and the builder proposes the instructions, the toolkits it needs, a schedule and where it should answer, or start from a catalogue agent. It can use every Buildkite action the project leaves on.

Where the agent answers

  • Slack

    Ask it in a channel or a thread, and it replies in the thread it was asked in.

  • Email

    Email it. Each write waits for a person's go-ahead unless that action is allowed in advance.

  • GitHub

    Mention it on a pull request, and it answers there.

  • Schedule

    A routine wakes it on a schedule, or when a new item matches.

Any agent in the project can use Buildkite, and only the actions the project leaves on.

What Buildkite asks for

API access token. You provide it once, when you install the connector. Toolspoke encrypts it at rest and decrypts it only for the length of a single call, and the gateway attaches it to the outbound request itself, so it is never part of the arguments an agent sends.

API access tokenRequired
Buildkite → your avatar → Personal Settings → API Access Tokens → New API Access Token. Pick the organization, then tick read_organizations, read_pipelines, read_builds, read_build_logs and read_artifacts. Add write_builds only if this install should trigger, rebuild, retry, cancel or unblock builds.
bkua_…

What an agent can do in Buildkite

17 actions, each one declared by name in the connector. A workspace policy grants a person all of them, a hand-picked selection, everything on the read side, everything on the write side, or none.

11 read, 4 write, 2 destructive

Reads

11

Fetches data and changes nothing.

  • list_organizations

    List the organizations this token can reach, with the slug every other call takes as org.

  • list_recent_builds

    List the most recent builds across every organization and pipeline this token reaches, newest first. Needs no slug, which makes it the quickest answer to "what failed just now" and the install's connection test, it fails when the token lacks read_builds.

  • list_pipelines

    List the pipelines in one organization, with each pipeline's slug, repository and default branch.

  • get_pipeline

    Retrieve one pipeline, including its steps configuration and branch filters.

  • list_builds

    List builds across every pipeline in one organization, newest first, without their jobs. Filter by state=failed to find what broke, then call get_build on one.

  • list_pipeline_builds

    List builds of one pipeline, newest first, without their jobs.

  • get_build

    Retrieve one build by its number, with every job in it. Each job carries its id, state and exit_status, the id is what get_job_log, tail_job_log, retry_job and unblock_job take.

  • tail_job_log

    Return the last 60 KB of one job's log as plain text. Start here when a job failed, the error is almost always at the end. Use get_job_log when the cause is earlier in the output.

  • get_job_log

    Return one job's whole log as JSON, with the content and its size in bytes. The content is cut at 60,000 characters from the start; use tail_job_log for the end of a long log.

  • list_build_annotations

    List the annotations on one build, the summaries test reporters and pipeline steps write, which often name the failing tests directly.

  • list_build_artifacts

    List the artifacts every job in one build uploaded, with path, size and the job that made each one.

Writes

4

Creates or updates something on the other side.

  • create_build

    Start a new build of a pipeline for one commit and branch. A write, not destructive, it adds a build and cancel_build stops it, but it runs whatever the pipeline runs, so a pipeline that deploys on this branch will deploy. Use HEAD as the commit for the latest commit on the branch.

  • rebuild_build

    Run a finished build again as a new build with the same commit, branch and environment. Returns the new build.

  • retry_failed_jobs

    Retry every failed job in one build, in place, leaving the jobs that passed alone. Cheaper than rebuild_build when one flaky job broke the build.

  • retry_job

    Retry one failed or timed-out job. Only command jobs that have finished can be retried.

Destructive

2

Deletes or permanently alters something. Worth granting on purpose.

  • cancel_build

    Cancel a running or scheduled build. Destructive because it cannot be undone, running jobs are stopped part-way, and the build can only be rebuilt from the start, not resumed.

  • unblock_job

    Unblock a block step so the build continues past it. Destructive because block steps are usually a human approval gate, often the one in front of a production deploy, and unblocking cannot be taken back once the next steps start.

What it will not do

The gateway enforces each of these, so they can be stated flatly.

It cannot call anything else
The 17 actions above are the whole of it. A call to any other name is refused before it reaches Buildkite rather than forwarded on, and connecting your account does not add to the list: it is fixed by the connector, not discovered at run time.
It reaches no further than your credential
Toolspoke holds no access to Buildkite of its own. Every call carries the credential you stored and nothing besides, so whatever that credential cannot reach, this connector cannot reach either.
It never hears from Buildkite
Nothing is pushed to it. There is no webhook, no subscription and no polling, so this connector cannot notice by itself that something changed in Buildkite. An agent has to ask.
It does not smooth over provider limits
Toolspoke does not retry, queue or back off around Buildkite's own rate limits. A call that Buildkite refuses comes back to the agent as a failed call.

Before you connect it

What can an agent do in Buildkite?

17 named actions: 11 that only read, 4 that write and 2 that delete or permanently alter something. They include list_organizations, list_recent_builds and list_pipelines. Nothing outside that list is reachable: the connector declares each operation by name rather than proxying whatever an agent asks for.

What credentials does the Buildkite connector need?

API access token. The connector asks for api access token. Values are encrypted at rest and attached to the outbound request by the gateway, so they are never part of the arguments an agent sends and never reach the audit log.

How does an agent get to use Buildkite?

Install Buildkite in a project and every agent in that project can use the actions the project leaves on. Describe a job in one sentence and the builder proposes the instructions, the toolkits it needs, a schedule and where it should answer, or start from a catalogue agent. The agent answers when someone asks it in Slack, emails it or mentions it on a GitHub pull request, or when its routine wakes it.

What does the Buildkite connector not do?

The 17 actions above are the whole of it. A call to any other name is refused before it reaches Buildkite rather than forwarded on, and connecting your account does not add to the list: it is fixed by the connector, not discovered at run time. Toolspoke holds no access to Buildkite of its own. Every call carries the credential you stored and nothing besides, so whatever that credential cannot reach, this connector cannot reach either. Nothing is pushed to it. There is no webhook, no subscription and no polling, so this connector cannot notice by itself that something changed in Buildkite. An agent has to ask. Toolspoke does not retry, queue or back off around Buildkite's own rate limits. A call that Buildkite refuses comes back to the agent as a failed call.

Can I limit which actions an agent can call?

Yes, in two places. The project switches Buildkite's actions on and off one at a time, for everyone in the project at once, and the screen groups them by read, write and destructive so turning off everything that deletes is one click. An individual agent key can then be narrowed further, to particular toolkits in a project and to particular actions in a toolkit. Whatever it was granted, a key never reaches a project its owner cannot.

What gets recorded when an agent calls Buildkite?

Every attempt, with the agent that made it and the person that agent belongs to, the full request payload, the response payload, the status, the duration, and what the call cost in sandbox time and model tokens. Values whose key names a secret are masked out before the record is shown to anyone. An operation the connector marks as not retained never has its response body written at all, so the gateway keeps no second copy of what was read.

Connect Buildkite to Toolspoke

Add Buildkite to a project and give it to an agent.