You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: bk build list silently ignores the org in -p <org>/<pipeline> and queries selected_org #961
For an account with two organizations, bk build list silently discards the organization
part of -p <org>/<pipeline> and queries whatever bk config get selected_org holds.
With selected_org=org-b:
$ bk build list -p org-a/widgets --limit 1 --summary --no-pager
Error: failed to list builds: GET https://api.buildkite.com/v2/organizations/org-b/pipelines/widgets/builds?...: 404 No pipeline found
The request went to org-b even though org-a was named explicitly. That case at least
errors, because the pipeline only exists in org-a.
The damaging case is a pipeline slug that exists in both organizations (api, infra, deploy — common names). Then there is no error at all: the command returns a complete,
plausible list of builds belonging to the organization you did not ask for, with the
pipeline name you did ask for. Nothing in the default output announces the mismatch unless
you happen to read the organization field or the host path in web_url.
Related, and inconsistent between subcommands:
Command
Organization actually queried
bk build list -p <org>/<pipeline>
selected_org — org prefix discarded, no warning
bk build view <n> -p <org>/<pipeline>
The org in -p, but with selected_org's credentials, so it fails 404 No organization found
bk pipeline list --org <slug>
Correct — org and credentials both resolve
So bk build view builds the right URL with the wrong token, and bk build list builds the
wrong URL. Only pipeline list handles it correctly, and --org is not a global flag — bk build list does not accept it at all.
Why this matters beyond ergonomics
For agent-driven use (this is increasingly the consumer — --agent, --summary, and the MCP
server all point that way) a wrong answer that reads as correct is worse than a failure. An
agent asked to check org-a's build has no signal that it was handed org-b's. For anyone whose
two organizations are separate clients or customers, that is a confidentiality problem, not
just a wasted query.
Expected behaviour
Any of these would resolve it, roughly in order of preference:
Honour the organization in -p <org>/<pipeline> consistently across subcommands, resolving
the matching stored credentials rather than selected_org's.
Accept --org as a global flag with the same semantics, since bk pipeline list already
implements exactly this.
At minimum, fail loudly: if -p names an organization that differs from selected_org,
error instead of silently substituting.
Silently substituting a different organization is the one behaviour that should not survive.
Version
bk version 3.55.0, macOS arm64, installed via the buildkite/buildkite tap.
Activity
omehegan commentedon Sep 10, 2026
Hey @elijahchancey thanks for sharing this one! Definitely looks like a bug, we'll try to get a fix out ASAP.