Skip to content

Fixed the boot benchmark failing on a missing card asset manifest - #30004

Merged
vershwal merged 2 commits into
mainfrom
perf-job-build-assets
Aug 17, 2026
Merged

Fixed the boot benchmark failing on a missing card asset manifest#30004
vershwal merged 2 commits into
mainfrom
perf-job-build-assets

Conversation

@vershwal

Copy link
Copy Markdown
Member

job_perf-tests has been red on main since cbe73b1 (#29659) — e.g. this run:

InternalServerError: Could not use the card asset manifest at .../core/frontend/public/cards.manifest.json
  ENOENT: no such file or directory
  at CardAssets.readManifest (core/frontend/services/assets-minification/card-assets.js:69)

That commit moved card minification from request time to build time and made cards.manifest.json a hard boot requirement (it's constructed eagerly from core/bridge.js). The job only ran build:tsc, so the manifest never existed and boot exited 2, failing hyperfine.

Every other Ghost-booting job already gets the manifest: the test jobs through their nx dependsOn: ["build:assets", ...], the production-image benchmark through Dockerfile.production, and job_ghost-cli through the packed archive from job_pack. This job boots via raw node index.js, so there's no target to inherit it from — it has to build the assets itself.

pnpm --filter ghost run build:assets is the same invocation already used in job_pack and Dockerfile.production, rather than a narrower build:assets:cards, so the "make the tree bootable" step stays one greppable string across all three call sites.

Benchmark impact

The step is a separate run:, outside the measured command, so it isn't in the hyperfine sample.

Worth flagging for whoever reads the chart: the series has a gap since 17 Aug, and the first green run will likely show a small step up. That's real product behaviour from #29659 — a 53KB readFileSync + JSON.parse at boot, plus the content-based asset hashing default flip — not environment drift from this change.

Verification

Locally, on this branch:

  • pnpm --filter ghost run build:assets → writes cards.manifest.json at exactly the path card-assets.js reads (publicFilePath).
  • GHOST_CI_SHUTDOWN_AFTER_BOOT=1 node index.js → exit 0, "Ghost booted in 3.354s".
  • Same boot with the manifest removed → exit 2 with the identical ENOENT, matching CI.

No other job in ci.yml (or any other workflow) boots Ghost from source, so this is the only place that needed it.

no ref

- cbe73b1 moved card minification to build time and made
  cards.manifest.json a hard boot requirement, but job_perf-tests only ran
  build:tsc, so boot died with ENOENT and hyperfine exited 2
- the test jobs never hit this because their nx targets declare build:assets
  in dependsOn, and the production-image benchmark gets it from
  Dockerfile.production - this job boots via raw `node index.js`, so there is
  no target to inherit it from and it has to build the assets itself
- the step sits outside the measured command, so the boot-time series stays
  comparable with its history
@vershwal
vershwal requested a lite review from Copilot August 17, 2026 08:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@nx-cloud

nx-cloud Bot commented Aug 17, 2026

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 0a9d208

Command Status Duration Result
nx run @tryghost/admin:test:acceptance ✅ Succeeded 6m 36s View ↗
nx run ghost:test:integration ✅ Succeeded 3m 6s View ↗
nx run ghost:test:ci:integration ✅ Succeeded 5s View ↗
nx run ghost:test:legacy ✅ Succeeded 2m 48s View ↗
nx run ghost:test:e2e ✅ Succeeded 2m 37s View ↗
nx run @tryghost/koenig-lexical:test:acceptance ✅ Succeeded 1m 43s View ↗
nx run @tryghost/activitypub:test:acceptance ✅ Succeeded 44s View ↗
nx run-many -t build:tsc ✅ Succeeded 4s View ↗
Additional runs (9) ✅ Succeeded ... View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-08-17 08:34:28 UTC

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: QUIET

Plan: Pro Plus

Run ID: 7e43a5d3-e010-420a-a2e8-b64a432f6a47

📥 Commits

Reviewing files that changed from the base of the PR and between 0a9d208 and 4af18e2.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml
💤 Files with no reviewable changes (1)
  • .github/workflows/ci.yml

Included review availability: Your plan includes up to 10 reviews per rolling hour; 8 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (18)
  • GitHub Check: Trigger Pro CD
  • GitHub Check: E2E Tests (Analytics 1/2)
  • GitHub Check: E2E Tests (Main 4/10)
  • GitHub Check: E2E Tests (Main 8/10)
  • GitHub Check: E2E Tests (Main 1/10)
  • GitHub Check: E2E Tests (Main 9/10)
  • GitHub Check: E2E Tests (Main 10/10)
  • GitHub Check: E2E Tests (Main 3/10)
  • GitHub Check: E2E Tests (Main 2/10)
  • GitHub Check: E2E Tests (Main 7/10)
  • GitHub Check: E2E Tests (Analytics 2/2)
  • GitHub Check: E2E Tests (Main 5/10)
  • GitHub Check: E2E Tests (Main 6/10)
  • GitHub Check: Performance tests (production image)
  • GitHub Check: Ghost-CLI tests
  • GitHub Check: App Playwright Acceptance Tests (@tryghost/admin)
  • GitHub Check: Acceptance tests (Node 22.23.1, mysql8)
  • GitHub Check: Acceptance tests (Node 22.23.1, better-sqlite3)

Walkthrough

The CI performance test job runs pnpm --filter ghost run build:assets after TypeScript compilation. The asset build completes before the Hyperfine boot-time benchmark.

Possibly related PRs

Merge Risk: ⚪ Minimal · up to 4af18

The workflow now builds the required asset manifest before booting the benchmark, a localized CI behavior change with no actionable merge-blocking risk remaining after normal checks and review.

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the boot benchmark failure and its missing card asset manifest cause.
Description check ✅ Passed The description directly explains the CI failure, the asset-build fix, benchmark impact, and verification steps.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Type-Safe Boundaries ✅ Passed The PR changes only .github/workflows/ci.yml, a config file; the check explicitly never fails for config files, and no typed application boundary code changed.
New Files Are Typescript ✅ Passed PR adds no new JavaScript source files; only modifies .github/workflows/ci.yml, which is a configuration file, not a .js/.jsx/.cjs/.mjs source file.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf-job-build-assets

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.59%. Comparing base (db060f2) to head (4af18e2).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #30004      +/-   ##
==========================================
- Coverage   75.59%   75.59%   -0.01%     
==========================================
  Files        1596     1596              
  Lines      141739   141739              
  Branches    17539    17538       -1     
==========================================
- Hits       107147   107143       -4     
- Misses      33589    33593       +4     
  Partials     1003     1003              
Flag Coverage Δ
e2e-tests 77.51% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vershwal vershwal added the perf-tests Run performance tests with this PR. label Aug 17, 2026
@vershwal vershwal closed this Aug 17, 2026
@vershwal vershwal reopened this Aug 17, 2026
Removed comments explaining the asset build process.
@vershwal
vershwal enabled auto-merge (squash) August 17, 2026 08:26
@vershwal
vershwal merged commit be3a152 into main Aug 17, 2026
58 checks passed
@vershwal
vershwal deleted the perf-job-build-assets branch August 17, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf-tests Run performance tests with this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants