-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
buildkite: skip clone for GitHub check notifications #3106
Conversation
A documentation preview will be available soon. Request a new doc build by commenting
If your PR continues to fail for an unknown reason, the doc build pipeline may be broken. Elastic employees can check the pipeline status here. |
@v1v Thanks! It looks like this has broken the status reporting for the ci check though. The ci check is still showing as "expected" |
Thanks Brandon! I know now how to test this out :) I'll fix it |
@bmorelli25 , this is now working - took me a while until I passed my black belt with Buildkite 😭 |
curl -s -L \ | ||
-X POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer $${VAULT_GITHUB_TOKEN}" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoid interpolation and therefore exposing credentials
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was an interesting read in Slack
if [ $(buildkite-agent step get "outcome" --step "build-pr") == "passed" ]; then | ||
.buildkite/scripts/build_pr_commit_status.sh success | ||
else | ||
.buildkite/scripts/build_pr_commit_status.sh failure | ||
status_state=failure | ||
if [ $$(buildkite-agent step get "outcome" --step "build-pr") == "passed" ]; then | ||
status_state=success |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just out of curiosity, is there a performance reason for changing this logic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, these 2 steps take about ~ 25 seconds each, and that's only to notify the status in the GitHub PRs using GH checks. I came up with this after discussing different areas of improvement in https://github.com/elastic/observability-robots/issues/2408
In a nutshell, Buildkite does not allow to skip the checkout or speed up the checkout out of the box. In this case, I decided to remove the script from the repository and use the content in the Buildkite pipeline - by doing so, those 2 steps don't need the cloned repository.
However, if this complicates things, we can keep it as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Victor! I'll merge this at the start of my day tomorrow so that I can keep an eye on builds for a few hours to make sure everything is working as expected.
I copied the content of
.buildkite/scripts/build_pr_commit_status.sh
inside the Buildkite pipeline.I enabled https://github.com/uber-workflow/run-without-clone-buildkite-plugin to avoid cloning for quick runs. See https://github.com/elastic/observability-robots/issues/2408#issuecomment-2456737659
The
Preparing working directory
won't do anything, hence I expect about 30 seconds faster builds.Improvements
From
now