From de2b0ee4abe1268436712cdd3b8781c195752eea Mon Sep 17 00:00:00 2001 From: Paul Newling Date: Tue, 9 Jun 2026 10:12:23 -0700 Subject: [PATCH 1/2] ci(changeset/check-coverage): drop catalog-bump requirement (overflagged vs pnpm changeset) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- actions/changeset/check-coverage/action.yaml | 21 ++-- .../check-coverage/check-coverage.sh | 116 ++++------------- .../check-coverage/test/coverage.bats | 118 ++++++------------ 3 files changed, 69 insertions(+), 186 deletions(-) diff --git a/actions/changeset/check-coverage/action.yaml b/actions/changeset/check-coverage/action.yaml index 8bf83617..17ec6121 100644 --- a/actions/changeset/check-coverage/action.yaml +++ b/actions/changeset/check-coverage/action.yaml @@ -1,18 +1,19 @@ name: Check changeset coverage author: 'MiLaboratories' description: | - Fail if a PR's changesets don't cover every workspace package it modifies. + Fail if a PR's changesets don't cover every workspace package whose own + files it edits — e.g. editing block code under packages// without + adding that package to the changeset. - Catches two common gaps: - - editing files inside a workspace package (e.g. block code under - packages//) without adding that package to the changeset; - - bumping a catalog version in pnpm-workspace.yaml without a matching - bump for packages that consume it as a runtime dependency via - `catalog:` — build-tool bumps in devDependencies are ignored. + Dependency-version bumps are intentionally NOT flagged, including catalog + bumps in pnpm-workspace.yaml. A catalog entry always pins an external + package, and `pnpm changeset` never requires a release for an external + dependency bump — it propagates versions through the internal dependency + chain automatically at `changeset version` time. Flagging consumers of a + bumped catalog dependency would over-report relative to `pnpm changeset`. - Runs after `pnpm install`. Requires the runner to have `pnpm`, `jq`, and - `yq` (mikefarah, v4+) on PATH — all pre-installed on GitHub-hosted - ubuntu-latest images. + Runs after `pnpm install`. Requires the runner to have `pnpm` and `jq` on + PATH — both pre-installed on GitHub-hosted ubuntu-latest images. inputs: base-branch: diff --git a/actions/changeset/check-coverage/check-coverage.sh b/actions/changeset/check-coverage/check-coverage.sh index 4fc6d08e..2d47d976 100755 --- a/actions/changeset/check-coverage/check-coverage.sh +++ b/actions/changeset/check-coverage/check-coverage.sh @@ -1,25 +1,25 @@ #!/usr/bin/env bash # -# Verify the PR's changesets bump every workspace package the PR modifies. -# Exit 1 on a coverage gap; exit 2 on tooling failure; exit 0 otherwise. +# Verify the PR has a changeset for every workspace package whose own files +# it edits. Exit 1 on a coverage gap; exit 2 on tooling failure; exit 0 +# otherwise. # -# Two sources of "modified": +# "Modified" means a direct edit to a workspace package's own files, detected +# via `pnpm --filter '[]' list` — pnpm runs the per-package git-diff +# check itself. Root-level paths (`.github/`, `docs/`, `pnpm-workspace.yaml`, +# `README.md`) live in no package directory, so they never trigger inclusion. # -# 1. Direct edits to a workspace package's files, detected via -# `pnpm --filter '[]' list` — pnpm runs the per-package -# git-diff check itself. -# -# 2. Catalog version bumps in pnpm-workspace.yaml: for each touched -# catalog key, find workspace packages that consume it as a runtime -# dependency (`dependencies` or `peerDependencies`) via -# `"": "catalog:..."` and require those packages to bump. -# -# Runtime sections only — skip devDependencies and optionalDependencies. -# A build-tool bump (e.g. @platforma-sdk/block-tools in a block's model, -# @platforma-sdk/tengo-builder in its workflow) leaves the published -# artifact unchanged, and `pnpm changeset` ignores it too. Counting it -# flagged packages the PR never touched — e.g. a UI-only change that -# carried a shared build-tool bump. +# Dependency-version bumps are deliberately NOT a requirement — including +# catalog bumps in pnpm-workspace.yaml. A catalog entry always pins an +# *external* package (workspace packages are referenced via `workspace:*`, +# never `catalog:`), and `pnpm changeset` never adds a package to its release +# plan because an external dependency's version changed. It also propagates +# bumps through the internal dependency chain automatically at +# `changeset version` time. So requiring a hand-written changeset for a +# package that only "changed" via a dependency bump over-reports relative to +# `pnpm changeset` — see platforma-open/clonotype-space#95, where a +# `@platforma-sdk/workflow-tengo` catalog bump spuriously failed the +# untouched `.workflow` package. # # Skips private (unpublished) workspace packages — they never appear in # the changeset's release set. @@ -50,12 +50,11 @@ fi # absolute paths on macOS (prepends cwd, causing ENOENT). Cwd-relative is # safe on every platform. status_json=".changeset-coverage-status-$$.json" -pkg_list_json=".changeset-coverage-pkgs-$$.json" # --------------------------------------------------------------------------- # 1. Bumped set from `changeset status --output=...`. # --------------------------------------------------------------------------- -trap 'rm -f "${status_json}" "${pkg_list_json}"' EXIT +trap 'rm -f "${status_json}"' EXIT # Invoke the binary directly. `pnpm exec` and `pnpm