Skip to content

ci(smoke): publish no preview for a push CI does not read - #452

Closed
Ardnived wants to merge 3 commits into
mainfrom
ci/skip-docs-only-previews
Closed

Ardnived wants to merge 3 commits into
mainfrom
ci/skip-docs-only-previews

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • scripts/plan-preview.mjs decides whether the Smoke job publishes a preview. A push whose every changed file matches UNREAD_BY_CI ((^|/)[^/]*\.md$|^(docs|\.claude)/) is reported as unread, and the install, build, publish, check-run and smoke steps skip; the report step annotates it and exits 0.
  • A script, not a step. Twenty lines of bash and two API calls in ci.yml could be asserted only as text — which is what the first draft's tests did. With the two reads injected, scripts/plan-preview.test.ts holds every case as an assertion instead.
  • No masking: on a later push of the same PR, the skip also needs the previous head's own Smoke check run to have concluded success. A failed, cancelled or missing predecessor publishes as usual, so an unread push can't put a green check over a red one.
  • Fails toward publishing: a refused compare, an empty one, one at the API's 300-file cap, or any other throw returns publish. The question is asked only once publishing is otherwise possible, so a missing secret stays loud and forks are untouched.
  • Named for what it covers, not for documentation: the pattern reaches .claude/, which is config and hook code. So the state is unread and the annotation reads "only files the build and the smoke lane do not read". tests/ and .github/ stay out of it on purpose, because changing either is what the smoke lane is for.
  • Where the two steps sit. The pre-checkout step still decides queue, fork and no-credentials first, so a merge-queue entry and a fork pay for no setup at all. The script is a repo file, so it runs after actions/checkout: an unread push pays one checkout and skips everything after it. It reads through gh, so the credential is the one every other API call in this job already carries.
  • scripts/ci-workflows.test.ts holds the quiet set (fork/queue/unread) against the reasons the script exports, pins this job's check name against the script's own constant, and pins that the job still runs the script — the one thing no spec of the script can see. docs/testing.md names the state and points at the script rather than restating its guards.

What it saves, measured. 7 of the last 80 merged PRs were docs-only. That is a floor, not the rate: the skip fires per push, and a docs-only push inside a mixed PR skips too. The per-push rate is not measured.

Test results

  • Lean gate (.claude/skills/pr-prep/check.sh): lint, typecheck and 2170 unit tests pass.
  • Eleven assertions, each watched fail under its own mutation: a pattern reaching tests/, an empty compare counted as unread, a capped compare trusted, the predecessor's conclusion ignored, another app's check run accepted, the oldest run read instead of the newest, the lookup moved to the head, the catch removed, the check name renamed, the report case renamed back to docs, and the run: line dropped.
  • Run live against this repository's real API responses, through gh:
    • docs-only commits 5eb5621 (opened) and 0ce1c81 (reopened) → unread.
    • f315e96 (code) and this PR's own head → publish.
    • an empty compare (the same SHA on both sides) and a bogus base → publish.
    • a docs-only synchronize whose predecessor's own Smoke run concluded success → unread.
  • Not observed live: a predecessor that failed or ran no Smoke check — every recent commit on main carries a green one. That branch is covered by the spec in both directions, and the field shapes it reads (conclusion, started_at, app.slug) were confirmed against a real response.
  • Not yet observed on GitHub: a live unread run of this job. This PR changes .github/ and scripts/, so its own run publishes as usual.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Mg9rjZNrU2ZZJTqj1wPYo1

The Smoke job built, uploaded and smoked a preview for every push, including
ones that touched only Markdown, `docs/` or `.claude/`, which nothing in the
build or the smoke lane reads. Such a push now takes a third quiet state,
`docs`, beside `fork` and `queue`.

On a later push of the same PR the skip also needs the previous head's own
Smoke check to have passed, so a docs-only push cannot put a green check
over a red one for the same code. A failed, empty or 300-file compare
publishes as usual, and a missing secret stays loud.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sydevs-bot

sydevs-bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

🤖 no session running

recent dispatches
  • 22:26Z address-review · attempt 1 · session · done
  • 22:26Z address-review · attempt 1 · session
  • 22:18Z review-pr · attempt 2 · session · done
  • 22:18Z review-pr · attempt 2 · session
  • 18:54Z review-pr · attempt 1 · session · timed out

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 20, 2026
@sydevs-bot sydevs-bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 20, 2026
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Nov 20, 2026
@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 20, 2026
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Nov 20, 2026
@sydevs-bot

Copy link
Copy Markdown
Contributor

The session for review-pr did not finish after 3 attempts. I have stopped retrying. A mention (@sydevs-bot) or a push from you starts me again.

🤖 sydevs dispatcher

@sydevs-bot sydevs-bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 20, 2026
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 20, 2026
@sydevs-bot sydevs-bot moved this from Awaiting to Working in SYDevelopers Technical Roadmap Nov 20, 2026
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Nov 20, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧐 Adversarial review

The feature is right-sized and the safety work is its best part: failing toward publishing, the predecessor-green condition and the stated annotation each close a masking path. Two things to weigh. The logic landed in YAML, where this repo's convention is a scripts/*.mjs with a spec beside it — and the new tests show the strain, asserting the step's text rather than its behaviour. And the measurement counts whole PRs (7 of 80 docs-only) while the mechanism fires per push, so the figure cited neither bounds nor justifies the per-push skip. The per-push rate is what decides whether this pays its rent.

Findings

  • should-fix — docs_only belongs in scripts/, where its cases become assertions (.github/workflows/ci.yml:215)
  • should-fix — the predecessor rule now has three homes (docs/testing.md:44)
  • consider — DOCS is named for documentation but covers .claude/ config and hooks (.github/workflows/ci.yml:211)

What was checked

All three files whole, plus the smoke job and the on: block. The ladder: on.pull_request.paths-ignore is workflow-level and would skip the gate job too, and a path-skipped required check never reports — the platform has no answer here, so that held. scripts/ does: seven assert-*/check-* helpers each with a .test.ts, one already run by this job. DOCS reaches nothing the build or smoke lane reads — no .md or .claude/ path is read by src/, public/, vite.config.ts or tests/smoke/ — so the quiet skip is sound. Guards walked: a failed, empty or 300-file compare, a cancelled or absent predecessor, and merge_group all reach publish or queue. checks: write on the job already covers the new check-runs read. smoke: is the last job, so slicing to EOF still sees only it. No contract surface touched, and the diff touches no preview surface.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread docs/testing.md Resolved
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Nov 20, 2026
The skip was twenty lines of bash and two API calls inside `ci.yml`, which
no spec can execute — so the new assertions regexed the step's text, and the
eight cases run by hand lived only in the pull-request body. This repo's
convention is a `scripts/*.mjs` with a spec beside it, and this job already
runs one.

`scripts/plan-preview.mjs` now owns the question, with the reads injected, so
`plan-preview.test.ts` holds every case: both directions of the pattern, an
empty and a capped compare, each predecessor conclusion, the newest run, this
installation's run alone, the base the lookup asks about, and a refused read.
All eleven assertions were watched fail under mutation.

The step runs after the checkout, because a script is a repo file. The step
above still decides first, so a merge-queue entry and a fork pay for nothing;
an `unread` push pays one checkout and skips the install, the build, the
upload and the specs. It reads through `gh`, so the credential is the one
every other API call in this job already carries.

The pattern is `UNREAD_BY_CI` rather than `DOCS`, and the state `unread`
rather than `docs`: it also covers `.claude/`, which is config and hook code,
and the report told a reader "only documentation" for a hooks push. What makes
the skip safe is that nothing CI runs reads any of it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZNrU2ZZJTqj1wPYo1
The invariant carried the predecessor rule and the green-over-red argument a
second time, beside the same two sentences in `ci.yml`. A fact gets one home,
and prose never restates config. The bullet names the state and the script;
the script's docblock owns both guards.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZNrU2ZZJTqj1wPYo1
@sydevs-bot sydevs-bot changed the title ci(smoke): publish no preview for a docs-only push ci(smoke): publish no preview for a push CI does not read Nov 20, 2026
@sydevs-bot

Copy link
Copy Markdown
Contributor

All three adversarial-review threads adopted, in 04119ad and 2a041ce.

  • Move the decision to scripts/ — plan-preview.mjs owns it with its reads injected, so plan-preview.test.ts holds eleven cases, each watched fail under mutation. node runs pre-checkout; the script does not, so the step moved below actions/checkout.
  • DOCS covers .claude/ — the pattern is UNREAD_BY_CI, the state unread, and the annotation names what CI does not read.
  • The predecessor rule has three homes — docs/testing.md points at the script's docblock.

The review body's measurement had no thread: 7-of-80 counts PRs, while the skip fires per push. The body now calls it a floor.

The decision also ran live, six cases in the body. Lean gate: lint, typecheck, 2170 tests.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 20, 2026
@sydevs-bot sydevs-bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 20, 2026
@Ardnived

Copy link
Copy Markdown
Contributor Author

Closing: the owner chose not to skip previews for docs-only pushes. This job publishes its own preview and never waited, so the skip saved only a few CI minutes.

@Ardnived Ardnived closed this Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants