Repository navigation
fix(url): fail fast on missing sitemapFilter export (F-50, round-2 followup) - #37
Merged
Merged
Conversation
…emapPageAllowed - loadConfigModule only guarantees the file loaded; the bare `as (page: string) => boolean` cast then let a user override that forgets the predicate blow up inside @astrojs/sitemap's filter at build time, with a stack that points away from config/sitemapFilter.ts. - requireConfigExport() checks the export is a function at load time and throws "config/sitemapFilter.ts must export isSitemapPageAllowed" instead.
This was referenced Nov 28, 2026
markd3ng
pushed a commit
that referenced
this pull request
Nov 29, 2026
…onciliation - closure-record: #38 diff verification, PR #30/#37/#38 walkthrough-only evidence + process exception, 8 deferred findings mapped to existing issues #3/#4/#6/#7 (F-104 register-only), TD-1 serial口径, 56/19 stats reconciliation, #15 tracker, Project #3 alignment. - engineering-tech-debt: TD-1..TD-6 ledger (tests/content race, F-20/F-88/F-90 src residuals, styl/README, favicon, F-104, shirone PRs). - final report: errata for review exception, #30 src-partial DEFERRED, shirone#201 F-10, 23→19 skip口径, ledger path.
Owner
Author
|
【收口审查记录 | Round 2 阶段收口(2026-11-29 Owner 批准)】
|
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.
Type of change
Related Issue
issue #10 — round-2 baseline quality audit, finding F-50.
Changes
src/integration/resolve/load-config.tsgainsrequireConfigExport(), which asserts a loaded config module actually exports a named function and otherwise throwsconfig/<file> must export <name>.src/integration/index.tsnow resolves the sitemap predicate through it instead ofsitemapModule.isSitemapPageAllowed as (page: string) => boolean, so a userconfig/sitemapFilter.tsoverride that omits the export fails at config-load with the config file named, rather than as aTypeErrorfrom inside@astrojs/sitemapat build time.tests/load-config.test.mjs: a real override that loads successfully but exports onlyisPageAllowedmakesrequireConfigExportthrow the exact message; a config that does exportisSitemapPageAllowedcomes back unchanged and stays callable; a source-contract case pinsindex.tsto the validated call and forbids the bare assertion from returning.How To Test
Additional Notes
The contract for this campaign forbids running a full Astro build, so the fail-fast path is covered by the unit tests above (which exercise the real
loadConfigModule+requireConfigExportpair on a temp fixture) plus the source-contract case, rather than by a build run.Summary by CodeRabbit