BUG FIX: Ensure Build Title Is Correct When Checkout Is Skipped #3024
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
Bug: When using skip-checkout plugin, the build title and commit details will match the previously checked out commit details (rather than taking it from the webhook details).
See video below. I trigger a build via webhook (with skip checkout). It starts off with the correct details, but changes to to the details of
HEAD
Screen.Recording.2024-10-04.at.1.00.33.PM.mov
Changes
Ensure agent gets correct commit message associated with webhook-triggered build, rather than reading it from git repo's
HEAD
.Modified function
sendCommitToBuildkite
ininternal/job/checkout.go
to extract the message frome.Commit
rather thanHEAD
Testing / Reproduction
To reproduce bug
pipeline.yml
to use the skip-checkout plugin. For example:Push a new commit and trigger the build via the webhook.
Observe the build logs. You'll notice the build takes commit details from the old commit (due to skipping checkout) instead of the new one.
Tests have run locally (with
go test ./...
). Buildkite employees may check this if the pipeline has run automatically.Code is formatted (with
go fmt ./...
)