Cirrus: Don't update last good commit if CI skipped #716
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.
Identify the Bug
The skipping logic from #701 is slightly broken.
Cirrus updates
CIRRUS_LAST_GREEN_CHANGE
for all "successful builds". Unexpectedly, that var is updated even if the build had no tasks, or had tasks that were allSKIPPED
.By the time the cron build rolled around, a branch push to
master
had already triggered, skipped, and been marked successful for that commit in Cirrus. So, the cron builds skipped as well, seeing that "the commit was already built once, nothing to do!".So, we were effectively skipping every build ever triggered on the Cirrus, even the cron builds that were meant to, you know, build and publish Rolling binaries every few days (Mon+Wed+Fri).
Description of the Change
Run a task that does nothing other than report a failing status, so the overall build gets marked as failed.
(Conditionally running this task using the proper inverse of the
only_if:
logic for the other "real" tasks we want to run... So, if we were going to skip everything, run only this task that quickly/quietly fails the build. If we were going to run real tasks, do so us usual and don't fail the builds.)Makes sure commits that have had CI "run-but-actually-skipped" on them don't report as "Successful", so the skipping logic doesn't prevent/skip all builds ever in Cirrus.
Alternate Designs
master
branch.Justification of why doing this instead of simplifying: I wanted to "skip repeat builds of the same commit (#701) and do so properly (this PR)", because "engineers gonna engineer" and add more cool stuff... But also, skipping re-builds both theoretically saves us some credits, and theoretically saves us from pushing out new Rolling binaries in situations when nothing actually changed. (Makes it easier to reason about when/why the different Rolling versions were produced.)
Possible Drawbacks
Verification Process
(We might end up with binaries published to the Rolling releases repo if we do that, in which case we should probably track those down and delete them...)Release Notes
Fixed skipping logic for Cirrus (but maybe don't add this in the actual Changelog, IDK, it's a CI-only change, so...???)