Skip to content

[Tracking] Faster, change-aware CI/CD pipeline #554

Open

Description

@HMarzban

Summary

Baseline, 2026-09-22 to 2026-10-20. A (build): deploy reached production in a median of 1090 s (18.2 min), with a p90 of 1386 s (23.1 min). That covers 14 deploys from 2026-09-22 to 2026-10-20. A PR run took a median of 519 s.

After #565. M1 after: see #569 Measured 6812443811. Window 1 missed the 620 s target (ruling). #760 owns the M5 rise.

This tracker makes the pipeline start each piece of work as soon as its inputs exist. It skips work that a change cannot affect, and it reuses work from earlier runs. Every run reports its own timings.

Targets are computed from measured steps, not measured end to end. #569 measures the real result.

Where the time went (baseline, 2026-09-22 to 2026-10-20):

  • The gate path ends before 🚀 Deploy Production starts, at a median of 417 s.
  • Then 🏗️ Build Docker Images runs on the prod host for a median of 546 s.
  • The deploy tail, from 🔧 Ensure Infrastructure to 🩺 Verify Deployment, takes about 76 s. M5, the roll-out step alone, takes 57–70 s.

The image build reads no gate output, but it waits for every gate. Inside it:

Part of 🏗️ Build Docker Images Seconds
Backend build --no-cache call, run alone first 69–80
Two webapp bun install runs, never CACHED in 6 parsed deploys 144–182
Webapp next build, with "Collecting build traces" alone at 99–119 185–262

There is also one live safety bug. A failed image build rolls all five live services back, and the notice then says production is unchanged. #555 fixes it first.

Some runs showed 25–30 min in the GitHub UI. That extra time came from GitHub incident tails and manual re-runs, not from pipeline work. For example, run 39275929831 shows 1643 s, but production was live at +994 s.

Benchmark

Tracker ledger. Each child owns its own Benchmark section. A row is "done" when the child closes with its after value posted. #796 holds every before and after number; this table keeps child, metric and status only. Reads dated 2026-11-11 come from the GitHub API and job logs on that day.

Child Metric Status
#569 M1 time to live: run createdAt to the end of 🩺 Verify Deployment window 1 done, ruled a clear win 2026-11-12 (Measured); window 2 open; the issue closed in v2.3.6
#555 Rollback scope after a failed image build done, closed 2026-11-03
#556 Timing table in every run summary done, closed 2026-11-10
#557 Watchdog repo secrets set open: maintainer sets the secrets
#558 Start wait of the Ext suites and the webapp unit job (ext_wait, unit_wait) done, closed 2026-11-10
#559 Sum of the two webapp bun install steps per deploy open: hand check 3 and one bun run format
#560 Type-check phase in the Docker next build done, closed 2026-11-03
#561 active_caches_size_in_bytes done, closed 2026-11-11
#562 Ext suites started by a README media change open
#563 Suites run per PR or non-deploy push (M6) open
#564 free_gb after the prune done, closed 2026-11-09
#565 Image build waits for the gates (W) done, closed 2026-11-10
#566 Backend --no-cache A/B open
#567 Parallel image builds open; guard is SP5
#568 "Collecting build traces" window done, closed 2026-11-03: no go
#552 Runner restricted to main deploys open
#756 Used bytes on / outside the build cache, after the prune open, wave 3
#759 Cancel paths; M6 of an .agents/**-only change open, wave 4
#760 M5 roll-out step seconds; long retires open, wave 3
#794 bun run typecheck wall time, 15 workspaces open: the CI read (3) is left
#795 bun run check:ci wall time with the bun fmt gate open: the CI read (3) is left
Set F, ten items (Q1–Q9, Q11) per child not filed; not in v2.3.7 (see Set F)

Guard for every child that adds host build load (SP5): rest-api max event-loop lag per 🧱 Build Images window. Before, from a review read on 2026-11-11: median 187 ms, range 78–369 ms, n = 6 build windows (2026-11-09 to 2026-11-11). REST p95 and collab p95: posted in Measured, 2026-11-11. REST p95 window median 96 ms (82–99 ms). Collab p95 has data in 2 of 6 windows. Control lag median 89 ms (75–115 ms); the earlier review read gave 95 ms (66–114 ms).

Condition: GitHub-hosted gates, plus the image build on the old 4 vCPU, 16 GB production host. Every row names its host. The sample count restarts at the #747 cutover.

Claim: the #569 ruled sentence (ruling), in seconds. M1 after: see #569 Measured 6812443811. #796 holds the one copy of the claim; this tracker does not restate it.

Maintainer rulings

Ruled by the maintainer on 2026-10-20. The same text is posted as a Maintainer ruling, 2026-10-20 comment on this issue. Children cite these rules by number and do not copy them.

  1. The headline metric is time to live: from run createdAt until the 🩺 Verify Deployment step ends. Measure CI/CD time to live after the v2.3 work: 1090 s median before #569 owns every metric definition.
  2. The baseline is the last 30 days of (build): deploys, with the median and the p90. Results are split by "Ext suite ran" and by cache class, not by front / back+front.
  3. The final "after" result needs at least 8 successful attempt-1 deploys after Build the deploy images while the quality gates run #565 lands, or 30 days, whichever comes first. The median verdict is posted at 8. The p90 is judged at 10 or more. A set that lands mid-sample does not restart the count; each row is tagged with the later sets it contains.
  4. Controlled A/B deploys are allowed only for the backend --no-cache question (Measure whether the backend image build still needs --no-cache #566).
  5. Results live in each run's step summary and on these issues. There is no dashboard.
  6. "Smart" means all three: start early, skip what a change cannot affect, and reuse earlier work.
  7. Every deploy still runs the migration and rolls all three backend services. Nothing here skips the backend on a (build): front deploy.
  8. The Ext suites and the webapp unit job stop waiting for back-validation.
  9. PRs and non-deploy pushes run only the suites their change can affect. The weekly cron still runs everything.
  10. A docs-only push skips the app jobs.
  11. Building early is accepted, with a cleanup step.
  12. Building early does not wait for a runner limited to main. Runner hardening is Restrict the production self-hosted runner to main deploys #552.
  13. The early image job honours skip_quality_gates, as build does.
  14. The host size is known. It limits only Run the backend and webapp image builds at the same time, to cut the image build step #567.
  15. Landing order: Roll back only after the deploy has started rolling services #555 first, as its own commit. Then Prune Docker build cache toward a free-disk target and keep rollback images #564, because it is a disk-safety fix. Then the rest of set A (Write a timing table to every CI/CD run summary #556, Make CI failures reach Telegram: set the watchdog secrets, alert on red E2E pushes #557), then sets B and C, then Build the deploy images while the quality gates run #565, then set E, then Final. Within set E, Measure whether the backend image build still needs --no-cache #566 finishes before Run the backend and webapp image builds at the same time, to cut the image build step #567 merges.
  16. Each child's Decisions were ruled on 2026-10-20 as recommended. Each child states the chosen behaviour in its steps and has no open Decision.

Later rulings live in dated Maintainer ruling comments: 2026-10-24 (deploy reads wait for the final push), 2026-11-04 (milestone move), 2026-11-06 (Bun pin 1.4.4) and 2026-11-10 (Q1–Q11).

  • Milestone v2.3.7, moved 2026-11-14 at the v2.3.6 release audit. This replaces the v2.3.6 setting of 2026-11-11 and the 2026-11-04 move to v2.4.0.

Child issues, in order

Each line names its change set. Each issue is its own commit, unless the issue says otherwise. The landing order is ruling 15.

Set A: safety and measurement first

Set B: small, independent speed-ups

Set C: change-aware gating

Set D: overlap the image build

Set E: experiments on real deploys

Final

Close rule (2026-11-14): this tracker closes when these 12 children close: #552, #557, #559, #562, #563, #566, #567, #756, #759, #760, #794 and #795.

Not in v2.3.7. The Set F lines below are not filed and have no milestone. They are not part of the close rule.

Set F: accepted 2026-11-10 (ruling comment of 2026-11-10, Q1–Q11). Each line stays "not filed" until its builder starts it. Then the builder files it as its own child, or folds it into the named child, and links it here. Before work starts, each child records its before value from 5 current deploys, names its owner and states its stop condition.

Q10 is "Not yet". It is not a child.

Related, independent: #552 restricts the production self-hosted runner to main deploys. #756 owns host disk. #759 owns the cancelled-push path test. #760 owns the M5 rise.

Claim ledger: #796. It holds the one copy of each before and after number. Ledger rows here link to the child.

Savings do not add up. Once the images build during the gates, the critical path is the longer of the gate path and the image path, plus the deploy tail. A faster gate path then saves nothing on most runs.

Shared rules

These bind every child issue.

  • If a skip is not provable, run the job. Each of these means "run everything": an unmatched path, a shared config file, a missing diff base, a workflow_dispatch and the cron. So does anything under .github/, except Markdown files and .github/ISSUE_TEMPLATE/**.
  • Never move a safety property.
    • Production stays untouched until every gate has passed. Every step before 🔧 Ensure Infrastructure must leave the host's running services alone.
    • Rolling replace, rollback, the migration gate and the in-flight deploy protection keep their meaning.
  • No new platform: no registry, no new CI vendor and no metrics stack.
  • Judge Docker changes from the production build log only. Times do not transfer between a laptop and the amd64 host. Prove a cache-order change with a cache-hit check: two builds with the cache on, changing only one input. Never measure a cache fix under --no-cache.
  • Samples name their host. Move production to a new Debian 13 droplet #747 moves production to a new host. Measure CI/CD time to live after the v2.3 work: 1090 s median before #569 restarts its sample count at the cutover. After the cutover, the builder re-reads Host facts with the same read-only commands and dates the new table.
  • Count attempt 1 only. A gh run rerun keeps the run createdAt, so its M1 or M6 includes the wait since attempt 1. For n = 5, use 5 real runs or 5 empty commits. Never take n = 5 from reruns.
  • Settled Docker rules (AGENTS.md §Docker):
    • no --parallel on docker compose build;
    • no build-once-then-docker tag step;
    • no chown -R;
    • no copying node_modules between stages.

Shared procedures

Children link here by name, for example "#554, SP1". Each procedure has one home.

SP1. Live-run check, before any push or dispatch

A push or a dispatch on main joins the workflow-level -quality concurrency group, which sets cancel-in-progress: true (prod.docs.plus.yml:68-70, at 0b302b222).

  • The new run cancels every job of the older run that has not started yet.
  • A job that is already running under always() keeps running. In run 34223310158, 🚀 Deploy Production kept rolling and ended success, while run 34224526419 waited for it.
  • So a push can still cancel a deploy that has not started, or the jobs after it.
  • The images job has its own -images group with cancel-in-progress: false. A new push never cancels a running image build.

Run this, and push only when it prints 0:

gh run list --repo docs-plus/docs.plus --workflow prod.docs.plus.yml --branch main --limit 10 \
  --json status -q '[.[] | select(.status != "completed")] | length'

If it prints more than 0, wait for the run to end, then run it again.

SP2. Commit and push

  1. Work on main. Make one commit per issue, unless the issue says otherwise.
  2. Use a subject that does not start with (build):, unless the issue asks for a deploy. A deploy reads only the subject of the pushed tip commit.
  3. git push runs bun run check:ci through husky. Stop any Next development server of this checkout first, or the hook refuses the push. Never use --no-verify.
  4. Run SP1, then push.
  5. To deploy a change, push a tip commit whose subject starts with (build): and names the domains, for example (build): front back.

SP3. Record the result

After the first deploy that carries the change, post this comment on the child issue:

Measured, <YYYY-MM-DD>
Run: <run id>, attempt 1
On main: <child issues already landed>
M1 <s> | M2g <s> | M2i <s> | M3 <s> | M4 <s> | M5 <s> | W <s> | free_gb <n> | cached_installs <0-2>
host <old|new> | rest_p95 <ms> | ws_p95 <ms> | lag_max <ms>
Expected: <the child's expected value>
Verdict: keep, or revert (reason)

Read the values from the run's step summary (#556). Before #556 lands, read them from the run's job and step times, as #569 shows. cached_installs is never in the summary; read it from the BuildKit log, as #569 shows. The metrics are defined in #569.

The guard fields come from SP5. ws_p95 is the collab p95 that SP5 defines. Tick the child's box on #554 the same day the child closes.

SP4. Revert

Each child names its stop condition. When a stop condition fires:

  1. Run SP1.
  2. Run git revert <commit> for that child's commit only. Use a subject that does not start with (build):.
  3. Push it (SP2).
  4. If the change affected the deploy, push a (build): tip commit to deploy the revert.
  5. Post Reverted, <date> on the child issue, with the run id and the reason.

SP5. User-impact guard

Images build on the host that serves users. Any child that adds host build load runs this: #565, #567, Q2, Q6 and Q9. #567 uses SP5 as its guard and has no second rule. Owner: the agent in the repo drafts; the maintainer runs the Grafana reads. The vmstat 1 host read is the maintainer's, on the next (build): deploy; post the median st and wa on #567.

  1. In each 🧱 Build Images window, read per job. <W> is the window length in seconds:
    • max(max_over_time(nodejs_eventloop_lag_max_seconds{job="rest-api"}[<W>s]));
    • REST p95, window: histogram_quantile(0.95, sum by (le) (increase(http_request_duration_seconds_bucket{job="rest-api"}[<W>s]))). Recorded as a field (step 6);
    • collab p95, window: the same query on document_load_duration_seconds_bucket{job="hocuspocus-server"}. No WebSocket round-trip histogram exists, so this stands in for ws_p95;
    • recorded only: the peak of histogram_quantile(0.95, sum by (le) (rate(http_request_duration_seconds_bucket{job="rest-api"}[5m]))) over the window.
  2. Read the same clock window 24 h earlier, with no build, as the control.
  3. Use n >= 5 windows. Prometheus keeps 15 days, so post each before read as a Measured comment within that time.
  4. Stop and revert per SP4 if rest-api max lag is above 450 ms on 3 of 5 windows. This is the step 6 retune, ruled 2026-11-12.
  5. Store gauges, one rule for every child. Read queue_jobs{queue="store-documents",state="failed"}, sum(queue_jobs{queue="store-documents-dlq"}) and increase(document_store_rejections_total[30m]) before the build and 10 minutes after the deploy. Stop and revert per SP4 if any rises. The maintainer reads them in Grafana. Measure whether the backend image build still needs --no-cache #566 and Run the backend and webapp image builds at the same time, to cut the image build step #567 use this rule.
  6. Retune, ruled 2026-11-12. Stop only on rest-api max lag above 450 ms on 3 of 5 windows. REST p95 without probes and collab p95 are recorded as fields, not stop rules. Reason: two of six before windows read 368 and 369 ms, within 6 ms of the old 374 ms line.

SP6. Deploy-tail content check

Any child that changes M5, healthchecks, stop timing or roll order runs this on its first deploy. Ruling 7 rolls all three backend services on every deploy. M5 rose from 58–59 s to 93 s and 103 s on 2026-11-03. #760 owns the cause. The general content-safety checklist lives in #762; SP6 holds only the deploy-specific steps.

  1. The maintainer creates a scratch pad. Never type into /demo.
  2. Open the scratch pad in two browsers: desktop Chrome and phone Safari.
  3. Type in both through the whole roll window.
  4. After the deploy, open the scratch pad in a fresh private window with no local copy. Compare the full text with what was typed.
  5. Go offline in one browser, type, then go back online. The text must sync to the other browser.
  6. Confirm that failed store jobs and the dead-letter queue stay at 0.
  7. Record the result in the SP3 comment. Delete the scratch pad.
  8. On any missing word, stop. Keep the pad, revert per SP4, and post the counts.

SP6 applies only to the changes in its first line. #559, #566 and #657 change none of those, so they do not run it (review, 2026-11-16).

Host facts, 2026-10-20 (old host, before #564)

Read with read-only commands at 11:32 UTC on 2026-10-20, while that day's third deploy (run 39414945889) was building.

Fact Value
CPU and RAM 4 vCPUs, 16 GB RAM, 9.7 GB available during a build
Disk 158 GB, 27 GB free during a build (47 GB before that day's first deploy)
Docker Engine 29.1.3, Compose 5.0.0, buildx v0.30.1
Build cache 44.2 GB, 37.84 GB reclaimable

Disk is the binding limit:

  • The 24 h age prune freed 0 B on all three deploys of that day.
  • One build writes about 14 GB (47 GB free, then 33 GB, on 2026-10-20).
  • The hard guard aborts only below 10 GB.

Not doing

Amended 2026-11-06 (maintainer ruling): the Bun pin reads 1.4.4, after 72f08af7a (#650, #651).

Activity

  1. added this to the v2.3.0 milestone on Oct 20, 2026
  2. added
    enhancement
    Performance
    on Oct 20, 2026
  3. HMarzban commented on Oct 20, 2026

    @HMarzban
    CollaboratorAuthor

    Maintainer ruling, 2026-10-20

    The maintainer ruled on every open question in this tracker and its children, in chat on 2026-10-20. This comment is the record. The tracker body lists rulings 1–16. Each child now states the chosen behaviour in its steps.

    Tracker rulings

    1–14 as in the tracker body, with two updates:

    • Ruling 2: results split by "Ext suite ran" and by cache class, not by front / back+front.
    • Ruling 3: the final result needs at least 8 successful attempt-1 deploys after Build the deploy images while the quality gates run #565 lands, or 30 days, whichever comes first. The median verdict is posted at 8, and the p90 at 10 or more. A set that lands mid-sample does not restart the count; each row is tagged with the later sets it contains.
    1. Landing order: Roll back only after the deploy has started rolling services #555 first, as its own commit. Then Prune Docker build cache toward a free-disk target and keep rollback images #564, a disk-safety fix. Then the rest of set A, then sets B and C, then Build the deploy images while the quality gates run #565, then set E, then Final. Measure whether the backend image build still needs --no-cache #566 finishes before Run the backend and webapp image builds at the same time, to cut the image build step #567 merges.

    2. Every child Decision, as recommended:

    Issue Ruling
    #552 Use the runner hook, not a paid plan. Cover the stage runner too. Stay in log-only mode until all four uses pass. Allow workflow_dispatch from refs/heads/main only. Require SHA-pinned actions. Add "Restrict updates" to main safety, with the maintainer as the only bypass actor. Stop the stage runner until a dev branch exists.
    #555 Guard on ROLL_STARTED. Also fix the rollback tag (export DEPLOY_TAG="${PREVIOUS_TAG}"). Test B in a fork is the optional test. Land as its own commit at the front of set A.
    #556 Land in set A. No type label: print the subject and the Ext suite count. Keep always(). Also print load1.
    #557 Alerts go to the same chat as deploy failures. The watchdog warns; it does not fail. No alert on a hung chatroom suite.
    #558 Measure after set B and before #565, sliced as in ruling 2.
    #559 Land after #555, as its own commit in set B. No permanent sentry-cli check.
    #560 A skip_quality_gates dispatch keeps the Docker type check. Land after #555.
    #561 Pin Bun to 1.4.1. Delete the chatroom-e2e.yml override. No manual cache deletion. No single-saver job.
    #562 Exclude the whole extensions/*/assets/**. Add .github/filters/** to _shared. Land as its own non-deploy commit.
    #563 Accept the docs-only exclusions, with .md under any src/ counted as code. Type Check and Backend Validation start after 🔎 Detect Changes. Backend Validation stays off for pushes without (build):. Ext suites skip on docs-only. Keep .github/** in Shared, except Markdown and issue templates. Land after set B.
    #564 --reserved-space 15GB, --min-free-space 45GB, a 20 GB hard guard. Keep only this run's tag, PREVIOUS_TAG and in-use images. Land right after #555, before #565. Call docker buildx prune by name.
    #565 Own -images concurrency group. Cleanup rules as written. Lands after sets A to C and after #564 (ruling 15). One shared scripts/ci/prepare-deploy-env.sh. The cleanup job checks for a live run with curl on the host. No environment: production on images. Accept the sourcemap upload before the gates. No forced gate failure.
    #566 Drop --no-cache only when all three test conditions hold. Accept cached apt-get layers. Allow one extra dispatch. Run after #556 and before #567 merges. Remove the timing line after the test.
    #567 Finish #566 first. When one call fails, let the other finish. Thresholds as written. Compare within one cache class. Keep the load sampler.
    #568 Also print trace timing in Docker. Go at a saving of 30 s or more; keep at 20 s or more. Keep the trace upload.
    #569 Rulings 2 and 3 as above.
  4. HMarzban commented on Oct 24, 2026

    @HMarzban
    CollaboratorAuthor

    Maintainer ruling, 2026-10-24

    Deploy-based measurements wait for the maintainer's final push. During the v2.3.0 run, agents build and test each CI/CD child locally and commit it on local main. Every step that needs a real deploy, a dispatch or a run on origin runs after that push. So those children stay open past the run, marked "awaits the final push".

  5. HMarzban commented on Nov 3, 2026

    @HMarzban
    CollaboratorAuthor

    Status, 2026-11-03. Sets A to D are pushed and deployed on 2026-11-03 in run 41608014517. Its time to live (M1) is 598 s, against a 1090 s baseline median. One deploy is a read, not the #569 result.

    Left:

  6. HMarzban commented on Nov 3, 2026

    @HMarzban
    CollaboratorAuthor

    Status, 2026-11-03 (after the 1b05cb2 deploy).

    • Roll back only after the deploy has started rolling services #555 and Skip the duplicate type check inside the webapp Docker build #560 closed at 13:39Z. The body checklist still shows them unchecked.
    • Four (build): deploys now carry sets A to D: 41608014517, 41626334830, 41636667896 and 41677887088. Their M1 values are 598, 633, 670 and 616 s. The baseline median is 1090 s.
    • Dispatch 41669629388 also deployed 3298c7f83. It is not a benchmark sample (benchmark sample: no).
    • 🔧 Ensure Infrastructure took 0 s and 1 s on the two runs after the Traefik host fix.
    • M5 rose to 93 s and 103 s on those two runs, from 58–59 s before. The time is in the docker stop of old replicas. The cause is not known yet.

    Left:

  7. modified the milestones: v2.3.0, v2.4.0 on Nov 4, 2026
  8. HMarzban commented on Nov 4, 2026

    @HMarzban
    CollaboratorAuthor

    Maintainer ruling, 2026-11-04

    Moved from milestone v2.3.0 to milestone v2.4.0, from the v2.3.0 open-issue review. The tracker closes only after #569, which moves with set E.

    The issue stays open. Its remaining items are unchanged.

  9. HMarzban commented on Nov 6, 2026

    @HMarzban
    CollaboratorAuthor

    Maintainer ruling, 2026-11-06

    The acceptance list is amended in the issue body. Each changed line is marked with this date.

  10. modified the milestones: v2.4.0, v2.3.6 on Nov 9, 2026
  11. 1 remaining item

  12. HMarzban commented on Nov 10, 2026

    @HMarzban
    CollaboratorAuthor

    Maintainer ruling, 2026-11-10

    Answers to the ruling questions of the 2026-11-10 comment, quoted as given.

    • Q1, "yes". Build Verification starts after 🔎 Detect Changes, beside the gates. The deploy job takes over the "every gate passed" check, and Measure CI/CD time to live after the v2.3 work: 1090 s median before #569's M2g is redefined. This overturns "Build Verification in parallel with the gates" in Not doing.
    • Q2, "yes". One dependency-ordered bun run --filter call builds the extensions, as a trial. Keep it only if the webapp image build saves 12 s or more. This overturns "one RUN for the extension builds" in Not doing.
    • Q3, "yes". The webapp builder stage starts from build-extensions and reuses its install. Update AGENTS.md §Docker, the Dockerfile comments and Cut the webapp image installs from 158 s to about 25 s per deploy #559's Target in the same change.
    • Q4, "yes". A cache-prune job runs after the deploy. The inline prune stays, and so does the 20 GB guard.
    • Q5, "no". The webapp healthcheck stays as it is, under the Settled HEALTHCHECK rule. The other four services may still get start_interval: 1s, which needs no ruling.
    • Q6: "go straight to latest stable node, but before do this, if Bun can do all of those steps and process, let's complitly migrate to bun, this is important." So:
      1. First test whether Bun alone can run every step of the webapp and admin image builds, with no nodejs in the image. Compare the route table, the .nft.json file lists, the standalone tree, the build time and the peak memory with today's build.
      2. If Bun can run every step, move those images to Bun completely.
      3. Only if a step needs Node, use the latest stable Node release, pinned to an exact version, not Node 24. Record it as an exception to "one Docker base tag".
      4. List every other place where Node still runs (Cypress, Jest, GitHub's own actions), and say whether Bun can replace it. That list is a follow-up.
    • Q7, "yes". Skip Next's own type check in Build Verification and in local build:ci. A skip_quality_gates dispatch keeps it, as Skip the duplicate type check inside the webapp Docker build #560 ruled. This reverses Skip the duplicate type check inside the webapp Docker build #560's stated scope. Revisit it if Benchmark bun check against tsc in every workspace #654 moves the gate to bun check.
    • Q8, "yes". A Dependabot production group takes the minor and patch bumps. The pinned packages stay out of it, and Hocuspocus majors are ignored.
    • Q9, "yes". Try webpackBuildWorker and parallelServerBuildTraces. Keep them only if Run the backend and webapp image builds at the same time, to cut the image build step #567's sampler shows at least 2048 MB free at the lowest point, a swap rise of 512 MB or less, no restarts and no exit 137. Otherwise revert the two lines.
    • Q10: the answer follows in a separate comment.
    • Q11, "yes". The cheap check:ci gates run through a pool of 4. CHECK_CI_SERIAL=1 runs them one at a time again.

    When the build starts, each accepted item becomes its own child of this tracker, or joins an existing child.

  13. HMarzban commented on Nov 10, 2026

    @HMarzban
    CollaboratorAuthor

    Maintainer ruling, 2026-11-10

    Q10, "Not yet". The deploy images keep building on the production host. Revisit a hosted build, passed as an Actions artifact with no registry, after #567 and #569, and only if the median image build still finishes more than 60 s after the gates. "Build on hosted runners" stays in Not doing until then.

    With this answer, every question of the 2026-11-07 review is ruled.

  14. HMarzban commented on Nov 11, 2026

    @HMarzban
    CollaboratorAuthor

    Measured, 2026-11-10: image builds on the production host

    These numbers are for the "Not doing" item "Build on hosted runners and push to GHCR, for now". The ruling stands. Nothing here asks to reopen it yet.

    • The trace step is slow on the host. On 4 deploys of 2026-11-09, Collecting build traces to the route table took 151.7, 155.4, 163.2 and 197.0 s on the host. The hosted Build Verification of the same commits took 29.9, 44.9, 51.3 and 47.4 s, so the host is 3.18 to 5.07 times slower. The window was 99.3 to 118.6 s before 2026-11-03 (Measure and trim the Next.js build-trace step in the webapp build #568). Nobody has measured why.
    • Build Images runs a median of 464 s per deploy on the 4 vCPU host that serves users.
    • Other fixed costs per deploy: the disk-guard prune (median 34 s), fixed sleeps (28 s), and the audit's install (median 17 s).

    Before anyone revisits the ruling, take two cheap reads:

    1. User impact. In Grafana, compare REST and WebSocket p95 and event-loop lag in the 14 build windows with the same hours on other days. If users see no change, the case for hosted builds is time to live only.
    2. Trace cause. During one deploy, run vmstat 1 on the host through the trace window. Read CPU steal (st) and I/O wait (wa).

    No child issue is filed for this.

  15. HMarzban commented on Nov 11, 2026

    @HMarzban
    CollaboratorAuthor

    Status, 2026-11-11

    Milestone. This tracker stays in v2.3.6, the benchmark milestone, by maintainer ruling on 2026-11-11. That replaces the 2026-11-04 ruling that moved it to v2.4.0. Nothing else in the 2026-11-04 ruling changes: the tracker closes only after #569.

    Note on the 2026-10-20 ruling comment. The body is current. In ruling 16, the #561 row says "Pin Bun to 1.4.1". The 2026-11-06 ruling superseded it. The pin is 1.4.4 (72f08af7a, #650).

    Body changes today:

    Owners for the two reads in the 2026-11-11 Measured comment:

    1. User impact: this is SP5. The maintainer reads REST p95 and collab p95 for the build windows and their 24 h controls. Do it by 2026-11-14, before the windows leave the 15-day store. The rest-api lag before is already in the ledger. It is a median of 187 ms (range 78–369 ms, n = 6 build windows, 2026-11-09 to 2026-11-11). The control median is 95 ms.
    2. Trace cause: the builder, on the next (build): deploy. Run vmstat 1 on the host through the trace window. Post the median st and wa. If Q9 folds into Run the backend and webapp image builds at the same time, to cut the image build step #567, post this read on Run the backend and webapp image builds at the same time, to cut the image build step #567.
  16. HMarzban commented on Nov 11, 2026

    @HMarzban
    CollaboratorAuthor

    Measured, 2026-11-11. SP5 before read: rest-api max event-loop lag, REST p95 and collab p95, in one read.

    Windows

    Each window is the 🧱 Build Images job of a (build): push run of prod.docs.plus.yml, from job start to job end (gh run view <id> --json jobs). The control is the same clock window 24 h earlier. No build ran in any control window. The primary set is the 6 windows of the earlier lag read (2026-11-09 to 2026-11-11). The 9 older windows (2026-11-03 to 2026-11-07) are still in the 15-day store, so they are below as extra rows.

    Queries

    Prometheus instant queries at the window end. <W> is the window length in seconds (390 s to 533 s).

    • Max lag: max(max_over_time(nodejs_eventloop_lag_max_seconds{job="rest-api"}[<W>s]))
    • REST p95, window: histogram_quantile(0.95, sum by (le) (increase(http_request_duration_seconds_bucket{job="rest-api"}[<W>s])))
    • REST p95, peak of the SP5 query: max_over_time((histogram_quantile(0.95, sum by (le) (rate(http_request_duration_seconds_bucket{job="rest-api"}[5m]))))[<W>s:15s])
    • Collab p95, window: the REST window query on document_load_duration_seconds_bucket{job="hocuspocus-server"}
    • Collab loads: sum(increase(document_load_duration_seconds_count{job="hocuspocus-server"}[<W>s]))

    The window p95 is the number the stop rule compares. It gives one value per window and uses every request in it. The peak column reads the SP5 query as written. Its first point also covers the 5 min before the build.

    Result, 6 windows (2026-11-09 to 2026-11-11)

    Run Window (UTC) Max lag, build / control (ms) REST p95, build / control (ms) REST vs control REST p95 peak, build / control (ms) Collab p95, build / control (ms) Collab loads, build / control
    42582921035 11-09 08:01:27–08:09:23 166 / 75 99 / 93 +7 % 145 / 93 no data / 98 0 / 1.1
    42603950298 11-09 10:49:26–10:56:54 368 / 93 98 / 95 +4 % 122 / 96 no data / no data 0 / 0
    42643542728 11-09 15:24:18–15:33:09 369 / 90 97 / 94 +3 % 98 / 95 242 / 242 2.2 / 1.0
    42656885466 11-09 16:39:35–16:47:17 114 / 83 94 / 319 -71 % 95 / 420 no data / 487 0 / 1.1
    42689997917 11-09 20:08:45–20:15:34 78 / 88 92 / 93 -2 % 92 / 94 no data / no data 0 / 0
    43008200172 11-11 11:00:11–11:07:13 208 / 115 82 / 98 -16 % 88 / 100 24 / 242 5.4 / 1.1

    n = 6.

    Read Build Control
    Max lag median 187 ms, range 78–368 ms median 89 ms, range 75–115 ms
    REST p95, window median 96 ms, range 82–99 ms median 95 ms, range 93–319 ms
    Collab p95, window data in 2 of 6 windows (24 ms, 242 ms) data in 4 of 6 windows
    • The lag values match the earlier read: median 187 ms, range 78–369 ms. The control median differs. The earlier read gave 95 ms (66–114 ms); this read gives 89 ms (75–115 ms).
    • Health probes and /metrics make up 84–100 % of rest-api requests in these windows. Other routes give 0 to 63 requests a window. So REST p95 mostly measures probe latency. Without probes, the window p95 is 10–242 ms on the build side and has no data in one control.
    • The REST p95 sits in the 50–100 ms bucket. A 10 % change (about 9 ms) is a move inside one bucket.
    • hocuspocus-server logs 0 to 5 document loads in a build window. Its p95 is a bucket estimate from those few loads.

    Extra rows, 9 windows (2026-11-03 to 2026-11-07)

    Run Window (UTC) Max lag, build / control (ms) REST p95, build / control (ms) REST vs control Collab loads, build / control
    41608014517 11-03 09:05:01–09:12:46 195 / 84 98 / 96 +2 % 3.1 / 0
    41626334830 11-03 11:18:21–11:25:46 101 / 69 93 / 231 -60 % 2.3 / 0
    41636667896 11-03 12:33:58–12:41:54 122 / 99 95 / 95 +1 % 0 / 0
    41677887088 11-03 16:49:02–16:55:32 173 / 94 94 / 95 -1 % 0 / 0
    41699693689 11-03 19:05:00–19:11:56 67 / 116 93 / 94 -1 % 0 / 1.1
    41854096960 11-04 15:06:01–15:13:49 99 / 60 93 / 94 0 % 0 / 3.1
    41993501959 11-05 08:19:32–08:28:19 88 / 81 95 / 93 +2 % 0 / 0
    42344958557 11-07 05:59:21–06:08:14 98 / 90 93 / 92 +1 % 2.2 / 0
    42363595092 11-07 10:21:53–10:29:28 127 / 67 223 / 94 +138 % 0 / 0

    Max lag: build median 101 ms (67–195 ms), control median 84 ms (60–116 ms). REST p95: build median 94 ms (93–223 ms).

    What it means for the SP5 stop rule

    • REST p95 more than 10 % above control: 0 of 6 windows. In the older set, 1 of 9 (run 42363595092, +138 %).
    • Max lag above 374 ms: 0 of 6 windows. But 2 of 6 read 368 ms and 369 ms, within 6 ms of the line. Build noise alone can reach the line, so a child can trip 3 of 5 with no real change.
    • Collab p95 has no data in 4 of 6 build windows. It cannot act as a guard at this traffic. The rule does not use it today, so keep it as a recorded field only.
    • REST p95 is mostly probe latency, and the 10 % margin sits inside one histogram bucket. It can show a slow host. It cannot show a small change in user requests.

    Raw responses: 554-sp5-windows.json, 554-sp5-no-probes.json and 554-build-windows.json in the evidence folder.

  17. HMarzban commented on Nov 12, 2026

    @HMarzban
    CollaboratorAuthor

    Measured, 2026-11-11 (copy of #569)

    This is a copy of the #569 window 1 result, as #569 acceptance asks. Source: #569 Measured, 2026-11-11. Ruling: #569 Maintainer ruling, 2026-11-12. If the two differ, #569 wins. The ruling names #760 as the M5 owner, in place of "candidate #746" in the copied text.

    Setup: gates on GitHub-hosted ubuntu-latest; images and deploy on the 4-vCPU self-hosted production runner; window 2026-11-03 to 2026-11-07; Bun 1.4.4; n = 8.
    Window: 41608014517 (2026-11-03) to 42344958557 (2026-11-07). n = 8 qualifying deploys.
    Window 1b, for the p90 only: 41608014517 (2026-11-03) to 42582921035 (2026-11-09). n = 10 qualifying deploys.
    Left out: 41669629388 (A/B dispatch (#566); its Run Report prints benchmark sample: no; diff base only), 42443026527 (schedule run, window 1b only; its deploy job was skipped). For M6: 41608343253, 41608354341, 41626692066, 41637030759 (failed PR runs; Step 5.2 counts successful runs only).

    • FIRST_AFTER is the first (build): push that contains IMAGES_EARLY_SHA f8d391fa4, checked with git merge-base --is-ancestor. The 12 earlier (build): pushes do not contain it.
    • The day-30 cutoff is 2026-12-03T09:04:11Z, so it does not bind. No row is failed, cancelled, a re-run or a (build): back row.
    • Each qualifying row is attempt 1. Its Run Report prints benchmark sample: yes, so the report agrees with the sample rules.
    • No row comes after the Move production to a new Debian 13 droplet #747 host move. Move production to a new Debian 13 droplet #747 is open.
    • Bun 1.4.4 runs the scripts. CI Bun moved from 1.4.1 to 1.4.4 in 72f08af7a, from row 5 on.
    Run Date Ext suites M2g M2i W M4 M3 M5 M1 queue_s lock_changed ext_src_changed gap_h cached_installs obs db_region traefik_timeout free_gb load1 Class Later sets
    41608014517 11-03 6 496 509 9 7 445 59 598 10 yes yes 258.5 0 yes NYC1 no 60 1.40 cold #566 A/B only
    41626334830 11-03 6 348 480 8 2 435 59 633 3 yes yes 2.2 0 no NYC1 yes 45 0.12 cold #566 A/B only
    41636667896 11-03 6 403 522 7 29 439 58 670 2 yes no 1.3 0 no NYC1 yes 41 1.05 cold #566 A/B only
    41677887088 11-03 2 490 441 3 1 381 103 617 3 no yes 0.8 0 no NYC1 no 39 0.36 cold #566 A/B only
    41699693689 11-03 6 420 487 9 59 346 79 595 3 no yes 2.3 1 no NYC1 no 41 1.47 cold #566 A/B only; CI Bun 1.4.4 (72f08af7a); Bun check (16c59999b)
    41854096960 11-04 6 406 503 9 14 444 94 627 3 yes yes 20 0 no NYC1 no 39 0.79 cold #566 A/B only; CI Bun 1.4.4 (72f08af7a); Bun check (16c59999b)
    41993501959 11-05 6 396 558 9 62 457 127 714 2 yes yes 17.2 0 no NYC1 no 41 1.01 cold #566 A/B only; CI Bun 1.4.4 (72f08af7a); Bun check (16c59999b)
    42344958557 11-07 6 381 563 9 59 464 81 673 3 no yes 45.7 0 no NYC1 no 42 0.79 cold #566 A/B only; CI Bun 1.4.4 (72f08af7a); Bun check (16c59999b); Bun check never fails (d9bcd3d82)
    42363595092 11-07 6 409 489 8 39 407 95 613 3 yes no 4.4 0 yes NYC1 no 40 1.21 cold #566 A/B only; CI Bun 1.4.4 (72f08af7a); Bun check (16c59999b); Bun check never fails (d9bcd3d82)
    42582921035 11-09 6 344 515 8 60 407 59 604 3 no yes 45.7 0 yes NYC1 no 41 1.19 cold #566 A/B only; CI Bun 1.4.4 (72f08af7a); Bun check (16c59999b); Bun check never fails (d9bcd3d82)

    Window 1, bun stats.ts after-all.json --from 41608014517 --to 42344958557 --before before.json:

    Slice n M1 median M1 p90 M1 min–max M2 median M2g median M2i median W median M3 median Before min Clear win
    All 8 630 — (max 714) 595–714 515 405 506 9 442 777 yes
    Ext suite ran 8 630 — (max 714) 595–714 515 405 506 9 442 1052 yes
    No Ext suite 0 — — (max —) — — — — — — 777 —
    Warm 0 — — (max —) — — — — — — 777 —
    Cold 8 630 — (max 714) 595–714 515 405 506 9 442 971 yes

    Window 1b, the same call with --to 42582921035:

    Slice n M1 median M1 p90 M1 min–max M2 median M2g median M2i median W median M3 median Before min Clear win
    All 10 622 673 595–714 515 405 506 9 437 777 yes
    Ext suite ran 10 622 673 595–714 515 405 506 9 437 1052 yes
    No Ext suite 0 — — (max —) — — — — — — 777 —
    Warm 0 — — (max —) — — — — — — 777 —
    Cold 10 622 673 595–714 515 405 506 9 437 971 yes

    All slice without the traefik_timeout rows (41626334830 and 41636667896), from stats.ts on the same rows less those two:

    Window n M1 median M1 p90 M1 min–max Clear win (before min 777)
    1 (to 42344958557) 6 622 — (max 714) 595–714 yes
    1b (to 42582921035) 8 615 — (max 714) 595–714 yes

    Slice verdicts. A slice is a clear win when its after median is below its before minimum.

    • All: clear win. 630 is below 777 (n = 8).
    • Ext suite ran: clear win. 630 is below 1052 (n = 8).
    • Cold: clear win. 630 is below 971 (n = 8).
    • No Ext suite: no sample (n = 0). Every row ran Ext suites.
    • Warm: no sample (n = 0). Every row is cold: each has a bun.lock change, an extension change, or a gap above 24 h.
    • No slice has n from 1 to 4, so no slice is a hint.
    Target Before After Verdict
    M1 median ≤ 620 s (stretch 540 s, rows with set E) 1090 630 (n = 8, window 1). 622 (n = 6) without the traefik_timeout rows. Missed by 10 s. Also missed without the traefik_timeout rows. Stretch 540 s: not measured, because window 2 has not started.
    M1 p90 ≤ 720 s (n ≥ 10) 1386 673 (n = 10, window 1b) Met.
    M6 PR median lower 519 515 (386–603, n = 3) Hint only, n < 5. All 3 are Dependabot bun.lock PRs, and each ran 6 Ext suites. 0 of 3 PRs ran 0 Ext suites.
    M6 root docs-only push ≤ 120 s 217 no sample Not measured. No root docs-only push lies in the window. Every push in it is a (build): deploy.
    M5 record (missed stage if the after median is above 70 s) 59 (57–70, n = 14) 80 (58–127, n = 8). 88 (59–127, n = 6) without the traefik_timeout rows. Above 70 s, so a missed stage. The cause is unknown. The maintainer names the owning issue (candidate #746).

    Stage check against the Verification table, window 1 (n = 8):

    Metric Before After median (range) Expected after Verdict
    M2g 414 405 (348–496) at or below 414 met
    M2i 1006 (inside the deploy job) 506 (441–563) near or below M2g not met: 101 s above the M2g median
    M3 546 442 (346–464) lower met
    M4 0–72 22 (1–62) informational recorded
    M5 59 (57–70) 80 (58–127) missed stage above 70 s missed
    W 2–3 9 (3–9) 10 s or less met

    Missed stage: for the M1 median miss (630 against 620), two stages miss their expected values.

    • M2i, the long path. Its median is 506 s, against an M2g median of 405 s. M2i ends later than M2g on 7 of 8 rows.
    • M2i split. The images job starts at a median of 45 s. Its disk guard starts 4 s later. M4 then takes 22 s and M3 takes 442 s.
    • W is 9 s, so the prod runner did not queue the deploy.
    • The deploy job is 630 − 506 − 9 = 115 s from the medians. The median of per-row values is 120 s (80–147).
    • deploy job by db_region: NYC1 120 s (80–147, n = 8). London: no rows.
    • deploy job without the traefik_timeout rows: 108 s (80–147, n = 6).
    • M5, inside the deploy job, has a median of 80 s, above the 70 s limit. Its before median was 59 s.
    • Medians do not add up: 506 + 9 + 120 = 635, not 630. So no single stage holds the 10 s miss by itself.
    • The M1 p90 target is met, so it has no missed stage. Neither M6 row is a result, so neither names a stage.

    Stop condition: not met. The All median is 630 (limit 1090). Ext suite ran is 630 (limit 1354). Cold is 630 (limit 1132). No Ext suite and Warm have n = 0. The max M1 is 714 (limit 1510).

    Set E window (window 2): it starts at the first (build): push that contains the #567 commit. If #567 reverts, it starts at the #566 drop commit. It ends at the 5th qualifying deploy. It uses the same stats.ts call with --from and --to set to those runs. Only window 2 judges the 540 s stretch. Status on 2026-11-11: not started. #567 is not on main, and #566 has no drop commit. Rows after the #747 host move start a new sample.

    Method notes:

    • M1 source. M1 runs from the run created_at to the 🩺 Verify Deployment step completed_at, attempt 1 only. No gh run rerun data is used.
    • Second read. A separate REST read (attempts/1/jobs, and jobs?filter=all kept to attempt 1) gives the same M1 on all 24 rows. The difference is 0 s.
    • Step 0. Both dependency commits are on main: f8d391fa4 and cd96b8dfb. Each step name occurs once. No regex in bench.ts changed. Log retention is 90 days.
    • Step 2. The baseline reproduced to the second: 14 of 14 rows (182 fields) and 5 of 5 slices (35 cells). No log had expired, so no field was blocked.
    • Median sources. stats.ts prints M1, M2, M2g, M2i, W and M3. stage.ts gives M4, M5, the deploy job and the M6 PR median. m2i-split.ts gives the M2i split. Both helpers copy the stats.ts median code.
    • One comment, both verdicts. The acceptance box asks for the p90 in a second comment. The body and the 2026-11-11 status say one comment carries both. This draft follows the newer body text.
    • Two windows. The median verdict uses rows 1 to 8. The p90 verdict uses rows 1 to 10. The n = 10 median (622) is shown, but it is not the median verdict.
    • Later sets. Step 3.4 finds no parallel-compose and no build-traces trim. I also tagged the three pipeline commits that landed inside the window, per protocol item 4.
    • Run only the CI suites a pull request or push can affect #563. The issue is open, but its change abd852f92 is on main and in every row. So "Run only the CI suites a pull request or push can affect #563 is open" is not a reason for either M6 row.
    • Run 41677887088. M1 is 617 s, from the run created_at (16:48:07Z). The 2026-11-03 status gave 616 s, from the Run Report attempt line (16:48:08Z).
    • Run 41677887088, other fields. For the same reason, M2g is 490 and M2i is 441, not 489 and 440. Its diff base is dispatch 41669629388, as the sample rules require.
    • Correction, 2026-11-11. stats.ts on the first 6 rows prints 622. That confirms the correction: 622 s, not 621.5 s. The 2026-11-11 status comment already holds that paragraph.

    Claim: the All slice is a clear win (630 is below the before minimum of 777). The 620 s target is still missed, and the maintainer rules on the verdict.

    "A docs.plus production deploy now goes live in a median of 630 s, down from 1090 s (n = 14 before, 2026-09-22 to 2026-10-20; n = 8 after, 2026-11-03 to 2026-11-07)."

  18. HMarzban commented on Nov 12, 2026

    @HMarzban
    CollaboratorAuthor

    Correction, 2026-11-12 to Measured, 2026-11-11 (SP5 before read).

    • Max lag range. The summary table gives the build range as 78–368 ms. Its own row for run 42643542728 reads 369 ms. The right range is 78–369 ms. The median stays 187 ms.
    • Control of record. The control lag median is 89 ms (75–115 ms), from this read. The earlier review read gave 95 ms (66–114 ms). The body now uses 89 ms.
    • Run 43008200172. Tag it "London build, NYC1 control". The collab database moved to London on 2026-11-11. Its 24 h control window ran before the move.
    • Stop count. The max-lag stop count is 0 of 6 with or without that row. No verdict changes.

    The first comment stays as it is.

  19. HMarzban commented on Nov 12, 2026

    @HMarzban
    CollaboratorAuthor

    Maintainer ruling, 2026-11-12: SP5 retune

    SP5 stops only on rest-api max lag above 450 ms on 3 of 5 build windows. REST p95 without probes and collab p95 are recorded as fields, not stop rules. Reason: build noise alone read 368 and 369 ms against the old 374 ms line (Measured 6803253313). This applies before #567 Step 1b uses SP5.

  20. HMarzban commented on Nov 14, 2026

    @HMarzban
    CollaboratorAuthor

    Moved to v2.3.7 at the v2.3.6 release audit. Children #552, #557, #559, #562, #563, #566, #567, #756, #759, #760, #794 and #795 are still open. The tracker closes when every child closes.

  21. modified the milestones: v2.3.6, v2.3.7 on Nov 14, 2026
  22. HMarzban commented on Nov 16, 2026

    @HMarzban
    CollaboratorAuthor

    Review, 2026-11-16 (maintainer approved).

  23. HMarzban commented on Nov 17, 2026

    @HMarzban
    CollaboratorAuthor

    Measured format. The house format now lives in release-product §Measured comment format, with the §Content-safety checklist beside it. Use that section for every Measured comment (#762, ruling A).

  24. modified the milestones: v2.3.7, v2.4.0 on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DevOpsPerformanceenhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions