fix: tolerate missing sitemap in e2e builds - #730
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cffc0efc39
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| try { | ||
| sitemap = await fs.readFile(sitemapPath, 'utf-8') | ||
| } catch (error) { | ||
| if ((error as NodeJS.ErrnoException).code === 'ENOENT') process.exit(0) |
There was a problem hiding this comment.
Scope missing-sitemap tolerance to E2E builds
In the production build path, the workflow runs pnpm run build with VERCEL_ENV=production, but this unconditional ENOENT exit also returns success if that build ever stops emitting dist/public/sitemap.xml. In that scenario finalizeSitemap never adds the generated blog post URLs and CI/deploy can ship without the sitemap advertised by public/robots.txt; please gate this skip on the E2E/non-production environment so production still fails loudly.
Useful? React with 👍 / 👎.
cffc0ef to
12e7ebf
Compare
Motivation
E2E builds do not generate a sitemap, causing the post-build finalizer to fail.
Summary
Key design considerations