Skip to content

Feature/vercel preview performance check - #179

Open
crispy101 wants to merge 13 commits into
mainfrom
feature/vercel-preview-performance-check
Open

Feature/vercel preview performance check#179
crispy101 wants to merge 13 commits into
mainfrom
feature/vercel-preview-performance-check

Conversation

@crispy101

@crispy101 crispy101 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Description of the proposed changes
add workflows for:

  • preview performance check, with multiple projects supported
  • performance baseline build and keep-alive of the Github Actions cache

Screenshots (if applicable)

Other solutions considered (if any)

Notes to PR author

⚠️ Please make sure the changes adhere to the guidelines mentioned in our contribution guide.

Notes to reviewers

ℹ️ When you've finished leaving feedback, please add a final comment to the PR tagging the author, letting them know that you have finished leaving feedback

Time Tracking

ABC-xxx: code review, select project XXXX

crispy101 and others added 10 commits August 25, 2026 15:38
Adds an opt-in Lighthouse check that measures Core Web Vitals against the
preview deployment and comments the median results on the pull request.

The check is off by default and runs only when `performance-check` is true
and `measured-paths` is non-empty, so existing callers are unaffected. The
change is purely additive: no existing line is modified, and the deploy job
gains only an `outputs.url` so the new job can consume the preview URL.

The caller supplies the measured paths and a Lighthouse CI config holding
run count and budgets. Documented with a worked example, including why the
config should set `aggregationMethod: median` (LHCI defaults to
`optimistic`, which takes the best run) and why the budgets should be
advisory on a cold preview.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The secret was named in the inputs table and the example, but nothing said
where to obtain it, how to tell whether a project needs it, or what happens
without it. Someone hitting a 401 during warm-up had no path from the error
to the fix.

Adds a Deployment Protection section covering how to generate the secret,
the permissions required, the redeploy caveat when rotating it, and how to
check whether a project has protection enabled.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The check was an input on the deploy workflow, which meant it could only
ever measure a deployment that workflow made, and its cadence was fixed by
whatever triggered the deploy.

As a separate workflow taking a deployment URL, the caller decides what to
measure and when: pair it with a deploy via `needs` on pull requests, call it
again on push to the default branch to record a baseline, or point it at a
second project. None of that is expressible as an input.

vercel-preview.yml goes back to deploying only, losing six inputs and one
secret. The two baseline booleans collapse into a `baseline-mode` enum, so
the invalid "record and compare" combination is no longer representable.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Baseline caches were keyed only by form factor, so a repository measuring two
deployments would have them overwrite each other and pull requests would
compare against whichever recorded last. A `baseline-key` input now namespaces
them; it defaults to "default", so existing single-deployment callers are
unaffected.

Adds vercel-performance-keepalive.yml. GitHub evicts a cache that has not been
read for 7 days, and the baseline is only rewritten on a merge, so a quiet
fortnight would drop it silently. Reading a cache resets that clock, so the
workflow restores the baselines and does nothing else, costing seconds rather
than the minutes a re-measurement would.

It expands the caller's baseline keys across the form factors this repository
measures, so callers do not duplicate that list. A full restore is used rather
than `lookup-only`, because whether a metadata-only lookup resets the eviction
clock is not documented, and the payload is a few hundred bytes either way.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Deploying several projects from one workflow had them share a group, so
cancel-in-progress made each call cancel the previous one.
The group used deployment-url, but that is only known once the deploy the call
depends on has finished, while the group is evaluated when the call is queued.
Every caller therefore shared an empty group and cancelled each other.
The deploy job set an output, but a reusable workflow only exposes what it
declares in on.workflow_call.outputs, so callers always read an empty string.
Two deployments measured in one pull request shared a comment marker, so
whichever finished last overwrote the other's results.
…w-performance-check

# Conflicts:
#	.github/workflows/vercel-preview.yml
#	docs/vercel-preview.md
Comment thread .github/workflows/vercel-performance-keepalive.yml Fixed
Comment thread .github/workflows/vercel-performance.yml Fixed
Comment thread .github/workflows/vercel-performance.yml Fixed
Comment thread .github/workflows/vercel-performance.yml Fixed
Comment thread .github/workflows/vercel-performance.yml Fixed
Comment thread .github/workflows/vercel-performance.yml Dismissed
actions/cache was tag-pinned, which the blanket policy rejects. setup-node was
hash-pinned to an unrelated Dependabot commit rather than to v6.0.0, and the
lighthouse-ci-action comment named a v12.6.1 tag that does not exist.

Both now use the versions already referenced elsewhere in this repo.
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.

2 participants