Skip to content

Milab 6707 changeset coverage gate - #197

Closed
AStaroverov wants to merge 2 commits into
v4-betafrom
MILAB-6707_changeset-coverage-gate
Closed

Milab 6707 changeset coverage gate#197
AStaroverov wants to merge 2 commits into
v4-betafrom
MILAB-6707_changeset-coverage-gate

Conversation

@AStaroverov

@AStaroverov AStaroverov commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Greptile Summary

This PR turns changeset coverage from a standalone diagnostic into the second half of the opt-in blocking changeset gate and adds a branch-scoped empty-changeset waiver.

Important touched terms

  • Changeset coverage — the requirement that every publishable workspace package directly edited by a PR is represented in the release changeset. It now runs inside the blocking check-changesets job when block mode is enabled.
  • Direct package bump — a changeset entry that explicitly names the package at package-path, rather than a dependency-cascade bump. It remains the first half of the release gate.
  • Empty changeset — a .changeset/*.md file with empty YAML front matter, produced by pnpm changeset --empty, declaring that no release is needed. A file added on the PR branch now waives both halves of the gate.
  • Block mode — the require-package-path-bump workflow option that makes release-contract failures block pull requests. It now enables both direct-bump and edited-package coverage checks.
  • Skip-changelog label — the pull-request label that bypasses the complete changeset gate at job level; its behavior is unchanged but now also bypasses the integrated coverage half.
  • Base branch — the comparison reference used to identify edited packages and branch-added changesets. The action documents its requirement for full Git history and scopes waivers to files added since that base.

Confidence Score: 5/5

The PR appears safe to merge, with the blocking gate, waiver behavior, and failure precedence consistently implemented and tested.

The integrated coverage step retains its required checkout and installation context, runs after ordinary step failures through !cancelled(), and only accepts empty changesets added relative to the configured base branch after tooling checks succeed.

Important Files Changed

Filename Overview
.github/workflows/node-simple-pnpm.yaml Integrates edited-package coverage into the opt-in pull-request changeset gate while retaining the label-level bypass and required setup.
actions/changeset/check-coverage/check-coverage.sh Adds branch-scoped detection of empty changesets as a global coverage waiver after tooling and package coverage have been evaluated.
actions/changeset/check-coverage/action.yaml Documents the empty-changeset waiver, label handling, and full-history runtime requirement.
actions/changeset/check-coverage/test/coverage.bats Covers single and multiple missing packages, mixed real and empty changesets, stale base changesets, and tooling-failure precedence.
actions/changeset/check-coverage/test/helpers.bash Adds a fixture helper that creates and commits the canonical empty changeset shape.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  PR[Pull request] --> Enabled{Block mode enabled?}
  Enabled -- No --> Native[Run ordinary changeset status]
  Enabled -- Yes --> Label{skip-changelog label?}
  Label -- Yes --> Skip[Skip changeset gate]
  Label -- No --> Direct[Check direct package bump]
  Direct --> Coverage[Check edited-package coverage]
  Coverage --> Missing{Coverage gap?}
  Missing -- No --> Pass[Gate passes]
  Missing -- Yes --> Empty{Branch-added empty changeset?}
  Empty -- Yes --> Pass
  Empty -- No --> Fail[Gate fails]
Loading

Reviews (1): Last reviewed commit: "MILAB-6707: fold changeset coverage into..." | Re-trigger Greptile

Context used:

  • Context used - Terms is a types in codebase. Provide the list of ... (source)

`pnpm changeset --empty` already waived require-package-bump's half of the
gate but not coverage, so an author who declared "no release needed" was
passed by one half and failed by the other. Coverage now accepts the same
declaration, waiving every missing package at once.

Scoped to changesets ADDED in the branch: an empty changeset inherited from
the base branch must not disable the gate for every branch cut after it.
Exit 2 (tooling broken) still wins over the waiver.

The rule is duplicated rather than shared — there is no bash-sharing
precedent between actions here, and refactoring the working, tested
require-package-bump.sh was not worth the risk. Both copies state the rule
in place.

Six cases added to the bats suite.
The per-package coverage check ran as its own always-green job, so a red
result cost nothing and nobody had to act on it. It now runs as a second step
inside `check for changesets`, under the existing require-package-path-bump
toggle, and the separate diagnostic job is gone.

Neither half implies the other, so both run and both must pass:
require-package-bump ignores the diff and demands a bump of `package-path` on
every PR, while check-coverage ignores untouched packages and demands a bump
for each edited publishable one. Replacing the first with the second would
have weakened the gate — in a block repo the model/ui/workflow/test siblings
are private and so skipped by coverage, leaving a ui-only PR unchecked.

The second step runs under `!cancelled()` so one red check reports the
complete set of missing bumps instead of one per run.

No new input and no new check name. With the toggle off — every consumer
today — `check for changesets` behaves exactly as before; what those repos
give up is the never-actionable diagnostic check.
@notion-workspace

Copy link
Copy Markdown

@AStaroverov AStaroverov closed this Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant