Repository navigation
fix(producer): the catalog payload check passes when Google Fonts drops a connection - #9109
Conversation
Edit accuracy: accurate 275 (base branch 273), smooth 66 of thoseThe gate passes. Newly passing (2)
Not banked yet, reported and not gated (bank a full-grid run's baseline.json) (2)
Quarantined, measured but not gated (0) |
terencecho
left a comment
There was a problem hiding this comment.
[P2] Keep non-font requests visible to the Catalog check. packages/producer/src/verifyStaticPage.ts:91 intercepts every HTTPS request to the two hosts, regardless of resource type. A missing image on either host can now receive an empty HTTP 200, which the request and response handlers treat as success. Limit the patterns to stylesheet requests on fonts.googleapis.com and font requests on fonts.gstatic.com, and pin the same-host non-font case alongside the existing other-host test.
[P2] Close the page if interception setup fails. packages/producer/src/verifyStaticPage.ts:55 sets up CDP before the page’s try/finally. Both setup rejection paths skip page.close() in a focused fault-injection check. Move setup inside the existing try so checkPageLoads closes the page on every exit after creation.
The Catalog payload and support jobs passed, including both new browser cases.
— tai (automated review)
|
Both fixed in 022ce1e.
|
terencecho
left a comment
There was a problem hiding this comment.
Both earlier findings are resolved. The browser stubs only stylesheet requests to fonts.googleapis.com and font requests to fonts.gstatic.com. The page closes when interception setup fails. I verified the same-host image failure in Chrome and injected failures at both setup steps to check cleanup. The PR body names the test that fails without the fix.
— tai (automated review)
What
The Catalog payloads check no longer fails when Google's font hosts drop a connection. Its browser answers
fonts.googleapis.comandfonts.gstatic.comitself, with an empty stylesheet or font, so a payload that loads passes whether or not those hosts answer.Why
The check went red on two release PRs for payloads that load fine:
caption-emoji-pop: request failed: https://fonts.gstatic.com/s/gabarito/v9/….woff2 (net::ERR_CONNECTION_CLOSED)plus itsconsole.errortwin, and a rerun of the same commit passed. Every failed request counts, so any blip on Google's side failed the job. A font only changes how text looks; it can't make a payload throw or lose an asset.Related work
None.
How
checkPageLoads(packages/producer/src/verifyStaticPage.ts) pauses only requests to the two Google font hosts (CDPFetchwith those two URL patterns) and fulfils them with a 200 and an empty body. Every other request goes out as before, so a missing script, image or media file on any host still fails the check.cdn.jsdelivr.net(gsap is in 390 of 448 payloads) and a few others, about 30 outside URLs in all. A release PR re-checks every payload that drifted since the last catalog publish, so if a blip on one of those hosts ever fails this job, the next step is to serve those files to the check from local copies.Test plan
fails without the fix:
scripts/verify-catalog-payloads.test.ts("passes a payload's Google Fonts"). It loads a page with a Google Fonts<link>, an@importand afonts.gstatic.com@font-facewhile Chrome cannot reach either host, and expects no failures. On main it reports six (each request plus its console error); here none. Dropping only thefonts.gstatic.compattern turns it red again. The second new test ("still fails a script whose host is unreachable") keeps a script from an unreachable host counted.verifyStaticPage.test.tspasses; producer type check passes.verify:catalog-payloads --only caption-emoji-popwith Chrome unable to reach Google's font hosts: main fails with the two lines CI showed, this branch passes. Every payload (439 live, 9 markers) in the Chrome 155 build puppeteer pins, run with main's code and with this branch's: with Google's font hosts unreachable, main fails 61, each on a Google Fonts request, and this branch fails none; with the network as is, both pass all 439 with the same verdicts.