Skip to content

fix: gate package tags on release notes and trim Prepare's checkout - #4179

Merged
yannickmonney merged 7 commits into
mainfrom
fix/release-notes-gate-follow-ups
Oct 4, 2026
Merged

yannickmonney merged 7 commits into
mainfrom
fix/release-notes-gate-follow-ups

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

A version rejected by Release for missing or unfinished notes could still receive design-system package tags, and Release Prepare fetched the whole repository under a three-minute timeout. Publish packages now runs the same authored-notes validator before its only push step whenever a version is pinned. A plain main push still updates the moving dist branches without pinning a version. Prepare checks out only the release notes and standalone validator and does not persist credentials.

The change also prevents a newly deployed release feed from reporting a six-hour outage immediately, and refuses private traffic-snapshot destinations inside a checkout before creating directories. The documentation describes exactly what the validator checks, the existing draft-release lookup, and the separate source/ref semantics of manual package dispatches. Package publication and Release remain independent; passing the notes gate does not guarantee later Release success.

The original six author commits are preserved, including the two previously unpublished workflow commits. Current recovery head: 53cbd2be4cfd8739f94b45f5c50d509fd128a76c, composed with main 8a580fcc2e453c068a5119a37663777032aa7259. The recovered author diff is byte-identical to the patch in the original review. Follow-up tests pin Bash/root execution and disabled checkout credential persistence, exercise real Git non-cone path matching, and cover the proposed raw .. path case. That path case already passed under pinned Bun, so no speculative production change was made.

Validation:

  • Pinned Bun 1.4.2: 15/15 release-notes/traffic tests, 94 assertions. Missing/TODO notes refuse publication; valid notes pass; branch, tag and dispatch version resolution are covered without pushing anything.
  • Web release-feed and health tests: 41/41 across seven files.
  • Whole CLI/web typecheck and lint: seven successful tasks, zero cached. actionlint 1.7.12 with shellcheck passes on both workflows.
  • Scoped SAST: 205 applicable rules on seven files, zero findings; three configured exclusions retained. Formatting, conflict, manual-reference and link gates pass. Normal commit hooks pass.
  • Fresh hosted CI on this recovered head is pending. The synthetic sparse-checkout proof establishes path semantics; it does not claim a measured hosted checkout duration.

Merging this workflow change triggers its normal main-push publication of the moving package snapshots. No release or tag was created during validation.

Closes #4153

The traffic snapshot script created its output directory and only then
asked Git whether it sat inside a checkout, so a refused path still left
empty directories in the repository.

Check the deepest existing directory before creating anything, and keep
the check on the created directory for a symlink planted meanwhile.

Refs #4153
A server that booted on a build-time release list older than six hours
reported "no successful refresh within six hours" on its first failed
refresh, seconds after a deploy.

Report a stale episode only once the feed itself has gone six hours
without a successful refresh. /api/health still says what it serves.

Refs #4153
RELEASING.md said Prepare rejects "placeholder sections", but the
validator only refuses a missing file, a missing, repeated or misordered
section, and a section that is empty or holds TODO/TBD. Say exactly that,
and that template prose and wrong claims are the review's job.

Record why the Create release draft check stays on `gh release view`:
gh looks a draft up by its pending tag through GraphQL
`release(tagName:)` (cli/cli FetchRelease, v2.62.0 and trunk), the stub
test proves only the step's branching, and any failed lookup is treated
as a missing release.

Refs #4153
"Only comments or markup" overstated it again: the validator strips
comments, whitespace and `*`, `_` and `-` only, so a section holding
just a heading marker or a quote marker passes. Say exactly that.

Refs #4153
Prepare cloned the whole tree, about 540 MB, inside its three-minute
timeout to read one notes file. Fetch only `.github/release-notes` and
the validator with a sparse, non-cone checkout: actions/checkout then
filters blobs, and Prepare stays well inside the same timeout.

Also stop persisting the token in Prepare's checkout, which never
pushes.

The test reads the step's exact paths, checks that the validator
imports only Node built-ins, and runs the validation step from a tree
holding just those two paths.

Refs #4153
Release Prepare refuses a tag without valid authored notes, and that
version is never released, but Publish packages ran on the same tag
without the check and still pinned `ui-vX.Y.Z` and
`marketing-ui-vX.Y.Z` (and moved the `dist/` branches) for it.

Run the same validator, with the same version spelling, before the only
step that pushes, whenever the job pins a version: a tag push or a
`tag_version` dispatch. A plain push to main pins nothing and skips it.

The test runs the workflow's own step scripts: Resolve snapshot tag for
a branch push, a dispatch and a tag, then the check against no notes,
unfinished notes and valid notes.

Refs #4153
@yannickmonney

yannickmonney commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor Author

Independent review of PR #4179 at 6b8ef8d05e5699dd61daba7f98199afa5516def7: not mergeable at this head. The four commits on the branch are accepted from source. The two workflow commits, which are not on GitHub yet, were reviewed from the diff in the PR body: they are correct and fail closed.

  • Reviewer: Tale agent update dashboard ui (#508) #2 3f9fdcee-79e7-430b-a430-ba179d5b5132, TALE-359 run e72629f1-3dd3-46d7-931c-3a9a08f52696. I used one read-only source reviewer and cross-checked its claims.
  • Implementation: agent optimize chat agent #5 718fc56b, TALE-506 run cf33c6da. The runs are distinct.

Why it can't merge yet (MEDIUM, verified)

  • At this head, .github/workflows/publish-packages.yml and release.yml are identical to the base. git diff --stat 7063f9974 6b8ef8d05 lists only RELEASING.md, services/web/{README.md, lib/releases/feed.ts, feed.test.ts, tests/manual/reference/automation.md} and the traffic-snapshot script and its test.
  • Scenario: a squash of this head titled "gate package tags on release notes and trim Prepare's checkout" would ship neither change. A v0.5.72 tag without notes would still pin ui-v0.5.72 and marketing-ui-v0.5.72, and Prepare would keep its full checkout.
  • B's own tests ("Publish packages pins no package tag…") are only in B, so CI at this head never exercises the gate.
  • This matches the PR's own condition: merge only after a maintainer pushes 8aa9a373e and 2f2d70d7b and CI is green at that head.
  • Pushing them needs a token with workflow scope. The implementer's token lacks it, and as the reviewer I don't push to the branch under review. The push therefore goes to a maintainer, and TALE-506-Q1 tracks who.

A (on the branch), verified correct

  • The RELEASING.md text matches the code:
    • the validator description (:25-29) matches release-notes.ts:15-36;
    • the draft-check text (:226-232) matches release.yml:441-449.
  • feed.ts: now is read at :77, before startedAt (:93). The feed is built at module scope (server.ts:188), so the six-hour clock starts at server start. The new test covers the boundary.
  • Traffic script: the pre-check (:64) runs before mkdir, and the post-check (:67) stays.

B (applied with git apply to scratch copies of the head files), verified correct

  • The gate fails closed. It runs after checkout and Bun setup and before Publish snapshot, the only step that pushes, in both matrix legs. It has no continue-on-error, and Publish has no if:.
    • A tag push or a tag_version dispatch is checked.
    • A main push has no version, so the gate is skipped.
    • The version format and the semver regex match Release (release.yml:60,69).
  • Release and the gate decide the same way. Neither checkout sets ref:, both use Bun 1.4.2, and a test asserts that the two validate steps run the same command.
  • No injection and no new permission. TAG reaches the step through env, quoted, and the regex checks it before anything goes to $GITHUB_OUTPUT. Permissions are unchanged, and Prepare gains persist-credentials: false.
  • The sparse checkout has everything the validator needs. The validator imports only node: built-ins and finds the repo root from import.meta.dir. Non-cone patterns with a slash are anchored at the root, and the publication job keeps its own full checkout.

INFO (for the B round)

  1. A dispatch checks the notes at the ref it runs on, not at the version's tag.
    • A refused v0.5.72 can later pass a dispatch from main once v0.5.72.md lands there. A dispatch from a ref older than B has no gate at all.
    • Post-B RELEASING.md:226 ("Publish packages refuses that tag as well") is true only for the tag push.
  2. Package tags survive a Release that fails after Prepare. Post-B RELEASING.md:178 holds only for refused notes. Suggested wording: "a version whose notes Release refuses".
  3. A stale example. The tag_version input still says "e.g. 0.5.25" (publish-packages.yml:33), which the gate now refuses.
  4. What B's tests don't pin. Zod drops unknown keys, so the gate's working-directory/shell and persist-credentials: false aren't asserted. Git's non-cone matching was checked by copying files, not by running a sparse checkout.
  5. Hypothesis, not run: the traffic script's ancestor walk doesn't resolve ... For /tmp/x/../repo/sub, the pre-check passes, mkdir creates directories, and only then the post-check refuses. Calling resolve(directory) first fixes it; a test should add a .. case.
  6. Merging B starts one republish. It edits a file inside publish-packages.yml's own path filter, so the merge starts a main-push run that republishes dist/ui and dist/marketing-ui. That is expected and harmless.

Next: once B is pushed, I'll compare git diff 6b8ef8d05 <new head> with the diff in the PR body and require CI green at that head. Then I'll accept or return it.

@yannickmonney
yannickmonney merged commit 56dd869 into main Oct 4, 2026
@yannickmonney
yannickmonney deleted the fix/release-notes-gate-follow-ups branch October 4, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant