Repository navigation
Speed up the frontend build with Bun, parallel prerender and incremental builds - #1929
Merged
David Pine (IEvangelist) merged 10 commits intoOct 26, 2026
Merged
Conversation
Contributor
Frontend HTML artifact readyThe latest frontend build uploaded the This comment updates automatically when a new frontend build artifact is uploaded. |
David Pine (IEvangelist)
force-pushed
the
ievangelist-incremental-parallel-bun-build
branch
from
October 22, 2026 15:22
a18c440 to
3691237
Compare
…ntal builds Upgrade to Astro 7.4.1 and enable experimental.parallelPrerender (4 workers, override with ASPIRE_PRERENDER_WORKERS) and incrementalBuild. - API reference and glossary routes pass package names and indexes in props instead of whole documents, so worker-thread prop cloning stays cheap. - API reference and OG card routes return a cacheKey so unchanged pages are reused between builds. - Patch Astro 7.4.1 so imported SVG components don't break structured clone in the prerender worker. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 7fae752f-9a4b-40b9-afa8-fe291e54acb6
The legacy parity check compared every accumulated legacy item and member with JSON.stringify for each handle, so the test took about 34 s and hit Vitest's 30 s timeout. Run both comparisons once per module instead. The checked data is unchanged and the test now takes about 1.6 s. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 5b3c83c2-1729-4e35-863d-c38bc4e0b41f
Bun 1.4.3 replaces pnpm as the package manager and script runner. The production Astro build runs on the Bun runtime through bunx --bun astro build; the dev server, preview, Vitest, ESLint and Playwright stay on Node. - bun.lock is migrated from pnpm-lock.yaml (all four patches apply). - Overrides and patchedDependencies move into package.json, allowBuilds becomes trustedDependencies and the one-day release age gate moves to bunfig.toml. patches/README.md keeps the patch rationale that lived in pnpm-workspace.yaml comments. - Bun has no Node module hooks, so ec.config.mjs imports the starlight-plugin-icons TypeScript source natively instead of through tsx. - Update the scripts, Playwright configs, unit tests, the AppHost JavaScript resource and the StaticHost build hint. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 5b3c83c2-1729-4e35-863d-c38bc4e0b41f
- frontend-build, indexnow and update-integration-data install Bun with oven-sh/setup-bun (version read from package.json) and use bun install --frozen-lockfile and bun run. - The build job restores and saves node_modules/.astro with actions/cache so experimental.incrementalBuild can skip unchanged pages. The key hashes bun.lock, astro.config.mjs and the patches, adds the commit SHA so every run saves fresh state, and falls back to the newest matching entry. A summary step reports the restored key, exact hit and cache size. - Profiling builds still run Astro on Node because CPU profiles come from Node's inspector. - The CodeQL pipeline installs the pinned Bun version through npm, the dev container uses the Bun feature, and Dependabot tracks the bun ecosystem. bun.lock is excluded from the forbidden-words scan. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 5b3c83c2-1729-4e35-863d-c38bc4e0b41f
- Contributor guide: Bun replaces pnpm as the prerequisite, with a single bun install step and a note that other package managers don't use the repository's bun.lock or dependency patches. - Thanks page: drop the pnpm card and note on the existing Bun card that it also installs dependencies and builds this site. - Update CONTRIBUTING, CODESPACES, the Astro instructions, the repository agents and the skills to use bun run, bun install and bunx. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 5b3c83c2-1729-4e35-863d-c38bc4e0b41f
- Bun resolves import.meta.env to process.env, so starlight-links-validator read an undefined BASE_URL and crashed in astro:build:done. Set it in the Astro config; Node is unaffected because Vite already supplies it. - Restore the incremental build state on every run but save it only on pushes and when a PR build found nothing to restore, so each PR commit no longer writes another multi-hundred-megabyte cache entry. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 5b3c83c2-1729-4e35-863d-c38bc4e0b41f
The geo-dependent WCP consent banner can show on a CI runner. The test helper rejects it, WCP fires onConsentChanged, and Head.astro reloads the page. The reload seeds /api/live/ a second time, so the request-count assertions saw 2 instead of 1 (3 of 3 attempts on one tablet shard, and on unrelated docs branches). Abort the WCP script in this test, as other specs already do, so consent can't reload the page. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 5b3c83c2-1729-4e35-863d-c38bc4e0b41f
David Pine (IEvangelist)
force-pushed
the
ievangelist-incremental-parallel-bun-build
branch
from
October 23, 2026 15:33
3691237 to
f7ab722
Compare
The Frontend Build job is the heaviest step of the CI critical path. Run it on the larger runner now that microsoft/aspire.dev has access to the aspire-runners group (microsoft/github-operations#1993). The guard falls back to ubuntu-latest for forks, where the label does not exist. The other jobs stay on ubuntu-latest. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 5b3c83c2-1729-4e35-863d-c38bc4e0b41f
David Pine (IEvangelist)
marked this pull request as ready for review
October 23, 2026 17:58
David Pine (IEvangelist)
requested a review
from Aaron Powell (aaronpowell)
as a code owner
October 23, 2026 17:58
David Pine (IEvangelist)
enabled auto-merge (squash)
October 23, 2026 17:58
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The production runtime migration and experimental caching require human sign-off, particularly while internal deployment validation remains pending.
What changed in this PR
This PR accelerates aspire.dev’s static frontend build while keeping the separate hybrid API work out of scope.
Changes:
- Migrates frontend tooling to Bun while retaining Node for development and tests.
- Enables parallel prerendering and incremental caching, with smaller route props and an eight-core CI build runner.
- Updates contributor guidance and automation, speeds up route tests, and isolates a consent-related E2E flake.
| File | Description |
|---|---|
src/statichost/StaticHost/wwwroot/index.html |
Updates the placeholder’s build command. |
src/frontend/tests/unit/update-integrations.vitest.test.ts |
Updates automation assertions for Bun. |
src/frontend/tests/unit/twoslash-types-generator.vitest.test.ts |
Generalizes a package-manager comment. |
src/frontend/tests/unit/twoslash-blocks-audit.ts |
Updates the missing-declarations guidance. |
src/frontend/tests/unit/twoslash-audit-dedup.vitest.test.ts |
Matches the updated audit error. |
src/frontend/tests/unit/ts-api-route-catalog.vitest.test.ts |
Adapts props checks and removes repeated comparisons. |
src/frontend/tests/unit/contributor-list.vitest.test.ts |
Matches the Bun regeneration hint. |
src/frontend/tests/unit/build-performance.vitest.test.ts |
Adds cache workflow guards and Bun assertions. |
src/frontend/tests/unit/api-markdown.vitest.test.ts |
Resolves indexed member props in tests. |
src/frontend/tests/e2e/live-status.spec.ts |
Blocks consent-script reloads during request-count testing. |
src/frontend/src/utils/ts-modules.ts |
Adds module lookup by package name. |
src/frontend/src/utils/ts-api-routes.ts |
Adds indexed handle-method lookup. |
src/frontend/src/utils/packages.ts |
Adds package document lookup by name. |
src/frontend/src/utils/og-cache-key.ts |
Hashes social-card inputs and disk assets. |
src/frontend/src/utils/api-cache-key.ts |
Adds memoized API document cache keys. |
src/frontend/src/pages/reference/api/typescript/[module]/index.astro |
Caches module HTML by document hash. |
src/frontend/src/pages/reference/api/typescript/[module]/[item]/index.astro |
Reduces item props and adds caching. |
src/frontend/src/pages/reference/api/typescript/[module]/[item]/[member]/index.astro |
Uses indexed member props and caching. |
src/frontend/src/pages/reference/api/typescript/[module]/[item]/[member].md.ts |
Resolves indexed members for cached Markdown. |
src/frontend/src/pages/reference/api/typescript/[module]/[item].md.ts |
Loads module data separately and adds caching. |
src/frontend/src/pages/reference/api/typescript/[module].md.ts |
Caches module Markdown by document hash. |
src/frontend/src/pages/reference/api/csharp/[package]/index.astro |
Adds package HTML cache keys. |
src/frontend/src/pages/reference/api/csharp/[package]/[type]/index.astro |
Reduces type props and adds caching. |
src/frontend/src/pages/reference/api/csharp/[package]/[type]/[memberKind].md.ts |
Loads package data for cached member Markdown. |
src/frontend/src/pages/reference/api/csharp/[package]/[type]/[memberKind].astro |
Reduces member-page props and adds caching. |
src/frontend/src/pages/reference/api/csharp/[package]/[type].md.ts |
Reduces type Markdown props and adds caching. |
src/frontend/src/pages/reference/api/csharp/[package].md.ts |
Adds package Markdown cache keys. |
src/frontend/src/pages/og/[...slug].ts |
Attaches social-card cache keys. |
src/frontend/src/pages/hub/glossary/[term].astro |
Resolves glossary entries from lightweight identifiers. |
src/frontend/src/data/thanks-license-titles.ts |
Removes the unused pnpm license entry. |
src/frontend/src/content/docs/community/thanks.mdx |
Credits Bun’s build role and removes pnpm. |
src/frontend/src/content/docs/community/contributor-guide.mdx |
Documents Bun installation and commands. |
src/frontend/src/components/ContributorList.astro |
Updates the contributor-data regeneration hint. |
src/frontend/src/assets/icons/pnpm.svg |
Removes the unused pnpm icon. |
src/frontend/src/assets/icons/pnpm-light.svg |
Removes the unused light-theme pnpm icon. |
src/frontend/scripts/update-schemas.ts |
Updates command examples in comments. |
src/frontend/scripts/update-samples.ts |
Updates the branch-override command comment. |
src/frontend/scripts/update-release-contributors.ts |
Updates the usage comment. |
src/frontend/scripts/update-integration-data.ps1 |
Runs data automation through Bun. |
src/frontend/scripts/measure-build-output.mjs |
Fingerprints the Bun lockfile. |
src/frontend/scripts/indexnow.ts |
Updates the usage comment. |
src/frontend/scripts/check-data-files.mjs |
Uses Bun to generate missing data. |
src/frontend/scripts/build-static-host.mjs |
Builds StaticHost assets with Bun. |
src/frontend/pnpm-workspace.yaml |
Removes pnpm-specific configuration. |
src/frontend/playwright.config.mjs |
Uses Bun for local server preparation. |
src/frontend/playwright.api-markdown.config.mjs |
Uses Bun for Markdown test-server preparation. |
src/frontend/patches/README.md |
Records dependency patch purposes and maintenance. |
src/frontend/patches/[email protected] |
Makes SVG metadata transferable between prerender workers. |
src/frontend/package.json |
Migrates scripts, dependency policies, and patches to Bun. |
src/frontend/frontend.esproj |
Uses Bun for frontend publishing. |
src/frontend/ec.config.mjs |
Supports native TypeScript imports under Bun. |
src/frontend/bunfig.toml |
Adds a one-day dependency release-age gate. |
src/frontend/astro.config.mjs |
Enables build experiments and supplies Bun’s base URL fallback. |
src/apphost/Aspire.Dev.AppHost/AppHost.cs |
Configures the Vite resource to use Bun. |
package.json |
Delegates root commands through Bun. |
eng/pipelines/azure-pipelines-codeql.yml |
Installs pinned Bun and frontend dependencies. |
CONTRIBUTING.md |
Updates the local-development command reference. |
CODESPACES.md |
Updates setup and startup guidance. |
.gitignore |
Updates the package-manager comment. |
.github/workflows/update-integration-data.yml |
Sets up Bun for data updates. |
.github/workflows/indexnow.yml |
Migrates IndexNow setup and execution to Bun. |
.github/workflows/frontend-build.yml |
Adds Bun, incremental cache handling, and larger-runner selection. |
.github/instructions/astro.instructions.md |
Aligns development guidance with the runtime split. |
.github/github-app.yml |
Updates the local-build restriction’s command. |
.github/forbidden-words.json |
Excludes Bun lockfiles from prose checks. |
.github/dependabot.yml |
Switches dependency updates to the Bun ecosystem. |
.github/agents/release-verifier.agent.md |
Updates release-verification commands. |
.github/agents/community-toolkit-integration-doc-writer.agent.md |
Updates integration validation commands. |
.gitattributes |
Applies LF handling to Bun lockfiles. |
.editorconfig |
Applies lockfile formatting settings to Bun. |
.devcontainer/devcontainer.json |
Installs Bun and frontend dependencies. |
.agents/skills/whatsnew/SKILL.md |
Updates build restrictions and ingestion references. |
.agents/skills/whatsnew/references/05-polish.md |
Updates the ingestion command reference. |
.agents/skills/whatsnew/references/04-validate.md |
Updates local-build restriction references. |
.agents/skills/update-samples/SKILL.md |
Updates installation and sample-refresh commands. |
.agents/skills/update-integrations/SKILL.md |
Updates data-generation and validation commands. |
.agents/skills/twoslash-validator/SKILL.md |
Updates two-slash validation commands. |
.agents/skills/doc-writer/SKILL.md |
Updates development and integration-check commands. |
.agents/skills/doc-writer/references/testing-your-documentation.md |
Updates targeted testing examples. |
.agents/skills/doc-pr-reviewer/SKILL.md |
Updates server startup and cleanup references. |
.agents/skills/code-review/SKILL.md |
Updates frontend review commands. |
Review effort: Balanced
David Pine (IEvangelist)
disabled auto-merge
October 23, 2026 19:12
Eric Erhardt (eerhardt)
approved these changes
Oct 23, 2026
Update astro, rename its structured-clone patch to match the new version, and refresh bun.lock (astro, @astrojs/telemetry, @astrojs/markdown-satteri, @astrojs/prism). The patch applies unchanged because dist/core/build/prerender-worker.js is identical between 7.4.1 and 7.4.2. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 5b3c83c2-1729-4e35-863d-c38bc4e0b41f
Item routes passed the whole item through props, so parallel prerender workers rendered from a structured clone. Slug lookup is identity based, so a duplicate handle such as thing-thing-2 fell back to the unsuffixed slug and linked its methods under thing-thing. Pass the item index and read the item from the loaded document instead, as the member routes already do. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 5b3c83c2-1729-4e35-863d-c38bc4e0b41f
David Pine (IEvangelist)
deleted the
ievangelist-incremental-parallel-bun-build
branch
October 26, 2026 17:25
David Pine (IEvangelist)
added a commit
that referenced
this pull request
Oct 27, 2026
## Summary Pins `astro` back to 7.4.1 and its matching dependency set (`@astrojs/telemetry` 3.4.0, `@astrojs/markdown-satteri` 0.4.4, `@astrojs/prism` 4.1.0). This reverses only the "Bump astro to 7.4.2" step of #1929; everything else in that PR stays. The 7.4.2 set was published days ago and isn't yet available from every package mirror used to build the site, so a frozen install can fail to resolve it. The 7.4.1 set has been out long enough to resolve everywhere. - `src/frontend/package.json`: `astro` range and `patchedDependencies` key go back to 7.4.1. - `src/frontend/bun.lock`: the four packages above go back to their previous resolutions; nothing else in the lock changes. - `src/frontend/patches/[email protected]`: renamed from `[email protected]`, content unchanged. - `src/frontend/patches/README.md`: patch name updated. Dependabot can propose 7.4.2 again once it has aged. ## Third-party links and affiliations None. ## Validation - The diff is the exact reverse of the 7.4.2 bump, and it applied cleanly on top of current `main`. - The 987 registry packages in the resulting lock differ from `main` only in the four packages above. All 987 resolve from the package mirror used for downstream builds. - `bun install --frozen-lockfile` with Bun 1.4.3 passes, installs `[email protected]` and applies the patch. - The full site build runs in this PR's CI; I did not run a local site build. Co-authored-by: David Pine <[email protected]> Co-authored-by: Copilot App <[email protected]> Copilot-Session: 5b3c83c2-1729-4e35-863d-c38bc4e0b41f
David Pine (IEvangelist)
pushed a commit
that referenced
this pull request
Nov 5, 2026
## Summary Follow-up to #1929, carrying over the two items from the review of #1927 (now closed) that still apply to `main`. - **`@astrojs/markdown-remark` peer range:** Astro 7.4.1 declares `^7.3.0`, but the site's Markdown processor in `astro.config.mjs` was pinned to 7.2.1. This bumps it to 7.3.4, which also moves the direct dependency onto the same `@astrojs/internal-helpers` version as Astro (0.13.0). - **Second-build coverage:** nothing tested incremental reuse across builds. `tests/unit/incremental-build.vitest.test.ts` builds a small throwaway site several times with the real experimental flags, `api-cache-key.ts`, `og-cache-key.ts`, patched Astro and the Bun runtime. It checks: - unchanged inputs produce byte-identical output - a changed API document re-renders only its own HTML and Markdown routes - a changed OG renderer asset re-renders only social cards - a new deployment commit re-renders API pages but not social cards - a removed document is pruned from `dist` and the page cache - an imported SVG's image metadata crosses the worker boundary and still resolves on restored pages The test takes about 12s and needs `bun` on `PATH`, which the validation job already provides. `@astrojs/[email protected]` still depends on its own exact copy of `@astrojs/markdown-remark` 7.2.1, so two versions stay installed until `mdx` is updated. The lockfile change also moves the hoisted `acorn`, `source-map`, `remark-smartypants` and `@astrojs/prism` versions that the new `markdown-remark` needs; other consumers keep their previous versions nested. ## Third-party links and affiliations None. ## Validation - `bun run build:production`: passed, 32,203 pages built. - `bun run test:unit`: passed (1163 passed, 1 skipped). - `bun run lint`: passed. - `bun install --frozen-lockfile`: passed. - Confirmed the new test fails when it should, by temporarily removing the Astro worker patch (`DataCloneError`), dropping `og-image.png` from the OG key, and removing deployment metadata from the API key. - Not run: E2E tests, and the test on Linux or Windows. It has only run on macOS so far. Co-authored-by: Sébastien Ros <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Explores incremental builds, parallel prerender and Bun together, based on
main. Only the build changes are here; the hybrid API work stays in #1874, which targetsrelease/17.0. An earlier version of this branch targetedrelease/17.0and also shared contributor fetches across prerender workers.mainnow pre-generates contributor data (#1803), so that change is dropped.experimental.parallelPrerenderandincrementalBuild, pluscacheKeyrefactors for the glossary, API and OG routes) is the first commit, applied unchanged with his authorship kept. Whichever of Speed up site build with Astro 7.4 parallel prerender and incremental builds #1927 and this PR merges second rebases and drops it. This PR also fixes a quadratic comparison ints-api-route-catalog.vitest.test.ts(about 34 s down to about 1.6 s in a local run). Astro is then bumped to 7.4.2 (the structured-clone patch is renamed and applies unchanged), and the TypeScript item Markdown routes now take an item index instead of the whole item: parallel prerender workers get a structured clone, so a slug lookup by identity fell back to the unsuffixed slug for a duplicate handle such asthing-thing-2.bun.lockis migrated frompnpm-lock.yaml, and the pnpm workspace settings move topackage.json(overrides,patchedDependencies,trustedDependencies) andbunfig.toml(one-day release age gate). Thedevalueoverride from Update devalue dependency #1940 moves with them (devalue@<5.9.3resolves to 5.9.4).patches/README.mdkeeps the patch rationale that lived inpnpm-workspace.yamlcomments.bunx --bun astro build). Dev, preview, Vitest, ESLint and Playwright stay on Node. Two Bun differences are handled in config:ec.config.mjsimports thestarlight-plugin-iconsTypeScript source natively, because Bun has no Node module hooks, whichtsxneeds.astro.config.mjsdefaultsprocess.env.BASE_URLto/. Bun resolvesimport.meta.envtoprocess.env, andstarlight-links-validatorreadsimport.meta.env.BASE_URL, so without itastro:build:donecrashed withundefined is not an object (evaluating 'path.replace').frontend-build,indexnowandupdate-integration-datause the SHA-pinnedoven-sh/setup-bunaction (bun-version-filepoints atsrc/frontend/package.json), thenbun install --frozen-lockfile. The CodeQL ADO pipeline, dev container and Dependabot (bunecosystem) are converted too.frontend-build:node_modules/.astrois restored on every run (keyed onbun.lock,astro.config.mjsand the patches) so incremental builds can skip unchanged pages. It is saved only by push builds and by a PR build that found nothing to restore, so each PR commit doesn't write another entry against the 10 GB repo cache limit. The job summary reports the restored key, exact hit and size.Frontend Buildruns on the 8-core runner. Thebuildjob infrontend-build.ymluses8-core-ubuntu-latest(runner groupaspire-runners, granted to this repository in microsoft/github-operations#1993) when the repository owner ismicrosoft, andubuntu-latestotherwise, because forks can't use the label. The other jobs stay onubuntu-latest. With the same four prerender workers, the cold build step went from 731 s to 296 s and the job from 968 s to 417 s (see the timings below).a missing live API stays disabled across navigation and visibility changes until reloadtest inlive-status.spec.tsfailed on CI runners where the real WCP script shows its consent banner: the test helper rejects it, WCP reloads the page, and/api/live/is requested a second time. The test now aborts the WCP script, as other specs already do.bun installstep with a note (other package managers ignorebun.lockand the patches), and thepnpmcommands becamebun run ....CONTRIBUTING.md,CODESPACES.md, the agent instructions and the skills match, and the pnpm card is gone from the thanks page. The contributor data hint inContributorList.astro(and its unit test) now saysbun run update:contributors.Timings (four prerender workers throughout;
ubuntu-latestis 4 vCPU and 16 GB,8-core-ubuntu-latestis 8 vCPU and 32 GB). Themainrows are push builds ofmain, which has sequential prerender, Node and no cache:Frontend Buildjobmainpusha62b64bec(this PR's earlier base)ubuntu-latestmainpush6be625cd0(a fast runner)ubuntu-latestmainpush3120da6c3(a fast runner)ubuntu-latestubuntu-latestubuntu-latestubuntu-latest8-core-ubuntu-latest8-core-ubuntu-latest8-core-ubuntu-latestOn the 8-core runner the cold build step took 296 s against 731 s on
ubuntu-latestfor the same content and the same four workers, and the job 417 s against 968 s. That is more than the doubled vCPU count alone explains, and I didn't isolate why (the runner also has twice the memory). The cold artifact upload went from 171 s to 87 s and the cache save from 29 s to 6 s. The warm re-run on the 8-core runner took the same 297 s: prerender was 38 s faster, but Vite (38 s to 64 s) and Pagefind (43 s to 66 s) were each about 25 s slower, which looks like run-to-run noise in a single sample, and its artifact upload took 146 s. So on the larger runner the incremental cache gains little, while onubuntu-latest, which forks fall back to, it saved about 5 min. A second cold run on the 8-core runner, after the Astro 7.4.2 bump, took 386 s for the build step and 534 s for the job: prerender took the same time (3 m 49 s), but Vite (54 s), Pagefind (52 s) and the artifact upload (109 s) were each slower, so read the 8-core figures as a range (417 to 534 s for the job).Runner speed varies a lot, so a single run says little.
Frontend Buildonmaintook 15.6 to 27.0 min over its last 20 pushes (median 23.5 min), and the cold run onubuntu-latest(16 m 03 s) sits inside that spread, level withmain's two fastest pushes. The cold 8-core jobs (6 m 57 s and 8 m 54 s) are far below that spread. Prerender is the cleaner comparison onubuntu-latest: 9 m 36 s here against 11 m 36 s to 18 m 22 s onmain. The warm re-run onubuntu-latesttook 10 m 50 s.Prerender is the phase that moved; on
ubuntu-latestVite (about 70 s) and Pagefind (about 2 min over roughly 32k HTML files) don't change with parallelism or caching. On the 8-core runner the cold Astro build took 4 m 55 s (Vite 38 s, prerender 2 m 57 s, Pagefind 43 s). In the warm re-run onubuntu-latestthe Astro build took 7 m 17 s (Vite 1 m 10 s, prerender 3 m 27 s, Pagefind 2 m). It restored 48,685 of 57,144 routes from the cache (24,057 API reference pages, 24,094 reference.mdendpoints and 534 OG images) and re-rendered 8,459, 7,546 of them locale pages. Those routes have nocacheKeyand are the floor for a warm build. The cache entry is about 164 MB.mainhas no Astro cache entry yet, so the first push build after merge is cold and saves the entry that later PR builds restore. An earlier version of this branch, based onrelease/17.0, measured 447 s and 465 s for warm builds of new commits, so read the warm numbers as a range.The whole workflow gained less than the build job, because E2E dominates it now. Each of the six Playwright shards downloads the roughly 2.1 GB
frontend-distartifact (about 30 s to 13 min, depending on the run) and then runs Playwright for about 7 to 15 min, which this PR doesn't change. Onmainpushesci-gatetook 33.5 to 65.2 min over the last 20 (median 43.6 min). With the 8-core build the last shard finished about 37 min after the run started in attempt 1 (one shard spent 10 min installing Playwright Chromium) and about 28 min after in attempt 2, against about 33 and 38 min with theubuntu-latestbuild on the previous head. All of these are insidemain's existing range, because the faster build only moves the point where the shards start. Speeding up E2E (more workers per shard, a compressed E2E artifact, the 8-core runner for the shards) is left out of this PR because it can affect test reliability or, for the 8-core runner, multiply the larger-runner minutes.Risks to watch in CI
40014533725, cold) and on the previous one (run39981757109, cold and warm), including the E2E shards on the Bun-built output. If it misbehaves later, fall back to Node for Astro only: changebunx --bun astro buildtoastro buildin the threebuild*scripts andscripts/build-static-host.mjs.cacheKey, so they always re-render. That is the floor for a warm build.Frontend Buildnow depends on the sharedaspire-runnersgroup (granted in microsoft/github-operations#1993, and also used by microsoft/aspire). A job whose runner label can't be served waits in the queue, andtimeout-minutesonly counts once it runs. Over a 12 h sample of microsoft/aspire (748-core-ubuntu-latestjobs) the queue time had a median of 5 s, a 95th percentile of 9 s and a maximum of 116 s, so contention looks low, but the sample was small and mostly off-peak. To fall back, change theruns-online toubuntu-latest. Larger runners are billed per minute, including in public repositories.PUBLIC_GIT_COMMIT_ID(the merge base withorigin/main) is rendered into every page: the footer, the commit link and<meta name="git-commit-id">, and client-side navigation between pages with different IDs falls back to a full page load (deployment-guard.ts). From reading Astro 7.4's incremental build code, I expected the dependency hash to ignore.env-derived values, so a page restored from the cache could keep an older commit ID aftermainadvances. I tested that on a throwaway build: it restored a cache saved for a different commit and built with a newPUBLIC_GIT_COMMIT_ID, and all 32,200 built HTML pages carried the new ID (none kept the old one). Nothing is affected today either way: the CIfrontend-distonly feeds E2E and the internal build has no Astro cache. Repeat that check before using the cache in a build that gets deployed, or key the cache on the commit ID.tab-panel-N) depend on which worker renders a page. They stay unique within each page, so nothing breaks, but diffing two builds shows tab-id noise.frontend.esproj(bun run build), so it needs Bun on its agents. A companion internal PR (Azure DevOps 67205, intodeploy) installs the package manager thatpackage.jsonnames (pnpm whilemainstill pins it, Bun once this lands), so it can merge first. A throwaway run of the same install and publish steps on the same internal agent type passed (Bun install, parallel prerender, no drift in the committed.generatedoutput), but the companion PR itself hasn't run in the real pipeline yet.allowedDeprecatedVersions,peerDependencyRulesand the version-pinned release-age excludes. Bun'sminimumReleaseAgeExcludesmatches names only, and a locked install isn't age-gated.Third-party links and affiliations
pnpm-workspace.yamltopatches/README.md.bunnpm package (installed by the CodeQL ADO pipeline) and theghcr.io/devcontainers-extra/features/bun:1dev container feature are new third-party tooling.No material affiliation with these projects or organizations to disclose.
Validation
CI on the current head
f1a7ba038(run40014533725, withFrontend Buildon8-core-ubuntu-latest): every job passed on the first attempt with a cold Astro cache, includingFrontend validation(lint, then 81 test files with 1,103 tests passed and 1 skipped),AppHost Build,release-sync-tests, all six Playwright E2E shards (no test failed or needed a retry), the report merge andci-gate.On the previous head
5988e6ecd(before the Astro 7.4.2 bump and the item route fix), run39981757109also passed, withFrontend Buildon8-core-ubuntu-latest:Frontend validation(lint, then 80 test files with 1,094 tests passed and 1 skipped),AppHost Build,release-sync-tests, all six Playwright E2E shards, the report merge andci-gate. One E2E test passed only on its retry:mermaid-navigation.spec.tsMermaid stays centered and responsive after client navigation in dark modetimed out after 15 s on the tablet project while waiting for the Mermaid SVG to center. It polls client-side rendering, so it looks timing-sensitive on a loaded runner. It didn't retry in any of the last 14mainpush runs (84 shard logs), where other tests did in 4 of the 14 (twoslash-navigationandhomepage).ci-gate. No test failed or needed a retry.On an earlier head
369123798(before the rebase ontomainat1e4b28d3band the runner change), run39804194596onubuntu-latestalso passed. In attempt 1 (cold cache) only shardmobile-chromium1/2 failed, withArtifact download failed after 5 retriesbefore it ran any test, and attempt 2 (full re-run) passed every job. No test failed or needed a retry in either attempt.The E2E test fixed here (
live-status.spec.ts,a missing live API stays disabled across navigation and visibility changes until reload) had failed on tablet shard 2/2 of run39620067289(the original attempt and both retries) and on an unrelated docs PR's run (39344794778). The failing trace shows the WCP consent banner appearing, the test helper clicking Reject, and the page reloading, which requested/api/live/a second time. The test now blocks the WCP script. It passed on its first attempt on the desktop, tablet and mobile projects in both attempts on each head above, and in run39655383949on the earlier version of this branch. The banner depends on the runner's region, so a few green runs don't prove the fix; the check is that this test stays green across further runs.homepage.spec.tskeeps every dashboard screenshot loaded and fully contained in both themesis a separate known flake that passes on retry (it failed once and passed on retry in runs39655383949,39641836015and39513380035); it didn't appear in these runs.Local checks ran on the earlier,
release/17.0-based version of this branch with Bun 1.4.3 and Node 24. After the rebases ontomain,bunfig.toml,ec.config.mjs, thebuild*scripts andlive-status.spec.tsare identical, the Astro patch only moved to[email protected]with the same content,bun.lockdiffers by thedevalueoverride ported from #1940 and the Astro 7.4.2 bump,package.jsondiffers by those and by theupdate:contributorsscript thatmainadded in #1803, andfrontend-build.ymldiffers only by theruns-online, so those results still apply (CI repeats the install, lint and unit tests on the current head):bun install --frozen-lockfile: passed, lockfile unchanged.bun run lint: passed (exit 0).bun run test:unit: passed, including the workflow guard tests inbuild-performance.vitest.test.tsfor the cache restore and save steps. CI'sFrontend validationpassed the same tests on the rebased head.bunx --bun astro sync: passed.bunx --bun astro devprobe: a docs page, a twoslash page and an OG PNG all returned 200.starlight-links-validatorreproduced thepath.replacecrash without theBASE_URLdefault and returned the expected slug with it.astro dev(Node): with a stand-in WCP that requires consent, the unchanged test body failed atlive-status.spec.ts:83(Expected: 1, Received: 2, the CI failure), and with the abort line it passed. The changed spec then passed 15 of 15 (five repeats on each of the desktop, tablet and mobile projects).On the rebased head I also ran the
contributor-listandts-api-route-catalogunit tests with Node 24 (18 tests passed). The first rebase conflicted only in.agents/skills/update-integrations/SKILL.mdand.github/instructions/astro.instructions.md. The second one, ontomainat1e4b28d3b(#1940, adevaluebump), conflicted inpnpm-lock.yamlin the first commit (I kept its[email protected]entries, which[email protected]pins) and in the Bun migration commit, which deletespnpm-lock.yamlandpnpm-workspace.yaml. There I ported the override topackage.jsonandbun.lock, andbun install --lockfile-onlyreported no changes.Output check: on the previous head, I compared the
frontend-distartifact from this PR's cold build (run39804194596, attempt 1) with the one from themainpush build of the PR's earlier base (a62b64bec, sequential, Node). The later commits only change thedevalueoverride and theruns-online, and I didn't repeat the comparison:/_astro/reference in the HTML dangles.llms-full.txtandllms-small.txt(this PR's docs edits), andrss.xmland the Pagefind entry (hash and commit noise that also differs between two builds ofmain)._astro/that no page referenced are no longer emitted.Not run locally:
bun run build(a full site build is too heavy to run locally; CI covers it), the full Playwright E2E suite (CI ran it; locally only the deflaked test ran, againstastro dev) and the internal Azure DevOps pipelines.