Make Lighthouse skippable, honest about failures, and easy to read - #12
Merged
Merged
Conversation
deploy-app yields an empty deployment-url when Cloudflare returns no preview URL (Preview URLs disabled for the Worker); it warns and carries on. The Lighthouse job then ran `lhci autorun --collect.url=""`, which makes LHCI fall back to hunting for a static dist dir and fail with a misleading "Unable to automatically determine the location of static site files" error — observed on apps-management#1151. The shared lighthouserc.json sets every assertion to `off` (reports are informational), so a missing preview URL must never fail a PR. Skip with a clear warning instead, and stop the deploy-app warning from printing a broken `dash.cloudflare.com//workers-and-pages` link when the account-id input is empty.
The warning asserted "Preview URLs disabled for <env>", which sent an investigation down the wrong path: apps-management's launchpad-demo has Preview URLs enabled (a run from the previous day printed a real https://<version>-launchpad-demo.kf-dev.workers.dev), yet the URL went missing after its Cloudflare API token was rotated. wrangler resolves the preview URL with a follow-up API call after printing the Worker Version ID and stays silent when that call fails, so an absent URL can equally mean the token cannot read the account's workers.dev subdomain, or that no account id was supplied for wrangler to resolve one. Name all three causes in likelihood order, and warn separately when cloudflare-account-id arrives empty — it is a required input, and apps-management is currently passing nothing.
The hosted report URL was only discoverable by expanding the job log and finding lhci's "Open the report at <url>" line. Lift it into GITHUB_STEP_SUMMARY alongside the tested URL, so it shows on the run's summary page. Reports are deliberately not uploaded as artifacts — the shared config already publishes to LHCI temporary public storage and nobody is expected to trawl old reports, so the summary notes that the link expires after a few days rather than promising durable access. lhci output is teed to lift the URL out; `set -o pipefail` keeps a real lhci failure from being masked by tee's exit status. If no hosted link is present (e.g. a caller overrides the upload target), the summary says so instead of rendering a broken link.
gpmayorga
marked this pull request as ready for review
August 18, 2026 14:19
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.
Three changes to the
performance-scorejob and its surrounding diagnostics. None of them alter what Lighthouse measures.1. Skip instead of failing when there is no preview URL
build-deploy / performance-scorefailed on apps-management PRs with:Misleading — nothing about static dirs was wrong.
actions/deploy-appyields an emptydeployment-urlwhen Cloudflare returns no preview URL, warns, and lets the deploy succeed (correct). The Lighthouse job then ranlhci autorun --collect.url="", and with no URL LHCI assumes you're testing a static build and goes hunting for a dist directory.The shared
lighthouserc.jsonsets every assertion tooff— reports are informational and by design cannot fail a build. Hard-failing because a preview URL is unavailable contradicts that, so the job now bails out early with a::warning::(and skips the pointlessnpm install -g @lhci/cli).2. Stop the missing-preview-URL warning from blaming the wrong cause
deploy-app's warning asserted "Preview URLs disabled for<env>". That sent a real investigation down the wrong path for hours:launchpad-demohad previews enabled (a run the previous day printedhttps://3a40f0b1-launchpad-demo.kf-dev.workers.dev), and the URL only vanished after the Cloudflare API token was rotated — so the token looked guilty too. It wasn't either: the actual cause waswrangler deployapplyingpreview_urls = false, because declaringroutesflips theworkers_devdefault (fixed app-side in centrifuge/apps-invest#313 and centrifuge/apps-management#1233).wrangler resolves the preview URL with a follow-up API call after printing the Worker Version ID and stays silent when that call fails, so an absent URL is genuinely ambiguous. The warning now lists all three candidate causes in likelihood order instead of asserting one, and warns separately when
cloudflare-account-idarrives empty — it's a required input, and apps-management was passing nothing (that empty value also produced a brokendash.cloudflare.com//workers-and-pageslink in the old message).3. Put the report link on the run summary
The hosted report was only reachable by expanding the job log and spotting lhci's
Open the report at <url>line. It's now written toGITHUB_STEP_SUMMARYalong with the tested URL, so it appears on the run's summary page.Reports are deliberately not uploaded as artifacts — the shared config already publishes to LHCI temporary public storage, and these are throwaway testnet previews nobody is expected to revisit. The summary says the link expires after a few days rather than implying durable access.
Implementation notes: lhci output is teed so the URL can be lifted out, with
set -o pipefailso a genuine lhci failure isn't masked bytee's exit status; if no hosted link is present (a caller overriding the upload target) the summary states that instead of rendering a broken link.Verification
lib-ci) clean on both changed files.pipefailconfirmed to propagate a non-zero lhci exit throughtee.Related
preview_urls = trueinwrangler.toml). This PR is the safety net and the diagnostics.🤖 Generated with Claude Code