-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Add pull request job to verify transport versions backported via main #134568
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
Add pull request job to verify transport versions backported via main #134568
Conversation
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
2fb9b0c to
bfb97cf
Compare
rjernst
left a comment
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.
Looks good, just minor questions/comments
|
|
||
| # Get any changes in this pull request to transport definitions | ||
| git fetch origin "${BUILDKITE_PULL_REQUEST_BASE_BRANCH}" --quiet | ||
| changed_files=$(git diff --name-only "origin/${BUILDKITE_PULL_REQUEST_BASE_BRANCH}" | grep -E "server/src/main/resources/transport/definitions/.*\.csv" || true) |
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.
what does the "or true" do? Won't that make changed_files a boolean instead of a string list of changes?
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.
the || true just ensures we always return a 0 exit code from that command since we have set pipefail. Otherwise if grep doesn't return any matches, we'll exit with a non-zero exit code, failing the job, which isn't what we want.
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.
To further clarify, the true utility doesn't produce any output. It simply always returns a 0 exit code. So in that scenario changed_files is still an empty string if there are no matches.
This reverts commit 249b64e.
This registers a new PR job that ensures that any changes to transport versions to backport branches are also present in the
mainbranch. This check does not run on themainbranch itself.