ci: gallery format edits own only entry problems (no bead)
Summary
Between 04:23 and 05:20Z, #19699 and #19703 went red in web / react-apps-check on gallery-coverage. The failing finding was pages/settings/components/ThemeFiles.tsx#ThemeFiles has no entry. That gap came from #19688, which neither PR touched. #19572 already limits the check to findings the PR owns. But both PRs edited webviews/src/gallery/format.ts, and that file was in the check's rules, which makes every finding count. format.ts changed in 5 feat PRs in the last three days. So every PR that edited the gallery format inherited every coverage gap on the base branch.
- Cause: format.ts only provides
validateEntries. It,play.tsand the experiments files decide only "the entries are valid". - Fix: those files now own only that test's findings. The four coverage tests keep
gallery-coverage.test.ts,prScope.tsandscripts/gallery/entries.tsas their rules. Editing the check itself still owns every finding, and a new case pins that. - Review follow-up: format.ts also held
componentEntryand the other entry constructors, which build thecoversandidthe coverage tests read. They now live insrc/gallery/entry.ts, which is a rule for every gallery test. format.ts re-exports them, so no importer changes. New cases pin both sides: editing entry.ts owns coverage gaps, and editing format.ts still owns entry problems.
This was the largest still-active cause of unrelated reds in the last 12 hours, after same-tree, which #19615/#19616 fixed.
Testing
heavy --mem 4G python3 -m unittest scripts.tests.test_pr_scoped_webviews_checks:
- Red on b9c2f27ef9c3:
test_coverage_base_gap_warns_on_a_pr_changing_the_gallery_formatfailed with1 != 0;every component and page has an entry or an allowlist linefailed. - Green on the fix: 13 tests OK.
bun test test/gallery-coverage.test.ts passes (6/6), and bun run check passes.
Changelog
none
🤖 Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.
Summary by cubic
Stops gallery coverage checks from flagging unrelated base-branch coverage gaps on PRs that edit webviews/src/gallery/format.ts.
The check previously listed format.ts as owning the whole check, so editing it made every existing base-branch finding (like ThemeFiles missing an entry) count against the PR. The entry constructors moved to the new webviews/src/gallery/entry.ts (format.ts re-exports them), and that file stays a rule for every gallery test, while format.ts edits now own only "the entries are valid" findings. New tests pin that format.ts edits don't own base coverage gaps but do own entry problems, and that editing the check or entry.ts still owns every finding.