Repository navigation
Description
Part of #554, change set B. Work on main. Rulings: #554 rulings 1, 2, 3, 5, 6, 7, 8, 15, 16.
Summary
- Today.
🧪 Ext (<extension>)and🧪 Webapp Unit Testsneedback-validation, so they start only after🔧 Backend Validationends. They read none of its output. - Measured wait. In all 14 baseline
(build):deploys, webapp unit started 2–3 s after🔧 Backend Validationended, at +132 to +172 s. In the 5 with Ext suites, the suites started 2–3 s after it.🔎 Detect Changeshad ended at +14 to +29 s. Example: in run 39398067267,🔧 Backend Validation / 🧪 Backend E2E(job 118545695380) ended at +138 s, all six Ext suites started at +141 s, and🔎 Detect Changes(job 118545695045) ended at +19 s. - Computed saving on the critical path (not measured end to end): median 64 s over all 14; 114–139 s on the 5 runs with an Ext suite; 35–76 s on the 9 without one, where webapp unit holds Build Verification back.
- PR runs. There
back-validationruns the unit suite only. The Ext suites waited 49–81 s for it on PRs 39284030984, 39274283996, 38445029108 and 37432063919. - Cost. Peak parallel hosted jobs rise from 6–7 to about 12–13 per deploy run, and from 8–9 to about 14 per PR run. The GitHub Free plan allows 20, account-wide. Four Dependabot PR runs within about 3 minutes on 2026-10-19 already pass 20: 39274283996, 39274304937, 39274590009, 39274647538. Such bursts will queue longer. Total job minutes do not change.
Method. Offsets are seconds after run createdAt, from gh run view <id> --json jobs,createdAt. Each Ext suite and webapp unit moves to 2–3 s after its remaining need ends, with its own length kept. The new Build Verification start is the latest end of every build need, plus the 2–3 s pickup delay. The baseline is every push run whose 🚀 Deploy Production ended success on attempt 1, from 2026-09-22 to 2026-10-20. Computed saving per run, in seconds (Ext suite count in brackets):
35723691814 56 (0) · 36324777594 139 (5) · 36437965916 119 (1) · 36473904247 54 (0) · 36550492709 63 (0) · 37431581531 133 (5) · 37440315600 64 (0) · 37976785981 76 (0) · 38068638114 35 (0) · 38239392350 46 (0) · 38392614215 41 (0) · 39275929831 49 (0) · 39297468969 114 (1) · 39398067267 119 (6).
Depends on / Blocks
- Depends on: nothing. Blocks: nothing.
- Touches the same lines as:
- Make CI failures reach Telegram: set the watchdog secrets, alert on red E2E pushes #557 lowers the
extension-teststimeout from 25 to 15 min. Step 0 uses text anchors, so a moved line is fine. - Run only the CI suites a pull request or push can affect #563 lands after set B and adds scope conditions to the
webapp-unit-testsif. - Build the deploy images while the quality gates run #565 (set D) moves the image build off the gate path. After it, this issue saves about 78 s on Ext runs and about 0 s otherwise.
- Write a timing table to every CI/CD run summary #556 (set A) writes a timing table to each run summary. Read the Verification offsets from it too.
- Make CI failures reach Telegram: set the watchdog secrets, alert on red E2E pushes #557 lowers the
Current behaviour
Links are pinned to d0a53756f8676556358b6adc6c2397d2ed7c64c8.
-
extension-testsneedsback-validationand skips when it failed (prod.docs.plus.yml:272-281):needs: [triage, changes, back-validation] # Run for a `front` trigger OR a normal app-CI commit; only changed extensions. if: | always() && needs.triage.outputs.skip_app_ci != 'true' && needs.back-validation.result != 'failure' && needs.changes.outputs.changed_extensions != '[]' &&
-
webapp-unit-testsdoes the same (prod.docs.plus.yml:308-318):needs: [triage, back-validation] if: | always() && github.event_name != 'schedule' && needs.triage.outputs.skip_app_ci != 'true' && needs.back-validation.result != 'failure' &&
-
Neither job reads a
back-validationoutput.back-validationis a reusable-workflow call with nooutputs(prod.docs.plus.yml:260-270). -
buildneeds every gate and checks each result (prod.docs.plus.yml:351-376). Line 374 is the backend clause, and it stays:(needs.back-validation.result == 'success' || needs.back-validation.result == 'skipped' || (github.event_name == 'workflow_dispatch' && inputs.skip_quality_gates)) &&deployneedsbuild(prod.docs.plus.yml:427-435). So a failedback-validationskipsbuild, and sodeploy. -
always()stays needed.triageis skipped onschedule(prod.docs.plus.yml:94). Without a status function, a job with a skipped need is skipped too. The weekly cron is the only unfiltered run of all six Ext suites (prod.docs.plus.yml:154-157). -
back-validationruns on every app deploy, including(build): front(prod.docs.plus.yml:263-267):if: github.event_name == 'pull_request' || needs.triage.outputs.has_back == 'true' || needs.triage.outputs.app_deploy == 'true'
-
.github/WORKFLOWS.mdshows back before front, with one stale cell (WORKFLOWS.md:79-90). Rows 81 and 82 readback → front → app → obs → ukandback → front → app. Row 84,(build): front uptime-kuma, shows Back-val⏭️, which line 267 already contradicts.WORKFLOWS.md:62says "canonical execution order is fixed". -
apps/hocuspocus.server/CLAUDE.md:272describes the commit-subject domain order, not job order. It stays.
Target behaviour
extension-testshasneeds: [triage, changes]and starts within a few seconds of🔎 Detect Changesending, whenchanged_extensionsis not[].webapp-unit-testshasneeds: [triage]and starts within a few seconds of🧭 Triage build triggerending.- Neither
ifreadsneeds.back-validation. Every other clause stays,always()included. A failedback-validationstill skipsbuild, and sodeploy. build,deploy,back-validation,triageandchangesare unchanged. The weekly cron still runs all six Ext suites..github/WORKFLOWS.mdshows back and front validation at the same time. Row 84 shows Back-val✅.
Implementation steps
Step 0. Read and check the base
-
Read every file in Read first. Run
git log --oneline -1andgit diff d0a53756f8676556358b6adc6c2397d2ed7c64c8 HEAD -- .github/workflows/prod.docs.plus.yml .github/WORKFLOWS.md, and note hunks inextension-tests,webapp-unit-testsor the truth table. Rungit status --shortandgit diff -- .github/workflows/prod.docs.plus.yml .github/WORKFLOWS.md, and note uncommitted hunks from other issues, so that Step 3 keeps them. -
Run these checks. Only the text counts, not the line numbers.
grep -n "needs: \[triage, changes, back-validation\]" .github/workflows/prod.docs.plus.yml # expect 1 hit grep -n "needs: \[triage, back-validation\]" .github/workflows/prod.docs.plus.yml # expect 1 hit grep -c "needs.back-validation.result != 'failure'" .github/workflows/prod.docs.plus.yml # expect 2 grep -n "needs.back-validation.result == 'success' || needs.back-validation.result == 'skipped'" .github/workflows/prod.docs.plus.yml # expect 1 hit, in build grep -n "| back → front → app" .github/WORKFLOWS.md # expect 2 hits
-
If any count differs, stop. Re-derive the edit from Target behaviour, and comment here with what changed.
Step 1. extension-tests: drop the back-validation need
In .github/workflows/prod.docs.plus.yml, job extension-tests, replace the block in Current behaviour item 1 with:
# No `back-validation` need: this job reads none of its output, and `build`
# still needs both, so a backend failure still blocks the deploy.
needs: [triage, changes]
# Run for a `front` trigger OR a normal app-CI commit; only changed extensions.
if: |
always() &&
needs.triage.outputs.skip_app_ci != 'true' &&
needs.changes.outputs.changed_extensions != '[]' &&Keep always(), or the cron skips every Ext suite. Leave the last if line, the matrix, the timeout and the steps unchanged.
Check: grep -n -A8 "name: 🧪 Ext (" .github/workflows/prod.docs.plus.yml shows needs: [triage, changes]. back-validation appears only in the new comment.
Step 2. webapp-unit-tests: drop the back-validation need
Same file, job webapp-unit-tests. Replace the block in Current behaviour item 2 with:
# No `back-validation` need, for the same reason as `extension-tests`.
needs: [triage]
if: |
always() &&
github.event_name != 'schedule' &&
needs.triage.outputs.skip_app_ci != 'true' &&Keep always() and the last if line (the has_front clause) unchanged.
Check: grep -n -A7 "name: 🧪 Webapp Unit Tests" .github/workflows/prod.docs.plus.yml shows needs: [triage]. back-validation appears only in the new comment.
Step 3. Prove build and deploy did not move
grep -c "needs.back-validation.result != 'failure'" .github/workflows/prod.docs.plus.yml # expect 0
grep -n "back-validation" .github/workflows/prod.docs.plus.ymlThe second command lists only: the back-validation: job key, the build needs entry, the build if clause (line 374 at the pinned commit), the two new comments, and the report job's needs entry (back-validation,) from #556. Any other line: stop and comment here.
In git diff -U0 -- .github/workflows/prod.docs.plus.yml, every hunk of this issue sits inside extension-tests or webapp-unit-tests. A hunk from another set B issue, for example #560 in the deploy step 🏗️ Build Docker Images, is not yours. Leave it. Undo only a hunk you made outside those two jobs.
Step 4. Update .github/WORKFLOWS.md
-
Line 62: replace
canonical execution order is fixedwiththe canonical order is fixed. -
Rows 81, 82 and 84: replace each row with the row below it.
| `(build): back front observability uptime-kuma` | ✅ | ✅ | ✅ | ✅ | back → front → app → obs → uk | | `(build): back front observability uptime-kuma` | ✅ | ✅ | ✅ | ✅ | back + front → app → obs → uk | | `(build): back front` | ✅ | ✅ | ⏭️ | ⏭️ | back → front → app | | `(build): back front` | ✅ | ✅ | ⏭️ | ⏭️ | back + front → app | | `(build): front uptime-kuma` | ⏭️ | ✅ | ⏭️ | ✅ | front → app → uk | | `(build): front uptime-kuma` | ✅ | ✅ | ⏭️ | ✅ | back + front → app → uk |
-
After the table, insert this paragraph and a blank line before the line that starts with
`workflow_dispatch` with `force_deploy=true`:`back + front` means the two validations run at the same time. Build Verification and the app deploy wait for both. Every app deploy runs Back-val, because the deploy runs the migration and rolls all three backend services.
If bunx prettier --check .github/WORKFLOWS.md fails, run bunx prettier --write .github/WORKFLOWS.md and re-read the table.
Step 5. Lint the change
actionlint -config-file .github/actionlint.yaml .github/workflows/prod.docs.plus.yml
bunx prettier --check .github/WORKFLOWS.md .github/workflows/prod.docs.plus.ymlBoth must exit 0, as at the pinned commit (actionlint 1.7.12). bash .github/scripts/parse-build-trigger.test.sh is not required.
Review checkpoint
Show git diff -- .github/workflows/prod.docs.plus.yml .github/WORKFLOWS.md and the output of Steps 3 and 5, then stop. Commit and push per SP2 (#554), as its own commit. It takes effect on the next run, with no (build): deploy and no host step.
Acceptance criteria
-
extension-testshasneeds: [triage, changes], with noback-validationandalways()kept. -
webapp-unit-testshasneeds: [triage], with noback-validationandalways()kept. -
grep -c "needs.back-validation.result != 'failure'" .github/workflows/prod.docs.plus.ymlprints0. - The
buildjob'sneedslist andifblock are unchanged. -
actionlint -config-file .github/actionlint.yaml .github/workflows/prod.docs.plus.ymlexits 0. -
bunx prettier --check .github/WORKFLOWS.md .github/workflows/prod.docs.plus.ymlexits 0. -
.github/WORKFLOWS.mdline 62 and rows 81, 82 and 84 match Step 4. A new paragraph explainsback + front. - On the dry-run dispatch,
ext_waitandunit_waitare each 15 s or less. All six Ext suites run, and no deploy job runs. - On the first
(build):deploy after the push,unit_waitis 15 s or less, and so isext_waitif an Ext suite ran. - The next Sunday cron run starts all six Ext suites.
- A
Measured, <date>comment exists on this issue, per SP3 ([Tracking] Faster, change-aware CI/CD pipeline #554).
Verification
Offsets command. Save it outside the repo as offsets.sh, and run bash offsets.sh <run id>. It is read-only. Metric definitions (M1, M2g, M2i, M3, M4, M5, W) are in #569.
RUN=${1:?run id}
gh run view "$RUN" --repo docs-plus/docs.plus --json jobs,createdAt > "${TMPDIR:-/tmp}/run-$RUN.json"
bun -e '
const d = await Bun.file(process.argv[1]).json();
const t0 = Date.parse(d.createdAt);
const off = (s) => (s && !s.startsWith("0001") ? Math.round((Date.parse(s) - t0) / 1000) : null);
const ok = d.jobs.filter((j) => j.conclusion === "success");
const end = (re) => Math.max(...ok.filter((j) => re.test(j.name)).map((j) => off(j.completedAt)));
const start = (re) => Math.min(...ok.filter((j) => re.test(j.name)).map((j) => off(j.startedAt)));
const steps = d.jobs.flatMap((j) => j.steps ?? []);
const row = {
triage_end: end(/Triage build trigger/),
changes_end: end(/Detect Changes/),
backval_end: end(/^🔧 Backend Validation/),
ext_start: start(/^🧪 Ext \(/),
unit_start: start(/Webapp Unit Tests/),
build_start: start(/Build Verification/),
m2g: end(/Build Verification/),
m1: off(steps.find((s) => /Verify Deployment/.test(s.name))?.completedAt),
};
const ev = ok.filter((j) => !/Deploy/.test(j.name))
.flatMap((j) => [[off(j.startedAt), 1], [off(j.completedAt), -1]]).sort((a, b) => a[0] - b[0] || a[1] - b[1]);
let cur = 0; row.peak_hosted = 0;
for (const [, k] of ev) { cur += k; row.peak_hosted = Math.max(row.peak_hosted, cur); }
row.ext_wait = row.ext_start - row.changes_end;
row.unit_wait = row.unit_start - row.triage_end;
console.log(JSON.stringify(row));
' "${TMPDIR:-/tmp}/run-$RUN.json"A null field means that job did not end success. On run 39398067267 it prints ext_wait 122, unit_wait 132, m2g 538, m1 1132 and peak_hosted 7: the "before" shape.
1. Dry-run dispatch (the maintainer, after the push). Run SP1 (#554). A push cancels every job of an older run that has not started yet (#554, SP1). Then:
gh workflow run prod.docs.plus.yml --repo docs-plus/docs.plus --ref main -f dry_run_subject='(build): back front'FORCE_ALLruns all six Ext suites,has_frontruns webapp unit, andback-validationruns with E2E.force_deployis false, so no deploy job runs.- Expect
ext_wait≤ 15 s,unit_wait≤ 15 s,build_start≥backval_end,peak_hostedabout 12, and🚀 Deploy Productionskipped. prod.docs.plus.ymlis not in.github/filters/extensions.yaml, so the push of this change shows onlyunit_wait. A push that also changes.github/actions/setup-bun/**or.github/actions/setup-cypress/**runs all six Ext suites, and counts as a measurement point.
2. Post-merge measurement. Read deploys after set B lands and before #565 lands. Slice by "Ext suite ran" and by cache class. Record per SP3 (#554), with these rows:
| Metric | Read from | Baseline | Expected |
|---|---|---|---|
ext_wait |
first (build): deploy with an Ext suite |
116–141 s (5 runs) | ≤ 15 s |
unit_wait |
first (build): deploy |
122–165 s (14 runs) | ≤ 15 s |
| M2g, Ext suite ran | same deploy | median 538 s (486–664, n=5) | about 400–425 s |
| M2g, no Ext suite | first (build): deploy with no Ext suite |
median 379 s (321–454, n=9) | about 303–344 s |
| M2g, all | both | median 414 s (n=14) | about 350 s |
| M1 | both | median 1090 s, p90 1386 s (n=14) | about 850–950 s for set B together (computed) |
| M2i | both | moves with M1 before #565 | moves by the same seconds as M2g, plus the M3 change from other set B items |
| M3, M4, M5, W | both | M3 median 546 s, M5 57–70 s, W 2–3 s | no change from this issue |
peak_hosted |
both | 6–7 | about 12–13 with six Ext suites |
ext_wait, M6 |
first PR after the push | ext_wait 49–81 s; M6 median 519 s (n=10) |
ext_wait ≤ 15 s; M6 lower |
M1 and M2g also move with the other set B items. Only ext_wait and unit_wait isolate this issue. The final result comes from #569.
Accountability
- Owner: the builder. Reviewer: the maintainer.
- The maintainer runs the dry-run dispatch. The builder runs
offsets.shon it, on the first(build):deploy with an Ext suite, and on the first without one. - After the next Sunday cron, the builder confirms that all six Ext suites started.
- The SP3 comment lists each run id, its
offsets.shJSON line, and "pass" or "fail" for each Acceptance item.
Rollback
Revert per SP4 (#554) when any stop condition fires. The revert takes effect on the next run. It needs no (build): deploy, no host step and no GitHub setting change.
Stop conditions:
-
Backend failed, but the gate went on. A
🔧 Backend Validation / …job endedfailure, and🏗️ Build Verificationor🚀 Deploy Productiondid not endskipped. Leave out aworkflow_dispatchrun withskip_quality_gates=true. Check with:gh run view <run id> --repo docs-plus/docs.plus --json jobs -q '.jobs[] | "\(.name)\t\(.conclusion)"'
-
The cron lost Ext suites. The Sunday
schedulerun lists fewer than six🧪 Ext (lines in the same command. -
Hosted runner queue. On two push runs in a row, an Ext or webapp unit job waited more than 60 s for a runner. The wait is
started_atminuscreated_at:gh api repos/docs-plus/docs.plus/actions/jobs/<job id> --jq '[.created_at, .started_at]'
GitHub creates the job when its needs end. On Ext job 118546569637,
created_atcame 1 s after🔧 Backend Validationended, and the wait was 2 s. Leave out a push run that overlapped a Dependabot PR burst.
Not a stop condition: Ext suites that run and fail on a run where the backend also failed. That is the intended cost.
Docs to update
.github/WORKFLOWS.md: line 62, truth table rows 81, 82 and 84, and the new paragraph (Step 4).- No CHANGELOG entry. This is a CI-only change.
Out of scope
build, itsneedsor itsif. Build Verification in parallel with the gates was rejected.deploy,back-validation,triage,changesand.github/workflows/backend-ci.yml.- Skipping
back-validationon(build): front(ruling 7). - Swapping
always()for!cancelled()in these two jobs. That is a separate behaviour change. - Change-scope gating (Run only the CI suites a pull request or push can affect #563), the
extension-teststimeout (Make CI failures reach Telegram: set the watchdog secrets, alert on red E2E pushes #557) and.github/filters/extensions.yaml(Stop extension README media from triggering extension test suites #562, Run only the CI suites a pull request or push can affect #563). - Tests. Step 3, actionlint and the dispatch check the workflow graph.
- Required status checks or branch protection. Runner hardening is Restrict the production self-hosted runner to main deploys #552.
- Any Dockerfile or compose file.
Read first
AGENTS.md§Test Policy and the "Review checkpoint" rule..github/workflows/prod.docs.plus.yml, lines 82–440 at the pinned commit (triage throughdeploy)..github/workflows/backend-ci.yml, to confirm it declares nooutputs..github/WORKFLOWS.md, sections "Deployment trigger grammar (production)" and "Truth table"..github/filters/extensions.yaml, to see why the push of this change runs no Ext suite..github/actionlint.yaml..cursor/skills/tech-writer/SKILL.md, section "Simplified English (house standard)", before you edit.github/WORKFLOWS.md.
Activity
HMarzban commentedon Oct 25, 2026
Built and committed on local main. Awaits the maintainer's final push.
Remaining gate: the push. The next production pipeline run then checks the new job order.
ci: start extension and webapp unit tests without waiting for backend…
HMarzban commentedon Nov 3, 2026
Status, 2026-11-03.
823600000is pushed and deployed on 2026-11-03. In run 41608014517,ext_waitis 2 s andunit_waitis 12 s. The limit is 15 s. Set B and #565 landed in one push, so no "before #565" sample exists.Left:
HMarzban commentedon Nov 3, 2026
Measured, 2026-11-03.
Sources: Run Report job 125827136949.
cached_installsfrom Build Images job 125822892492.offsets.shread the run JSON fromgh run view.offsets.shlines:(build):deploy, 6 Ext suites{"triage_end":16,"changes_end":27,"backval_end":155,"ext_start":29,"unit_start":28,"build_start":332,"m2g":496,"m1":598,"peak_hosted":12,"ext_wait":2,"unit_wait":12}(build):deploy, 6 Ext suites{"triage_end":8,"changes_end":16,"backval_end":144,"ext_start":19,"unit_start":19,"build_start":212,"m2g":348,"m1":633,"peak_hosted":12,"ext_wait":3,"unit_wait":11}(build):deploy, 6 Ext suites{"triage_end":8,"changes_end":17,"backval_end":133,"ext_start":19,"unit_start":19,"build_start":252,"m2g":403,"m1":670,"peak_hosted":12,"ext_wait":2,"unit_wait":11}{"triage_end":8,"changes_end":18,"backval_end":82,"ext_start":20,"unit_start":30,"build_start":266,"m2g":386,"m1":null,"peak_hosted":10,"ext_wait":2,"unit_wait":22}ext_waitpass; M6 386build_startis afterbackval_endin all three deploys. A backend failure still blocks the build.ext_wait68 and 33. Five PR runs and a deploy started together, so they waited for hosted runners.extension-testshasneeds: [triage, changes]and keepsalways(): pass.webapp-unit-testshas noback-validationand keepsalways(): pass. Its list is now[triage, changes], becauseabd852f92(Run only the CI suites a pull request or push can affect #563) addedchanges.back-validationgrep prints0: pass. Thebuildneeds list still holdsback-validation: pass.actionlintandprettier --check: pass.unit_wait12 andext_wait2: pass.Can close now: no — the maintainer's dry-run dispatch; the 2026-11-08 cron must start all six Ext suites; one
(build):deploy without an Ext suiteHMarzban commentedon Nov 10, 2026
Maintainer ruling, 2026-11-10
The "before #565" sample is waived. Answer: "waive it".
Set B and #565 landed in one push (run 41608014517). So no deploy exists that carries set B without #565. Ruling 16 on #554 asked for that sample. This ruling drops it.
The dry-run dispatch is approved too ("run it"). It runs on 2026-11-10, and its result follows here.
HMarzban commentedon Nov 10, 2026
Result, 2026-11-10. Dry-run dispatch 42778681880,
dry_run_subject='(build): front',force_deployfalse, on24f302ae0. Run SP1 printed0first. The run endedsuccess.🔎 Detect Changesat +22 s. The first Ext suite and🧪 Webapp Unit Testsboth started at +24 s.ext_waitis 2 s andunit_waitis 11 s. Each is 15 s or less.🧪 Ext (…)suites ran and passed. No deploy job ran:🧱 Build Images,🚀 Deploy Productionand🧹 Remove Unshipped Imageswere skipped.The dry-run dispatch acceptance item passes. The 2026-11-08 cron (run 42443026527) also started all six Ext suites, and all passed.
HMarzban commentedon Nov 10, 2026
Done, 2026-11-10. Maintainer ruling, 2026-11-10: close after a check of the full acceptance list. Every item passes.
maintoday:extension-testshasneeds: [triage, changes]and keepsalways().webapp-unit-testshas noback-validationand keepsalways(). Its list is[triage, changes], because Run only the CI suites a pull request or push can affect #563 addedchangeson purpose.back-validationresult grep prints0. Thebuildneeds list still holdsback-validation, so a backend failure still blocks the build.actionlintandprettier --checkpass.ext_wait2 s,unit_wait11 s, all six Ext suites ran, and no deploy job ran.(build):deploy (run 41608014517):unit_wait12 s andext_wait2 s.Measuredcomment exists.