Skip to content

Add bk repository-connection commands to show GitHub API rate limits - #1016

Merged
wolfeidau merged 2 commits into
mainfrom
pb-3588-expose-github-repository-connection-rate-limits-in-mcp-and
Oct 6, 2026
Merged

wolfeidau merged 2 commits into
mainfrom
pb-3588-expose-github-repository-connection-rate-limits-in-mcp-and

Conversation

@wolfeidau

Copy link
Copy Markdown
Member

Description

When GitHub Actions workloads in Buildkite fail or slow down, one cause is the GitHub installation behind the organization's repository connection running out of API quota. bk had no way to see that quota, and it's easy to confuse with the Buildkite API rate limit. The repository connections REST API (already supported in go-buildkite v5.21.0) exposes it on the show endpoint.

Changes

Adds bk repository-connection (alias repo-connection) with two read-only subcommands. Both require organization administrator access.

  • list (ls) lists the organization's connections: display name, type, and ID. The API doesn't paginate this list or include rate limits in it.
  • view <connection-id> shows a connection's service account, host, and GitHub API rate limit, labelled as the GitHub installation quota rather than the Buildkite API rate limit.

When there's no cached quota, or the connection type has none, the rate limit is shown as unavailable rather than as zeros. In JSON and YAML, rate_limit, service_account, and host are always present and null when unavailable. If reset_at has passed, text output marks used and remaining as stale.

$ bk repo-connection view 01234567-…
…
GitHub API rate limit (GitHub installation quota, not the Buildkite API rate limit):

FIELD        VALUE
Limit        5000
Used         42
Remaining    4958
Reset At     2026-07-16T06:00:00Z (passed; used and remaining are stale)

$ bk repo-connection view 12345678-… -o yaml   # GitLab Self-Managed
display_name: GitLab Self-Managed
host: null
id: 12345678-…
rate_limit: null
service_account: null
type: gitlab_self_managed
…

Most of the main.go diff is gofumpt realigning the root command struct around the longer field name.

Testing

  • Tests have run locally (with go test ./...)
  • Code is formatted (with go fmt ./...)

Disclosures / Credits

Implemented with Amp.

@wolfeidau
wolfeidau marked this pull request as ready for review October 6, 2026 03:48
@wolfeidau
wolfeidau requested review from a team as code owners October 6, 2026 03:48
buildsworth-bk-app[bot]
buildsworth-bk-app Bot previously approved these changes Oct 6, 2026

@buildsworth-bk-app buildsworth-bk-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Want to dig deeper?

Paste this into your agent to explore the findings from this review's Buildkite build:

Download the buildsworth logs from build 36820, then answer my questions about the findings.

Install the reading-buildsworth-logs skill to run this.

About buildsworth

Model: gpt-6.1-sol with xhigh thinking.

How to request a review: Comment @buildsworth-bk review on the PR, or request buildsworth-bk as a reviewer.

Risk labels (how buildsworth classifies risk) — buildsworth classifies risk itself from the diff. Unless repository policy already allows L2 approval, grant it by mentioning @buildsworth-bk (see approval ceiling and L2 approval grant):

  • L1 — Low risk (dep bumps, docs/copy, lockfiles, small presentational fixes). buildsworth may approve by default.
  • L2 — Standard risk (new UI, additive API fields, refactors). Approved only when repository policy or a verified grant allows it; otherwise comment-only.
  • L3 — High risk (auth, migrations, payments, secrets, perf-critical pipeline paths). Human approval required unless repository policy explicitly allows L3 approval; per-PR grants cannot allow it.

Comment thread cmd/repositoryconnection/list.go Outdated
@buildsworth-bk-app
buildsworth-bk-app Bot dismissed their stale review October 6, 2026 03:58

Superseded by a newer Buildsworth review.

@wolfeidau
wolfeidau merged commit bf9e784 into main Oct 6, 2026
2 checks passed
@wolfeidau
wolfeidau deleted the pb-3588-expose-github-repository-connection-rate-limits-in-mcp-and branch October 6, 2026 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant