-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Cirrus: Fix post-merge env. var. not set. #3601
Cirrus: Fix post-merge env. var. not set. #3601
Conversation
This should fix post-merge testing failing in 'build_each_commit' like this:
|
LGTM once tests go green |
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.
Alarming, especially with no explanation. Please add a commit message when you have a moment.
(I'm not blocking, because it sounds like this is urgent, but I fervently hope that haste will not lead to further emergencies).
/hold |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cevich, rhatdan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
it is kind of urgent? But maybe not? GCE or Cirrus-CI have been have some random problems, but otherwise testing in PRs seems to be working fine. Post-merge testing has been failing for days on master, and I'll accept partial fault for not noticing 😢 Still, I appreciate you jumping in to take a look. I'll follow up first thing Friday morning. |
fe6cb5d
to
cac66ee
Compare
Rebased, added comments, added missing fix @edsantiago found. |
/hold cancel |
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.
LGTM but could I please, please beg you to add a commit message? This code will break in the future, maybe soon or maybe not, and a future maintainer would really appreciate knowing the history behind this change. This is the proper place to document the fact that CIRRUS_BASE_BRANCH cannot be used because it's only set at such-and-such times.
Cirrus-CI automatically sets `$CIRRUS_BASE_BRANCH` during PR testing. This is used for the `build_each_commit` task, in order to compute the commit-chain properly. However, prior to this commit and after a PR merges, the post-merge `build_each_commit` task would fail with something similar to: ``` make build-all-new-commits GIT_BASE_BRANCH=origin/$CIRRUS_BASE_BRANCH |& ${TIMESTAMP} [12:28:59] START - All [+xxxx] lines that follow are relative to right now. [+0000s] # Validate that all the commits build on top of origin/ [+0000s] git rebase origin/ -x make [+0000s] fatal: invalid upstream 'origin/' [+0000s] make: *** [Makefile:426: build-all-new-commits] Error 128 [12:28:59] END - [+0000s] total duration since START Exit status: 2 ``` This is because `$CIRRUS_BASE_BRANCH` is undefined when CI runs against a branch (by design). This commit fixes the problem by referring to `$DEST_BRANCH` instead. This variable must always point at the intended destination branch for testing, and so can be used in this context as well. Also updated a few comments to help steer understanding of the `$DEST_BRANCH` purpose. Signed-off-by: Chris Evich <[email protected]>
cac66ee
to
4c6e8aa
Compare
/lgtm |
Signed-off-by: Chris Evich [email protected]