Repository navigation
Sitemap: omit lastmod when the git date is unknown, never the build date (TECH-013) - #74
Merged
Merged
Conversation
…ate (TECH-013) Vercel builds (Git and CLI) can lack git history. The sitemap then stamped the build date on every git-backed route: on 2026-11-02, 39 of 46 URLs claimed a change on deploy day. An unknown date is now omitted; the build warning still names every affected URL. BUILD_DATE is removed so nothing can fall back to it again.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Nov 2, 2026
This branch was successfully deployed
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.
What
/sitemap.xmlno longer writes the build date as<lastmod>. When a route's git date is unknown, its entry is listed with no<lastmod>. The build warning stays and names every affected URL, now worded[sitemap] WARNING: lastmod omitted for N URL(s).Why (TECH-013)
TECH-013 requires accurate
lastModified. Current production isdpl_EGLDvzrWVtsRxYdMpyjUzMAchAXX, a CLI upload made at 12:21 UTC on 2026-11-02 ("Downloading 648 deployment files", no git clone). It replaced the Git build of 4caceab (dpl_GFntYgBFEiFVS7mrrhfLhiXdPz7D, 12:19 UTC). That Git build had no warning. A CLI upload has no.git, so the old fallback stamped the build date: the log showslastmod fell back to the build date (2026-11-02) for 39 URL(s), and the live sitemap has 39 of 46 URLs dated today with no content change. This would repeat on every CLI deploy made on a new day.Vercel Git builds do have the history. The preview build of this PR (
toone-landing-owzl4v6na, Git clone) serves 46 of 46 URLs with real commit dates, for example/en/how-to/features/exploreat 2026-10-30, which is its git date. Google ignoreslastmodonce it proves wrong. A missinglastmodis valid sitemap XML.Change
app/sitemap.xml/route.ts: the order is git commit date, then the declared editorial date, then omit.url()drops the tag when the date is null.lib/source-date.ts:BUILD_DATEis removed so nothing can fall back to it again./en/governancedateModifiedwas already git date, then frontmatter, and it is unchanged.tests/routing/sitemap-lastmod.test.tscovers the case with git (real dates).tests/routing/sitemap-lastmod-nogit.test.tscovers no git (GIT_DIRset to a missing path): no lastmod, nothing dated today on git-backed routes, and the warning count matches. The no-git test fails onmainand passes here.Checks
npm test: pass, 0 failures.npm run buildwith git: no[sitemap]warning.npm run buildwithout git (GIT_DIR=/nonexistent, same as a CLI upload with no.git): exit 0. The warning lists 39 URLs.next startserves 46 URLs, 7 with<lastmod>(all editorial dates, 2026-09-28) and 0 dated 2026-11-02.After merge
[sitemap]warning, and every URL should carry its commit date.vercel --prod): the log showslastmod omitted for 39 URL(s)and has nofell backline, and no URL claims the deploy day. The way to keep real dates is to let the Git build be the release and stop CLI production deploys.Do not merge without the owner's yes. Merging to
maindeploys to production within about a minute.