switchroom 0.13.2 → 0.13.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/agent-scheduler/index.js +2 -2
  2. package/dist/auth-broker/index.js +2 -2
  3. package/dist/cli/switchroom.js +132 -214
  4. package/dist/host-control/main.js +2 -2
  5. package/dist/vault/approvals/kernel-server.js +2 -2
  6. package/dist/vault/broker/server.js +2 -2
  7. package/package.json +1 -1
  8. package/profiles/_base/start.sh.hbs +8 -8
  9. package/profiles/default/CLAUDE.md.hbs +1 -1
  10. package/telegram-plugin/dist/gateway/gateway.js +42 -10
  11. package/telegram-plugin/gateway/boot-probes.ts +13 -6
  12. package/telegram-plugin/gateway/gateway.ts +44 -6
  13. package/telegram-plugin/hooks/silent-end-interrupt-stop.mjs +5 -1
  14. package/telegram-plugin/silent-end.ts +56 -0
  15. package/telegram-plugin/tests/boot-probes.test.ts +26 -2
  16. package/telegram-plugin/tests/silent-end.test.ts +69 -0
  17. package/telegram-plugin/uat/scenarios/bridge-flap-resilience-dm.test.ts +166 -0
  18. package/skills/buildkite-agent-infrastructure/SKILL.md +0 -321
  19. package/skills/buildkite-agent-infrastructure/agents/openai.yaml +0 -6
  20. package/skills/buildkite-agent-infrastructure/assets/buildkite-icon-large.png +0 -0
  21. package/skills/buildkite-agent-infrastructure/assets/buildkite-icon-small.png +0 -0
  22. package/skills/buildkite-agent-infrastructure/references/audit-logging.md +0 -87
  23. package/skills/buildkite-agent-infrastructure/references/graphql-mutations.md +0 -690
  24. package/skills/buildkite-agent-infrastructure/references/instance-shapes.md +0 -38
  25. package/skills/buildkite-agent-infrastructure/references/pipeline-templates.md +0 -73
  26. package/skills/buildkite-agent-infrastructure/references/self-hosted-agents.md +0 -137
  27. package/skills/buildkite-agent-infrastructure/references/sso-saml.md +0 -92
  28. package/skills/buildkite-agent-runtime/SKILL.md +0 -509
  29. package/skills/buildkite-agent-runtime/agents/openai.yaml +0 -6
  30. package/skills/buildkite-agent-runtime/assets/buildkite-icon-large.png +0 -0
  31. package/skills/buildkite-agent-runtime/assets/buildkite-icon-small.png +0 -0
  32. package/skills/buildkite-agent-runtime/references/flag-reference.md +0 -417
  33. package/skills/buildkite-agent-runtime/references/patterns-and-recipes.md +0 -555
  34. package/skills/buildkite-api/SKILL.md +0 -308
  35. package/skills/buildkite-api/agents/openai.yaml +0 -6
  36. package/skills/buildkite-api/assets/buildkite-icon-large.png +0 -0
  37. package/skills/buildkite-api/assets/buildkite-icon-small.png +0 -0
  38. package/skills/buildkite-api/references/graphql-reference.md +0 -195
  39. package/skills/buildkite-api/references/patterns.md +0 -44
  40. package/skills/buildkite-api/references/webhooks.md +0 -161
  41. package/skills/buildkite-cli/SKILL.md +0 -397
  42. package/skills/buildkite-cli/agents/openai.yaml +0 -6
  43. package/skills/buildkite-cli/assets/buildkite-icon-large.png +0 -0
  44. package/skills/buildkite-cli/assets/buildkite-icon-small.png +0 -0
  45. package/skills/buildkite-cli/references/command-reference.md +0 -181
  46. package/skills/buildkite-migration/SKILL.md +0 -195
  47. package/skills/buildkite-pipelines/SKILL.md +0 -481
  48. package/skills/buildkite-pipelines/agents/openai.yaml +0 -6
  49. package/skills/buildkite-pipelines/assets/buildkite-icon-large.png +0 -0
  50. package/skills/buildkite-pipelines/assets/buildkite-icon-small.png +0 -0
  51. package/skills/buildkite-pipelines/examples/basic-pipeline.yml +0 -24
  52. package/skills/buildkite-pipelines/examples/optimized-pipeline.yml +0 -100
  53. package/skills/buildkite-pipelines/references/advanced-patterns.md +0 -286
  54. package/skills/buildkite-pipelines/references/retry-and-error-codes.md +0 -131
  55. package/skills/buildkite-pipelines/references/step-types-reference.md +0 -225
  56. package/skills/buildkite-secure-delivery/SKILL.md +0 -182
  57. package/skills/buildkite-secure-delivery/agents/openai.yaml +0 -6
  58. package/skills/buildkite-secure-delivery/assets/buildkite-icon-large.png +0 -0
  59. package/skills/buildkite-secure-delivery/assets/buildkite-icon-small.png +0 -0
  60. package/skills/buildkite-secure-delivery/references/oidc-cloud-providers.md +0 -83
  61. package/skills/buildkite-secure-delivery/references/package-publishing.md +0 -100
  62. package/skills/buildkite-test-engine/SKILL.md +0 -256
  63. package/skills/buildkite-test-engine/agents/openai.yaml +0 -6
  64. package/skills/buildkite-test-engine/assets/buildkite-icon-large.png +0 -0
  65. package/skills/buildkite-test-engine/assets/buildkite-icon-small.png +0 -0
  66. package/skills/buildkite-test-engine/examples/bktec-splitting.yml +0 -16
  67. package/skills/buildkite-test-engine/examples/collector-pipeline.yml +0 -11
  68. package/skills/buildkite-test-engine/references/collectors.md +0 -198
  69. package/skills/buildkite-test-engine/references/splitting-examples.md +0 -93
@@ -1,182 +0,0 @@
1
- ---
2
- name: buildkite-secure-delivery
3
- description: >
4
- Set up secure delivery for Buildkite CI: configure OIDC authentication
5
- (no static credentials), generate SLSA provenance / build attestations,
6
- sign pipelines and verify pipeline signatures with JWKS, publish to a
7
- package registry (packages.buildkite.com), push signed Docker images,
8
- and harden the supply chain end-to-end. Use when the user says:
9
- "Please secure the supply chain.", "I'd like to push a Docker image.",
10
- "Can you sign pipelines?", "I need to verify pipeline signatures.",
11
- "Could you sign pipelines for me?", "Set up SLSA provenance, please.",
12
- "authenticate without static credentials", "generate attestation",
13
- "publish to packages.buildkite.com", "gonna need to verify pipeline
14
- signatures", "gonna need to sign pipelines", "pls authenticate without
15
- static credentials", and typo'd variants like "set up LSA provenance",
16
- "verify ppeline signatures". Whenever the user's message starts with
17
- the phrase "For Buildkite OIDC/SLSA," — regardless of what follows —
18
- use this skill. Anything mentioning OIDC, SLSA, provenance,
19
- attestation, cosign, JWKS, pipeline signing, pipeline verification,
20
- packages.buildkite.com, Package Registry, artifact signing,
21
- credential-free publishing, or supply chain security fires this skill.
22
- Do NOT use for in-step `buildkite-agent oidc request-token` — that's
23
- `buildkite-agent-runtime`. Do NOT use for writing pipelines, uploading
24
- pipelines dynamically, or adding caching/plugins — those are
25
- `buildkite-pipelines`. Do NOT use for distributed locks — that's
26
- `buildkite-agent-runtime`.
27
- ---
28
-
29
- # Buildkite Secure Delivery
30
-
31
- Secure delivery covers the end-to-end flow of publishing artifacts with zero static credentials and proving supply chain integrity. This skill teaches OIDC-based authentication, Package Registry publishing, SLSA provenance attestation, and pipeline signing with JWKS.
32
-
33
- ## Quick Start
34
-
35
- Build, authenticate via OIDC, and push a Docker image — no static credentials:
36
-
37
- ```yaml
38
- steps:
39
- - key: "docker-publish"
40
- label: ":docker: Build & Push"
41
- commands:
42
- - docker build --tag packages.buildkite.com/my-org/my-registry/my-app:latest .
43
- - buildkite-agent oidc request-token --audience "https://packages.buildkite.com/my-org/my-registry" --lifetime 300 | docker login packages.buildkite.com/my-org/my-registry --username buildkite --password-stdin
44
- - docker push packages.buildkite.com/my-org/my-registry/my-app:latest
45
- plugins:
46
- - generate-provenance-attestation#v1.1.0:
47
- artifacts: "my-app:latest"
48
- attestation_name: "docker-attestation.json"
49
- ```
50
-
51
- This single step authenticates with a short-lived OIDC token (5 minutes), pushes the image, and generates a SLSA provenance attestation. No API keys or registry passwords stored anywhere.
52
-
53
- > For `buildkite-agent oidc request-token` flag details, see the **buildkite-agent-runtime** skill.
54
-
55
- ## OIDC Authentication
56
-
57
- Each job calls `buildkite-agent oidc request-token` to get a short-lived JWT (default 5 minutes) from the Buildkite backend. External services validate the JWT against Buildkite's OIDC provider (`https://agent.buildkite.com`) and grant access if claims match the trust policy.
58
-
59
- ### Token Claims
60
-
61
- The `sub` claim encodes the full context: `organization:{org}:pipeline:{slug}:ref:{ref}:commit:{sha}:step:{key}`. Key claims for trust policies: `organization_slug`, `pipeline_slug`, `build_branch`, `step_key`, `runner_environment`.
62
-
63
- ### OIDC with Buildkite Package Registry
64
-
65
- The `--audience` must exactly match the registry URL: `https://packages.buildkite.com/{org-slug}/{registry-slug}`. The username is always `buildkite`. The OIDC token acts as the password. See Quick Start for the full pattern.
66
-
67
- ### OIDC with Cloud Providers
68
-
69
- OIDC tokens work with AWS (via `aws-assume-role-with-web-identity` plugin or `sts:AssumeRoleWithWebIdentity`), GCP (via Workload Identity Federation), and Azure (via federated credentials). Each provider validates the JWT against Buildkite's OIDC issuer and grants access based on claim conditions.
70
-
71
- > For cloud provider OIDC setup including IAM trust policies, Workload Identity Pools, and Azure app registration, see `references/oidc-cloud-providers.md`.
72
-
73
- ### Scoping OIDC Policies
74
-
75
- Always restrict trust policies to minimum scope. Scope `sub` to pipeline and branch (`organization:acme-inc:pipeline:deploy-prod:ref:refs/heads/main:*`), never to the entire org (`organization:acme-inc:*`). Use `pipeline_slug` and `build_branch` conditions. For production deployments, require `build_branch: main`.
76
-
77
- ## Package Registry
78
-
79
- Buildkite Package Registry hosts packages across multiple ecosystems with OIDC-native authentication. Registries are scoped to an organization and accessed at `packages.buildkite.com/{org-slug}/{registry-slug}`.
80
-
81
- ### Supported Ecosystems
82
-
83
- | Ecosystem | Auth method |
84
- |-----------|-------------|
85
- | Docker / OCI | `docker login` with OIDC token |
86
- | npm | `.npmrc` with OIDC token |
87
- | Helm (OCI) | `helm registry login` with OIDC token |
88
- | Python, Ruby, Terraform, Debian, Alpine, RPM, Generic | `curl` with Bearer token header |
89
-
90
- ### Docker / OCI Publishing
91
-
92
- The most common pattern -- build, authenticate via OIDC, push. Tag images with `${BUILDKITE_BUILD_NUMBER}` or git SHA for traceability. Avoid `latest` tags in production -- they are not immutable. See Quick Start for the full pipeline step.
93
-
94
- > For npm, Helm, Python, Ruby, Terraform, and generic publishing patterns, see `references/package-publishing.md`.
95
-
96
- ## SLSA Provenance
97
-
98
- SLSA provenance records what was built, when, by whom, and from which source. Add `generate-provenance-attestation` to build steps to create signed attestations, then use `publish-to-packages` to upload artifacts with attestations attached.
99
-
100
- ### Generating Attestations
101
-
102
- ```yaml
103
- plugins:
104
- - generate-provenance-attestation#v1.1.0:
105
- artifacts: "my-library-*.gem" # Glob pattern matching artifacts to attest
106
- attestation_name: "build-attestation.json" # Output attestation filename
107
- ```
108
-
109
- The attestation captures builder identity, source (repo, branch, commit), build metadata, and material digests (SHA-256).
110
-
111
- ### Publishing with Attestations
112
-
113
- Use `publish-to-packages` with `artifacts` (glob pattern), `registry` (`{org-slug}/{registry-slug}`), and `attestations` (list of attestation files). The `generate-provenance-attestation` plugin satisfies SLSA Build Level 1. For Level 2, combine with Hosted Agents. For Level 3, add pipeline signing.
114
-
115
- ## Pipeline Signing (JWKS)
116
-
117
- Pipeline signing ensures the steps an agent runs are exactly the steps uploaded. Uploading agents sign pipeline definitions with a private JWKS key; executing agents verify signatures with the public key before running jobs.
118
-
119
- ### Setup
120
-
121
- Generate keys with `buildkite-agent tool keygen --alg EdDSA --key-id my-signing-key`. This creates `EdDSA-my-signing-key-private.json` (signing) and `EdDSA-my-signing-key-public.json` (verification). Store the private key securely.
122
-
123
- Configure `buildkite-agent.cfg`:
124
- - **Uploading agents**: set `signing-jwks-file` (private key) + `signing-jwks-key-id`
125
- - **Executing agents**: set `verification-jwks-file` (public key)
126
- - **Both roles**: set all three config keys
127
-
128
- ### Rollout
129
-
130
- 1. Deploy signing on uploading agents
131
- 2. Deploy verification in warn mode (`verification-failure-behavior=warn`)
132
- 3. Monitor and fix unsigned pipeline warnings in agent logs
133
- 4. Switch to block (remove `verification-failure-behavior=warn` -- default is `block`)
134
-
135
- Steps defined in the Buildkite UI are not agent-signed. Sign them manually with `buildkite-agent tool sign --update`. For Kubernetes, mount JWKS keys as secrets and configure `signingJWKSVolume`/`verificationJWKSVolume`.
136
-
137
- > For `buildkite-agent.cfg` configuration details, see the **buildkite-agent-infrastructure** skill.
138
-
139
- ## End-to-End Secure Publish Flow
140
-
141
- A complete pipeline combines: (1) **Build & Attest** -- build image, generate provenance with `generate-provenance-attestation`; (2) **Publish** -- authenticate via OIDC, push image, attach attestation via `publish-to-packages` (using `depends_on`); (3) **Deploy** -- authenticate to cloud via OIDC (e.g., `aws-assume-role-with-web-identity`). See Quick Start for the single-step pattern.
142
-
143
- > For a non-Docker example (Ruby gem secure publish flow), see `references/package-publishing.md`.
144
-
145
- ## Security Checklist
146
-
147
- - [ ] All authentication uses OIDC tokens -- no static API keys or passwords
148
- - [ ] OIDC `--audience` matches exact target service URL
149
- - [ ] `--lifetime 300` (5 minutes) or less
150
- - [ ] Trust policies scoped to `pipeline_slug` + `build_branch` + `organization_slug`
151
- - [ ] Published artifacts include SLSA attestation
152
- - [ ] Pipeline signing enabled with `verification-failure-behavior=block` in production
153
- - [ ] Dynamically-retrieved secrets added to the log redactor
154
-
155
- > For `buildkite-agent redactor add` syntax, see the **buildkite-agent-runtime** skill.
156
- > For `secrets:` pipeline YAML syntax, see the **buildkite-pipelines** skill.
157
-
158
- ## Common Mistakes
159
-
160
- | Mistake | Fix |
161
- |---------|-----|
162
- | OIDC `--audience` doesn't match registry URL exactly | Use `https://packages.buildkite.com/{org}/{registry}` with exact slugs |
163
- | Using static API keys instead of OIDC | Replace `docker login -p $API_KEY` with the OIDC pipe pattern |
164
- | `--lifetime` too long (e.g., 3600) | Set `--lifetime 300` (5 minutes) |
165
- | Skipping `warn` phase during signing rollout | Deploy with `verification-failure-behavior=warn` first, then switch to `block` |
166
- | OIDC trust policy too broad (`sub: organization:*`) | Scope to specific `pipeline_slug` and `build_branch` |
167
- | Forgetting to sign Pipeline Settings steps | Run `buildkite-agent tool sign --update` for pipelines with UI steps |
168
- | Unversioned plugins | Pin to exact version (`plugin#v1.2.0`) |
169
-
170
- ## Additional Resources
171
-
172
- ### Reference Files
173
- - **`references/oidc-cloud-providers.md`** -- OIDC setup for AWS (IAM trust policies, session tags), GCP (Workload Identity Federation), and Azure (federated credentials)
174
- - **`references/package-publishing.md`** -- Publishing patterns for npm, Helm, Python, Ruby, Terraform, and generic artifacts, plus installing from Package Registry
175
-
176
- ## Further Reading
177
-
178
- - [OIDC with Buildkite Pipelines](https://buildkite.com/docs/pipelines/security/oidc.md) -- OIDC configuration and trust policies
179
- - [SLSA Provenance](https://buildkite.com/docs/package-registries/security/slsa-provenance.md) -- attestation generation and verification
180
- - [Signed Pipelines](https://buildkite.com/docs/agent/v3/signed-pipelines.md) -- JWKS key generation, agent configuration, and rollout
181
- - [Package Registries Overview](https://buildkite.com/docs/package-registries.md) -- supported ecosystems and registry management
182
- - [Buildkite Docs for LLMs](https://buildkite.com/docs/llms.txt)
@@ -1,6 +0,0 @@
1
- interface:
2
- display_name: "Buildkite Secure Delivery"
3
- short_description: "OIDC authentication, Package Registry, SLSA provenance, and pipeline signing"
4
- icon_small: "./assets/buildkite-icon-small.png"
5
- icon_large: "./assets/buildkite-icon-large.png"
6
- brand_color: "#00D974"
@@ -1,83 +0,0 @@
1
- # OIDC Cloud Provider Integration
2
-
3
- ## OIDC with AWS
4
-
5
- Request an OIDC token for AWS, then assume an IAM role using web identity federation:
6
-
7
- ```bash
8
- buildkite-agent oidc request-token --audience sts.amazonaws.com
9
- ```
10
-
11
- Use the `aws-assume-role-with-web-identity` plugin for a streamlined pipeline step:
12
-
13
- ```yaml
14
- steps:
15
- - label: ":aws: Deploy"
16
- command: ./scripts/deploy.sh
17
- env:
18
- AWS_DEFAULT_REGION: us-east-1
19
- AWS_REGION: us-east-1
20
- plugins:
21
- - aws-assume-role-with-web-identity#v1.2.0:
22
- role-arn: arn:aws:iam::012345678910:role/my-deploy-role
23
- session-tags:
24
- - organization_slug
25
- - pipeline_slug
26
- ```
27
-
28
- AWS IAM trust policy requirements:
29
- - Set the OIDC provider to `https://agent.buildkite.com`
30
- - Set the audience to `sts.amazonaws.com`
31
- - Add conditions on `sub` or individual claims (`organization_slug`, `pipeline_slug`, `build_branch`) to restrict which pipelines can assume the role
32
-
33
- To include AWS session tags in the token, use `--aws-session-tag`:
34
-
35
- ```bash
36
- buildkite-agent oidc request-token \
37
- --audience sts.amazonaws.com \
38
- --aws-session-tag "organization_slug,organization_id"
39
- ```
40
-
41
- This adds an `https://aws.amazon.com/tags` claim with `principal_tags` for use in tag-based IAM policies.
42
-
43
- ## OIDC with GCP
44
-
45
- Use GCP Workload Identity Federation to exchange Buildkite OIDC tokens for GCP credentials:
46
-
47
- 1. Create a Workload Identity Pool and OIDC Provider:
48
-
49
- ```bash
50
- gcloud iam workload-identity-pools create buildkite-pool \
51
- --display-name "Buildkite Pool"
52
-
53
- gcloud iam workload-identity-pools providers create-oidc buildkite-provider \
54
- --workload-identity-pool buildkite-pool \
55
- --issuer-uri "https://agent.buildkite.com" \
56
- --attribute-mapping "google.subject=assertion.sub,attribute.pipeline_slug=assertion.pipeline_slug,attribute.organization_slug=assertion.organization_slug"
57
- ```
58
-
59
- 2. Grant the pool's service account the necessary IAM roles
60
- 3. Request a token in the pipeline step with the pool's audience:
61
-
62
- ```bash
63
- buildkite-agent oidc request-token \
64
- --audience "//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/buildkite-pool/providers/buildkite-provider"
65
- ```
66
-
67
- Use attribute conditions on `pipeline_slug` or `organization_slug` to restrict which pipelines can authenticate.
68
-
69
- ## OIDC with Azure
70
-
71
- Azure supports Workload Identity Federation with Buildkite OIDC:
72
-
73
- 1. Register an app in Azure AD with federated credentials
74
- 2. Set the issuer to `https://agent.buildkite.com`
75
- 3. Set the subject to the `sub` claim pattern for the target pipeline
76
- 4. Request a token in the pipeline step:
77
-
78
- ```bash
79
- buildkite-agent oidc request-token \
80
- --audience "api://AzureADTokenExchange"
81
- ```
82
-
83
- Use the Azure CLI or SDK to exchange the token for an access token.
@@ -1,100 +0,0 @@
1
- # Package Registry Publishing Guide
2
-
3
- ## npm Publishing
4
-
5
- Configure `.npmrc` with the registry URL and authenticate with an OIDC token:
6
-
7
- ```yaml
8
- steps:
9
- - label: ":npm: Publish Package"
10
- commands:
11
- - export OIDC_TOKEN=$(buildkite-agent oidc request-token --audience "https://packages.buildkite.com/acme-inc/npm-packages" --lifetime 300)
12
- - |
13
- cat > .npmrc << EOF
14
- //packages.buildkite.com/acme-inc/npm-packages/:_authToken=${OIDC_TOKEN}
15
- registry=https://packages.buildkite.com/acme-inc/npm-packages/
16
- EOF
17
- - npm publish
18
- ```
19
-
20
- ## Helm Chart Publishing (OCI)
21
-
22
- Push Helm charts to a Buildkite Helm OCI registry:
23
-
24
- ```yaml
25
- steps:
26
- - label: ":helm: Publish Chart"
27
- commands:
28
- - helm package ./chart
29
- - buildkite-agent oidc request-token --audience "https://packages.buildkite.com/acme-inc/helm-charts" --lifetime 300 | helm registry login packages.buildkite.com/acme-inc/helm-charts --username buildkite --password-stdin
30
- - helm push my-chart-1.0.0.tgz oci://packages.buildkite.com/acme-inc/helm-charts
31
- ```
32
-
33
- ## Python / Ruby / Generic Publishing
34
-
35
- For ecosystems that use direct HTTP upload, request an OIDC token and pass it as a Bearer token:
36
-
37
- ```yaml
38
- steps:
39
- - label: ":python: Publish Package"
40
- commands:
41
- - export OIDC_TOKEN=$(buildkite-agent oidc request-token --audience "https://packages.buildkite.com/acme-inc/python-packages" --lifetime 300)
42
- - python -m build
43
- - curl -X POST "https://api.buildkite.com/v2/packages/organizations/acme-inc/registries/python-packages/packages" -H "Authorization: Bearer ${OIDC_TOKEN}" -F "file=@dist/my-package-1.0.0.tar.gz"
44
- ```
45
-
46
- The same pattern applies to Ruby gems, Debian packages, RPMs, Alpine packages, Terraform modules, and generic artifacts -- change the file path and registry slug.
47
-
48
- ## Terraform Module Publishing
49
-
50
- Terraform module filenames must follow the naming convention `terraform-{provider}-{module}-{major.minor.patch}.tgz`:
51
-
52
- ```yaml
53
- steps:
54
- - label: ":terraform: Publish Module"
55
- commands:
56
- - export OIDC_TOKEN=$(buildkite-agent oidc request-token --audience "https://packages.buildkite.com/acme-inc/terraform-modules" --lifetime 300)
57
- - tar czf terraform-buildkite-pipeline-1.0.0.tgz -C modules .
58
- - curl -X POST "https://api.buildkite.com/v2/packages/organizations/acme-inc/registries/terraform-modules/packages" -H "Authorization: Bearer ${OIDC_TOKEN}" -F "file=@terraform-buildkite-pipeline-1.0.0.tgz"
59
- ```
60
-
61
- ## Installing from Package Registry
62
-
63
- Pull packages using the same OIDC pattern. For Docker images:
64
-
65
- ```bash
66
- buildkite-agent oidc request-token \
67
- --audience "https://packages.buildkite.com/acme-inc/docker-images" \
68
- --lifetime 300 \
69
- | docker login packages.buildkite.com/acme-inc/docker-images \
70
- --username buildkite --password-stdin
71
-
72
- docker pull packages.buildkite.com/acme-inc/docker-images/web-app:42
73
- ```
74
-
75
- For npm, configure `.npmrc` with the read token. For Helm, use `helm registry login` then `helm pull`.
76
-
77
- ## Ruby Gem Secure Publish Flow
78
-
79
- A non-Docker example using the `publish-to-packages` plugin directly:
80
-
81
- ```yaml
82
- steps:
83
- - label: ":ruby: Build Gem"
84
- key: "build-gem"
85
- command: "gem build my-library.gemspec"
86
- artifact_paths: "my-library-*.gem"
87
- plugins:
88
- - generate-provenance-attestation#v1.1.0:
89
- artifacts: "my-library-*.gem"
90
- attestation_name: "gem-attestation.json"
91
-
92
- - label: ":package: Publish Gem"
93
- depends_on: "build-gem"
94
- plugins:
95
- - publish-to-packages#v2.2.0:
96
- artifacts: "my-library-*.gem"
97
- registry: "acme-inc/ruby-gems"
98
- attestations:
99
- - "gem-attestation.json"
100
- ```
@@ -1,256 +0,0 @@
1
- ---
2
- name: buildkite-test-engine
3
- description: >
4
- ALWAYS use this skill when the user's message begins with "Using
5
- Buildkite Test Engine," — that prefix is a hard trigger regardless of
6
- what follows. Specifically fires on: "Using Buildkite Test Engine, Help
7
- me detect flaky tests.", "Using Buildkite Test Engine, Can you
8
- parallelize test suite?", "Using Buildkite Test Engine, Can you
9
- configure test collectors?", "Using Buildkite Test Engine, Let's speed
10
- up tests.", "Using Buildkite Test Engine, set up test splitting",
11
- "Using Buildkite Test Engine, quarantine flaky tests".
12
- Use when the user wants to split tests across parallel machines, set up
13
- test splitting, parallelize a test suite, detect or quarantine flaky tests,
14
- configure test collectors, speed up tests via Buildkite's Test Engine, set
15
- up `bktec`, or reduce flaky test failures.
16
- Triggers on natural phrasings including: "Help me detect flaky tests.",
17
- "Can you parallelize test suite?", "I need to configure test collectors.",
18
- "Can you configure test collectors?", "Let's speed up tests.",
19
- "Can you speed up tests?", "yo, how do i speed up tests",
20
- "gonna need to configure test collectors",
21
- "quick q — can i configure test collectors", and typo'd variants like
22
- "parallelize test suite", "set up tes tsplitting", "set up test splitting".
23
- Also fires on `bktec`, Buildkite Test Engine, test suites,
24
- `BUILDKITE_TEST_ENGINE_*` environment variables, `BUILDKITE_ANALYTICS_TOKEN`,
25
- the `test-collector` plugin, test reliability scores, test timing data,
26
- or any mention of Buildkite test splitting and flaky-test management.
27
- Do NOT use for authoring general pipeline YAML (that's `buildkite-pipelines`)
28
- or for `buildkite-agent` in-step subcommands (that's `buildkite-agent-runtime`).
29
- ---
30
-
31
- # Buildkite Test Engine
32
-
33
- Test Engine splits test suites across parallel machines and identifies flaky tests. Two components: **test collectors** gather timing data from runs, and **bktec** (the CLI) uses that data for intelligent splitting and automatic flaky test management.
34
-
35
- ## Quick Start
36
-
37
- Three steps: create a suite, add a collector, run bktec with parallelism.
38
-
39
- **1. Create a test suite** in the Buildkite dashboard: Test Suites > New test suite > Set up suite. Copy the suite API token.
40
-
41
- **2. Add the test-collector plugin** to start gathering timing data:
42
-
43
- ```yaml
44
- steps:
45
- - label: ":rspec: Tests"
46
- command: "bundle exec rspec"
47
- plugins:
48
- - test-collector#v2.0.0:
49
- files: "tmp/rspec-*.xml"
50
- format: "junit"
51
- env:
52
- BUILDKITE_ANALYTICS_TOKEN: "your-suite-api-token"
53
- ```
54
-
55
- **3. After ~1-2 weeks of data**, switch to bktec for intelligent splitting:
56
-
57
- ```yaml
58
- steps:
59
- - label: ":rspec: Tests %n"
60
- command: bktec
61
- parallelism: 10
62
- env:
63
- BUILDKITE_TEST_ENGINE_API_ACCESS_TOKEN: "your-api-access-token"
64
- BUILDKITE_TEST_ENGINE_SUITE_SLUG: "my-suite"
65
- BUILDKITE_TEST_ENGINE_TEST_RUNNER: "rspec"
66
- BUILDKITE_TEST_ENGINE_RESULT_PATH: "tmp/rspec-result.json"
67
- ```
68
-
69
- > For `parallelism:` YAML syntax and pipeline structure, see the **buildkite-pipelines** skill.
70
-
71
- ## How Test Engine Works
72
-
73
- Test Engine is a two-phase system:
74
-
75
- **Phase 1 — Data collection:** Test collectors send execution timing and pass/fail results to the Test Engine API after every run, building a historical profile for each test.
76
-
77
- **Phase 2 — Smart splitting + flaky management:** bktec reads historical data to partition tests across parallel agents by runtime, and to identify and quarantine flaky tests.
78
-
79
- ### The Two Token Types
80
-
81
- Test Engine uses two different tokens:
82
-
83
- | Token | Environment Variable | Purpose | Where to get it |
84
- |-------|---------------------|---------|-----------------|
85
- | **Suite API token** | `BUILDKITE_ANALYTICS_TOKEN` | Collectors use this to send test data to a specific suite | Test suite settings page |
86
- | **API access token** | `BUILDKITE_TEST_ENGINE_API_ACCESS_TOKEN` | bktec uses this to fetch timing data and test plans | Personal Settings > API Access Tokens (requires `read_suites` scope) |
87
-
88
- These are not interchangeable.
89
-
90
- ## Creating Test Suites
91
-
92
- Create via the dashboard: **Test Suites > New test suite > Set up suite**. The suite settings page shows the **suite API token** (for collectors) and the **suite slug** (for bktec).
93
-
94
- > For creating suites via REST API, see the **buildkite-api** skill.
95
-
96
- ### Suites and pipelines
97
-
98
- Pipelines and suites do not need a one-to-one relationship. Multiple pipelines can report to the same suite (monorepos), and one pipeline can report to multiple suites (separate unit/integration suites).
99
-
100
- ## Test Collectors
101
-
102
- Install the collector for the test framework, set `BUILDKITE_ANALYTICS_TOKEN`, and run tests normally. Collectors must be configured before bktec splitting works.
103
-
104
- - **Ruby** — `buildkite-test_collector` gem (RSpec, Minitest)
105
- - **JavaScript** — `buildkite-test-collector` npm package (Jest, Playwright, Cypress)
106
- - **Python** — bktec handles collection directly when runner is `pytest`
107
- - **Go / other languages** — JUnit XML upload via the analytics API
108
- - **Any framework** — `test-collector` Buildkite plugin for file-based upload
109
-
110
- > For per-framework setup instructions and configuration examples, see **`references/collectors.md`**.
111
-
112
- ## bktec CLI
113
-
114
- bktec is the CLI that replaces the test runner command in pipeline steps. It fetches a test plan from the Test Engine API balanced by historical runtime, runs the assigned subset, uploads results, and optionally retries failed tests.
115
-
116
- ### Installation
117
-
118
- Pre-installed on Buildkite hosted agents. For self-hosted agents:
119
-
120
- ```bash
121
- curl -sL https://github.com/buildkite/test-engine-client/releases/latest/download/bktec-linux-amd64 -o /usr/local/bin/bktec
122
- chmod +x /usr/local/bin/bktec
123
- ```
124
-
125
- ### Supported test runners
126
-
127
- `rspec` (supports split-by-example), `jest`, `playwright`, `cypress`, `pytest`, `pytest-pants`, `go`, `cucumber` — all split by file/spec/package except RSpec which also supports split-by-example.
128
-
129
- If bktec cannot reach the API or no timing data exists, it falls back to file-count splitting. Enable `BUILDKITE_TEST_ENGINE_DEBUG_ENABLED` to verify the splitting strategy.
130
-
131
- ## bktec Environment Variables
132
-
133
- ### Required variables
134
-
135
- | Variable | Description |
136
- |----------|-------------|
137
- | `BUILDKITE_TEST_ENGINE_API_ACCESS_TOKEN` | API access token for authenticating with Test Engine (requires `read_suites` scope) |
138
- | `BUILDKITE_TEST_ENGINE_SUITE_SLUG` | Slug of the test suite to fetch timing data from |
139
- | `BUILDKITE_TEST_ENGINE_TEST_RUNNER` | Test runner to use: `rspec`, `jest`, `playwright`, `cypress`, `pytest`, `pytest-pants`, `go`, `cucumber` |
140
- | `BUILDKITE_TEST_ENGINE_RESULT_PATH` | Path where bktec writes test results (e.g., `tmp/rspec-result.json`) |
141
-
142
- ### Optional variables
143
-
144
- | Variable | Default | Description |
145
- |----------|---------|-------------|
146
- | `BUILDKITE_TEST_ENGINE_RETRY_COUNT` | `0` | Number of times to retry failed tests. Set to `2` for flaky detection |
147
- | `BUILDKITE_TEST_ENGINE_SPLIT_BY_EXAMPLE` | `false` | Split by individual test example instead of by file (RSpec only) |
148
- | `BUILDKITE_TEST_ENGINE_TEST_FILE_PATTERN` | Runner default | Glob pattern to select test files (e.g., `spec/**/*_spec.rb`) |
149
- | `BUILDKITE_TEST_ENGINE_DEBUG_ENABLED` | `false` | Enable debug logging to see splitting strategy and file assignments |
150
-
151
- Standard Buildkite environment variables (`BUILDKITE_BUILD_ID`, `BUILDKITE_PARALLEL_JOB`, `BUILDKITE_PARALLEL_JOB_COUNT`, etc.) are used automatically by bktec. When running in Docker, expose them explicitly via the plugin `environment` list.
152
-
153
- ## Test Splitting
154
-
155
- ### Timing-based splitting
156
-
157
- With historical timing data, bktec assigns files to agents based on cumulative runtime so each agent finishes in approximately the same time. The test plan updates every build, so splitting improves continuously as more data accumulates.
158
-
159
- Pipeline configuration is shown in Quick Start step 3. Use `%n` in the label to show the parallel job index.
160
-
161
- > For complete per-framework pipeline examples (RSpec, Jest, pytest, Go), split-by-example vs split-by-file guidance, parallelism tuning table, and custom test command configuration, see **`references/splitting-examples.md`**.
162
-
163
- ## Flaky Test Detection
164
-
165
- Test Engine flags a test as flaky when the same test on the same commit produces both pass and fail results.
166
-
167
- ### Automatic retry for flaky detection
168
-
169
- Set `BUILDKITE_TEST_ENGINE_RETRY_COUNT: "2"` to retry failed tests. If a test fails then passes on retry, it is flagged as flaky. The build passes if all tests eventually pass.
170
-
171
- > For listing flaky tests via the REST API, see the **buildkite-api** skill.
172
-
173
- ### MCP tools for flaky test investigation
174
-
175
- When the Buildkite MCP server is available: `list_test_runs` (pass/fail trends), `get_test_run` (run details), `get_failed_executions` (error messages and stack traces), `get_build_test_engine_runs` (runs for a build).
176
-
177
- Triage: identify flaky tests via MCP tools or the dashboard, quarantine confirmed flakes, fix root causes, then remove from quarantine. Target < 3% flaky rate.
178
-
179
- ## Test States and Quarantine
180
-
181
- ### Test states
182
-
183
- | State | Meaning | bktec behavior |
184
- |-------|---------|----------------|
185
- | **Active** | Test runs normally | Included in test runs |
186
- | **Muted** | Test runs but failures are suppressed | Included in test runs; failures do not fail the build |
187
- | **Quarantined** | Test is excluded from runs | Excluded from test runs entirely |
188
-
189
- ### How quarantine works
190
-
191
- - bktec automatically excludes quarantined tests from runs, so they cannot fail the build
192
- - Supported for RSpec, Jest, and Playwright runners
193
-
194
- No special pipeline configuration is needed — bktec reads test states automatically. Change states through the dashboard. Fix root causes, then move tests back to Active.
195
-
196
- ## Docker and Containerized Environments
197
-
198
- When running tests inside Docker, expose both `BUILDKITE_TEST_ENGINE_*` and standard Buildkite variables via the Docker plugin `environment` list:
199
-
200
- ```yaml
201
- steps:
202
- - label: ":docker: Tests %n"
203
- command: bktec
204
- parallelism: 10
205
- plugins:
206
- - docker#v5.12.0:
207
- image: "myapp:test"
208
- environment:
209
- - BUILDKITE_TEST_ENGINE_API_ACCESS_TOKEN
210
- - BUILDKITE_TEST_ENGINE_SUITE_SLUG
211
- - BUILDKITE_TEST_ENGINE_TEST_RUNNER
212
- - BUILDKITE_TEST_ENGINE_RESULT_PATH
213
- - BUILDKITE_BUILD_ID
214
- - BUILDKITE_PARALLEL_JOB
215
- - BUILDKITE_PARALLEL_JOB_COUNT
216
- env:
217
- BUILDKITE_TEST_ENGINE_API_ACCESS_TOKEN: "your-api-access-token"
218
- BUILDKITE_TEST_ENGINE_SUITE_SLUG: "my-suite"
219
- BUILDKITE_TEST_ENGINE_TEST_RUNNER: "rspec"
220
- BUILDKITE_TEST_ENGINE_RESULT_PATH: "tmp/rspec-result.json"
221
- ```
222
-
223
- ## End-to-End Setup Walkthrough
224
-
225
- - **Week 1:** Run the collector pipeline (Quick Start step 2) for ~1-2 weeks to accumulate timing data.
226
- - **Week 2+:** Switch to bktec (Quick Start step 3). Add `BUILDKITE_TEST_ENGINE_RETRY_COUNT: "2"`.
227
- - **Week 3+:** Review the dashboard for flaky tests. Quarantine confirmed flakes. Target < 3% flaky rate.
228
- - **Ongoing:** Verify parallel agents finish within ~10% of each other. Review quarantined tests weekly. Monitor suite trends for regressions.
229
-
230
- ## Common Mistakes
231
-
232
- | Mistake | Fix |
233
- |---------|-----|
234
- | Confusing the two tokens | `BUILDKITE_ANALYTICS_TOKEN` is for collectors (suite-scoped). `BUILDKITE_TEST_ENGINE_API_ACCESS_TOKEN` is for bktec (user-scoped, `read_suites`). |
235
- | Running bktec before enough data | Run collectors for 1-2 weeks first. Enable `DEBUG_ENABLED` to verify timing-based splitting. |
236
- | Missing env vars in Docker | Pass `BUILDKITE_PARALLEL_JOB`, `BUILDKITE_PARALLEL_JOB_COUNT`, and other vars via Docker plugin `environment` list. |
237
- | `parallelism` > test file count | Agents receive zero tests and waste compute. Set at most the number of test files. |
238
- | Omitting `RESULT_PATH` | bktec cannot write results back. Always set it. |
239
- | Wrong `TEST_RUNNER` value | Use exact values: `rspec`, `jest`, `playwright`, `cypress`, `pytest`, `pytest-pants`, `go`, `cucumber`. |
240
- | Not pinning `test-collector` version | Always pin: `test-collector#v2.0.0`, not `test-collector#v2`. |
241
- | `RETRY_COUNT` above 3 | Use `2`. Higher values waste compute and mask genuine failures. |
242
-
243
- ## Additional Resources
244
-
245
- - **`references/collectors.md`** — Per-framework collector setup (Ruby, JavaScript, Python, Go, JUnit XML, test-collector plugin)
246
- - **`references/splitting-examples.md`** — Per-framework bktec examples, split-by-example, parallelism tuning
247
- - **`examples/collector-pipeline.yml`** — Minimal collector pipeline
248
- - **`examples/bktec-splitting.yml`** — bktec with parallelism, retry, and result path
249
-
250
- ## Further Reading
251
-
252
- - [Test Engine overview](https://buildkite.com/docs/test-engine.md)
253
- - [Configuring bktec](https://buildkite.com/docs/test-engine/bktec/configuring.md)
254
- - [Test collection](https://buildkite.com/docs/test-engine/test-collection.md)
255
- - [Test states and quarantine](https://buildkite.com/docs/test-engine/test-suites/test-state-and-quarantine.md)
256
- - [bktec source (GitHub)](https://github.com/buildkite/test-engine-client)
@@ -1,6 +0,0 @@
1
- interface:
2
- display_name: "Buildkite Test Engine"
3
- short_description: "Test splitting, flaky detection, quarantine, and bktec CLI"
4
- icon_small: "./assets/buildkite-icon-small.png"
5
- icon_large: "./assets/buildkite-icon-large.png"
6
- brand_color: "#00D974"
@@ -1,16 +0,0 @@
1
- # Pipeline using bktec for intelligent test splitting with parallelism,
2
- # automatic retry for flaky detection, and result path for data feedback
3
- steps:
4
- - label: ":rspec: Tests %n"
5
- command: bktec
6
- parallelism: 10
7
- retry:
8
- automatic:
9
- - exit_status: "*"
10
- limit: 2
11
- env:
12
- BUILDKITE_TEST_ENGINE_API_ACCESS_TOKEN: "your-api-access-token"
13
- BUILDKITE_TEST_ENGINE_SUITE_SLUG: "my-suite"
14
- BUILDKITE_TEST_ENGINE_TEST_RUNNER: "rspec"
15
- BUILDKITE_TEST_ENGINE_RESULT_PATH: "tmp/rspec-result.json"
16
- BUILDKITE_TEST_ENGINE_RETRY_COUNT: "2"