ci: let the semver gate see a break on a push, not only on a pull request - #138
Merged
Merged
Conversation
…uest `github.event.pull_request` does not exist on a push, so the `breaking` label expression silently yielded `patch` there. #137 merged a deliberate break with the label, was green as a pull request, and turned `main` red on the very next push -- and would have stayed red until 0.7.0 moved the baseline. The label was the wrong signal for a push. A break is declared twice now, and the second declaration is the CHANGELOG: a `### Breaking` heading under `## [Unreleased]`, scoped to that section so a heading in a released one does not count. That is the document a release is cut from, so tying the gate to it means merging a break without recording it fails -- a better rule than the label alone, which said nothing after the merge. Exercised against three trees: `[Unreleased]` with the heading -> major, without it -> patch, and the heading present only under `[0.6.1]` -> patch. Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
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.
mainis red right now, and this is why.github.event.pull_requestdoes not exist on apush, sosilently yields
patchthere. #137 merged a deliberate break carrying thebreakinglabel, was green as a pull request, and turnedmainred on the very next push — and would have stayed red until 0.7.0 moved the baseline.The fix
The label was the wrong signal for a push. A break is declared twice now, and the second declaration is the CHANGELOG: a
### Breakingheading under## [Unreleased], scoped to that section so a heading in an already-released one does not count.That is the document a release is cut from, which makes the push gate mean something rather than nothing: merge a break without recording it and this fails. A better rule than the label alone, which said nothing at all after the merge.
Exercised, not assumed
[Unreleased]contains### Breakingmajorpatch[0.6.1]patchThe third case is the one that makes it a real predicate rather than a grep for a string that appears somewhere in a 1200-line file.
docs/RELEASING.mdrecords both declarations and why each exists.Signed-off-by: Vyncint Ng 115854244+vyncint@users.noreply.github.com