Repository navigation
Ignore a job's agent error opt-in when the agent protects it - #4524
Merged
Merged
Conversation
createEnvironment drops a job-supplied value for a name matched by --protected-environment-variables, so bootstrap reads the agent's own BUILDKITE_CAPTURE_AGENT_ERRORS. The job runner read the job's value anyway, so its direct reports could disagree with bootstrap about whether the job opted in. Fall back to the agent's value for a protected name too. Amp-Thread-ID: https://ampcode.com/threads/T-48370e54-5702-4610-a9d5-18b0dd17d98d Co-authored-by: Amp <amp@ampcode.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
With
--protected-environment-variables(or--protect-dangerous-git-environment-variables) matchingBUILDKITE_CAPTURE_AGENT_ERRORS, the bootstrap drops the job's value and uses the agent's own. The job runner, which reports refused jobs and Kubernetes container failures directly, read the job's value anyway. A job could therefore turn on (or off) the job runner's reports when the agent had protected the opt-in, and the two could disagree about whether the job opted in.The job runner now falls back to the agent's value for a protected name, the same way the bootstrap does.
The opt-in is new and unreleased, so this fixes it before it ships in v4.6.0 (#4523).
Changes
agentErrorCaptureEnabledignores the job's value when the name is protected.Testing
go test ./agent/...). Buildkite employees may check this if the pipeline has run automatically.go tool gofumpt -extra -w .)Disclosures / Credits
Written with Amp.