Skip to content

ci(changeset/check-coverage): drop catalog-bump requirement (overflagged vs pnpm changeset)#183

Merged
PaulNewling merged 2 commits into
v4-betafrom
fix/changeset-coverage-catalog-overflag
Jun 9, 2026
Merged

ci(changeset/check-coverage): drop catalog-bump requirement (overflagged vs pnpm changeset)#183
PaulNewling merged 2 commits into
v4-betafrom
fix/changeset-coverage-catalog-overflag

Conversation

@PaulNewling

@PaulNewling PaulNewling commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

check-coverage no longer requires a changeset for packages that merely consume a bumped catalog: dependency. That rule (section 2b) over-reported relative to pnpm changeset and failed PRs that were actually complete.

Why it was wrong

A catalog: entry always pins an external package — workspace packages are referenced via workspace:*, never catalog:. pnpm changeset never adds a package to its release plan because an external dependency's version changed, and it propagates bumps through the internal dependency chain automatically at changeset version time. So flagging catalog consumers was strictly stricter than changeset in every case.

Verified empirically (changesets 2.31.0): in the test fixture, a pure catalog bump makes changeset version report "No unreleased changesets found, exiting" and bump nothing.

Regression it fixes

platforma-open/clonotype-space#95: the .workflow package listed @platforma-sdk/workflow-tengo under dependencies as catalog:. The catalog bumped it 5.25.0 → 6.3.2 while the package's own files stayed untouched. The PR's changeset (model/ui/block) was complete per pnpm changeset, yet the check failed CI on .workflow.

Changes

  • check-coverage.sh — remove section 2b (catalog parsing, workspace map, yq). Keep direct-edit detection. Rewrite the header rationale.
  • action.yaml — rewrite the description; drop yq from runtime requirements (the script no longer uses it).
  • test/coverage.bats — replace the catalog cases that asserted exit 1 with parity cases asserting exit 0, including a regression that mirrors the clonotype-space shape (runtime catalog: dep bumps, consumer files untouched → passes). Drop the now-moot named-catalog skip.

Net −117 lines.

Verification

Test-driven: baseline green (17/1 skip) → 4 new parity tests RED against the old script → all 15 GREEN after removing 2b. bash -n clean. The 0-test-changeset-coverage.yaml workflow re-runs the suite on this PR.

Behavior change for consumers

A PR that only bumps a catalog dependency (no package source edits) now passes. This matches pnpm changeset. Direct edits to a package's own files still require a changeset, unchanged.

Greptile Summary

This PR removes section 2b of check-coverage.sh — the logic that flagged workspace packages as needing a changeset whenever a catalog: entry they consumed was bumped. The rationale is correct: catalog: always references external npm packages (workspace packages use workspace:*), and pnpm changeset itself never requires a release for an external-dependency bump.

  • check-coverage.sh: removes catalog parsing, workspace map building, and the yq-powered diff of pnpm-workspace.yaml; only direct file edits now trigger a coverage requirement (−72 lines).
  • action.yaml: description rewritten to document the intentional non-flagging of catalog bumps; yq dropped from stated runtime requirements.
  • test/coverage.bats: former "exit 1" catalog assertions replaced with four new "exit 0" parity tests, including a regression for the clonotype-space#95 shape.

Confidence Score: 5/5

The change removes a well-scoped block of logic with no side-effects on the remaining direct-edit detection path; all tests pass and the CI workflow is unchanged.

The removed catalog-detection block was self-contained. The remaining script paths are unmodified and the test suite covers every branch: exit 0, exit 1, and exit 2. The yq tool is still present in CI via helpers.bash's bump_catalog helper, so the test workflow's 'which yq' check continues to pass. No data is lost or silently dropped — catalog bumps simply no longer generate requirements, matching pnpm changeset behaviour.

No files require special attention.

Important Files Changed

Filename Overview
actions/changeset/check-coverage/check-coverage.sh Removes catalog-consumer detection (section 2b) entirely; only direct workspace-file edits via pnpm --filter '[<base>]' list now drive the required-bump set. Logic is clean, tmp-file cleanup trap updated correctly.
actions/changeset/check-coverage/action.yaml Description rewritten to reflect the simplified check; yq correctly dropped from stated runtime requirements since the production script no longer calls it.
actions/changeset/check-coverage/test/coverage.bats Catalog-bump "exit 1" assertions replaced with four well-documented "exit 0" parity tests; existing direct-edit and tooling-failure cases unchanged.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A([check-coverage.sh starts]) --> B[Run: changeset status --output]
    B --> C{status.json non-empty?}
    C -- No + 'no changesets were found' --> D[Write empty releases JSON]
    C -- No + exit != 0 --> E([exit 2: tooling failure])
    C -- Yes --> F[Build bumped_set from releases]
    D --> F
    F --> G["pnpm -r --filter '[origin/BASE_BRANCH]' list"]
    G --> H[jq: drop private packages]
    H --> I[Build required_set from direct edits only]
    I --> J{required_set ∩ ¬bumped_set = ∅?}
    J -- Yes --> K([exit 0: coverage complete])
    J -- No --> L[Print missing packages]
    L --> M([exit 1: coverage gap])
Loading

Reviews (1): Last reviewed commit: "ci(changeset/check-coverage): tighten co..." | Re-trigger Greptile

…ged vs pnpm changeset)

The check required a changeset for any package consuming a bumped catalog
dependency via `dependencies`/`peerDependencies`. That over-reports relative
to `pnpm changeset`: a catalog entry always pins an *external* package
(workspace packages use `workspace:*`, never `catalog:`), and changeset never
adds a package to its release plan because an external dependency's version
changed — it propagates bumps through the internal dependency chain
automatically at `changeset version` time.

Regression: platforma-open/clonotype-space#95. A `@platforma-sdk/workflow-tengo`
catalog bump (5.25.0 → 6.3.2) failed CI on the untouched `.workflow` package,
even though the PR's changeset (model/ui/block) was complete per `pnpm changeset`.

Remove section 2b (catalog-bump → require consumer) and its workspace-map /
yq parsing; keep direct-edit detection. The action no longer needs `yq`.

Tests: replace the catalog-bump cases (which asserted exit 1) with parity
cases asserting exit 0, including a regression mirroring the clonotype-space
shape (runtime `catalog:` dep bumps, consumer files untouched → passes). Drop
the now-moot named-catalog "known limitation" skip.
Cut the duplicated dependency-bump rationale at the direct-edit loop, lead the
header rule with a positive, and split the two-fact sentence for clarity.
Comment-only; no behavior change.
@PaulNewling PaulNewling marked this pull request as ready for review June 9, 2026 17:23
@PaulNewling PaulNewling merged commit f411832 into v4-beta Jun 9, 2026
2 checks passed
@PaulNewling PaulNewling deleted the fix/changeset-coverage-catalog-overflag branch June 9, 2026 17:24
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