fix(ci): the palette gate turns main red after every release - #356
Merged
Conversation
The gate answers 'what does this branch ADD', which only means something while there is a branch to answer for. After the merge those lines are in the base, so a push run re-asks a question nobody can act on. Worse, it gets the wrong answer. On a push github.base_ref is empty, so the expression falls back to develop and the gate diffs main against develop. Release merges are squashed, so main is not an ancestor of develop, the merge-base lands before the last release, and a month of already-gated code is reported as newly added. That is what turned main red immediately after v0.4.0 merged, with a wall of violations none of which came from the release. Now PR-only. That loses no coverage: every one of those lines was gated on the PR that introduced it, which is the whole design of --new-from-rev style gates. Not the docker-scan shape: that one was gated on event_name and therefore never ran anywhere. Here the check has already run on the only event where it can be acted upon, and the second run is the one producing a false answer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What happened
v0.4.0 merged to
mainand Quality Checks went red immediately — a wall ofpalette violations, none of them from the release.
Why
The step runs on push as well as pull_request:
On a push,
github.base_refis empty, so the expression falls back todevelopand the gate diffsmainagainstdevelop.Release merges are squashed, so
mainis not an ancestor ofdevelop— itsHEAD has a single parent. The merge-base therefore lands before the last
release, and a month of already-gated code is reported as newly added.
I added a release-merge skip in ui#347 for
base_ref == main. It cannot firehere: on a push there is no base ref at all.
The fix
PR-only. The gate answers "what does this branch add"; after the merge those
lines are in the base, the question has no subject, and nobody can act on the
answer.
No coverage is lost — every one of those lines was gated on the PR that
introduced it, which is the entire design of a
--new-from-revstyle gate.Why this is not the failure mode this repo keeps hitting
docker-scangated onevent_name == 'push'Removing a run nobody can act on is not the same as removing the only run.
Verified on top of the committed change
origin/develop, clean branchorigin/develop, violation committedorigin/main(release merge)