Skip to content

ci(bundle-size): read prerendered content at the checked-out commit - #95

Merged
atinux merged 1 commit into
mainfrom
fix/bundle-size-content-ref
Nov 14, 2026
Merged

atinux merged 1 commit into
mainfrom
fix/bundle-size-content-ref

Conversation

@atinux

@atinux atinux commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Written by an AI agent on behalf of @atinux.

Since #94 added --urls=/,/page,/getting-started/introduction, the bundle-size job prerenders pages, and every page 404s in CI. On #94, analyze (base) failed with [404] Landing page not found / [404] Page not found and Exiting due to prerender errors., and analyze (pr) was cancelled. Every PR on main would now hit the same failure.

The cause is the branch the layer reads content from. getGitBranch() and targetBranch() fall back to GITHUB_REF_NAME, which is <number>/merge on pull_request runs, so prerendering asks GitHub for a ref that doesn't exist:

Nothing found at GET https://api.github.com/repos/comarkdown/comark-docs/git/trees/94%2Fmerge%3Aplayground%2Fcontent?recursive=1, or the credential cannot see it

What changed

bundle-size.yml sets VERCEL_GIT_COMMIT_REF, which the layer checks first, to the commit each side checked out: base.sha for base, and github.sha (the PR merge commit, which also exists for fork PRs) for pr.

Evidence

Run locally with the same command as CI (npx nuxt-bundle-analyzer@0.2.0 playground --urls "/,/page,/getting-started/introduction" --no-serve), with GITHUB_TOKEN and GITHUB_REF_NAME=94/merge as on CI:

Env Result
no VERCEL_GIT_COMMIT_REF (current main) Nothing found at …/git/trees/94%2Fmerge…, [404] Landing page not found, [404] Page not found, prerender fails, same as #94's CI
VERCEL_GIT_COMMIT_REF=<commit sha> (this PR) Recorded 3 prerendered pages., exit=0

This PR's own analyze (base) and analyze (pr) jobs are the real check: on pull_request runs the workflow comes from the merge commit, so both sides get the fix.

ELI5

The docs site fetches its pages from GitHub using the branch name. In pull-request CI the "branch name" is a fake one, so it found no pages. We now give it the exact commit instead.

@coldtea-pr-lens

Copy link
Copy Markdown

Note

The title starts with ci(bundle-size):, so PR Lens left this pull request undrawn. Comment @pr-lens draw to draw it

github.comment.notice: false in .github/pr-lens.yml turns this note off

@vercel

vercel Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
comark-docs-layer Ready Ready Preview Nov 13, 2026 1:37pm UTC

@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 25 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 61743e4c-9125-469a-bf1f-6fde51ec8c8a
Commits

Reviewing files that changed from the base of the PR and between 6dbf3a8 and 4b17c6e.

Files selected for processing: 1

  • .github/workflows/bundle-size.yml
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@pkg-pr-new

pkg-pr-new Bot commented Nov 13, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/comarkdown/comark-docs@95

commit: 4b17c6e

@github-actions

Copy link
Copy Markdown

Bundle size

Explore the comparison →

Client 867.5 kB $\color{red}\textsf{(+13 B, +0.0}\%\textsf{)}$ · Server 6.52 MB $\color{red}\textsf{(+78 B, +0.0}\%\textsf{)}$

No route loads 100 B more or less before it renders.

No prerendered URL's initial load or HTML changes by 100 B or more.

Brotli sizes. Changes under 100 B are left out of the tables. Measured by nuxt-bundle-analyzer for 4b17c6e.

@atinux
atinux merged commit 525d708 into main Nov 14, 2026
12 checks passed
@atinux
atinux deleted the fix/bundle-size-content-ref branch November 14, 2026 11:05

This branch was successfully deployed

1 active deployment
Preview — 4b17c6e7 Deployed Nov 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant