Harden last-updated dates: CI guard, SEO metadata, View history link - #904
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 48 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe route generator now records all MDX-backed routes. The layout restricts GitHub links to those routes and adds history links. The MDX transform exports update dates, which the app uses for page metadata. CI validates empty update maps. ChangesMDX documentation flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant MDXTransform as rehypeInsertLastUpdated
participant AppInner
participant Layout
participant GitHub
MDXTransform->>AppInner: Export lastUpdated
AppInner->>AppInner: Add modification metadata
AppInner->>Layout: Render page
Layout->>Layout: Check MDX_PAGE_ROUTES
Layout-->>GitHub: Link to MDX source and commit history
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/Layout.jsx`:
- Line 239: Update the user-visible text in the Edit on Github link within the
Layout component to use the official “GitHub” capitalization, leaving the
surrounding link structure unchanged.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: c0015e97-eee1-44fd-a9bb-b1af3a1d00be
📒 Files selected for processing (4)
scripts/generate-github-routes.mjsscripts/generate-last-updated.mjssrc/components/Layout.jsxsrc/pages/_app.jsx
Description
Builds on the git-based "Updated " system: a broken date pipeline now fails loudly in CI instead of silently shipping dateless pages, the dates now feed SEO freshness signals (meta, JSON-LD), and each page links to its GitHub commit history. Along the way this fixes two unrelated latent bugs: GitHub source links rendering on 404/500 pages, and
npm run lintcrashing under ESLint 9 with eslint-config-next 16.Changes
Last-updated pipeline (
scripts/generate-last-updated.mjs)GITHUB_ACTIONS, where the workflow guarantees full history viafetch-depth: 0, so an empty map always means breakage.--depth=10), so its builds ship without dates unlessVERCEL_DEEP_CLONE=trueis set on the project (see deployment notes).SEO freshness metadata (
src/pages/_app.jsx,mdx/rehype.mjs)<meta property="article:modified_time">and a JSON-LDTechArticleblock (headline, description,dateModified). Pages without a date (generated API resources, shallow-clone builds) emit nothing._app.jsxthroughpageProps: the existing rehype date plugin exportslastUpdatedfrom each compiled MDX module andrecma-nextjs-static-propspicks it up, the same mechanismtitleandsectionsalready use. Each page carries only its own date, so nothing is added to the shared client bundle.View history links (
src/components/Layout.jsx,scripts/generate-github-routes.mjs)MDX_PAGE_ROUTESset. Previously the prerendered 404/500 pages linked to the nonexistentsrc/pages/_error.mdx(surfaced by an external audit; the Edit link already had this bug).ESLint 9 fix (
eslint.config.mjs)eslint-config-next16 shipscore-web-vitalsas a native flat config; loading it throughFlatCompatcrashed ESLint with "Converting circular structure to JSON". The config now imports and spreads it directly.rules-of-hookserrors deserve a look first.@eslint/eslintrcin devDependencies is now unused and can be dropped in a follow-up (needs a lockfile regen).Deployment notes
VERCEL_DEEP_CLONE=trueenvironment variable for dates, SEO metadata, and sitemap<lastmod>to appear. Confirmed working in the Preview environment on 2026-08-05. Without it, builds succeed but ship dateless.Validation
npm run buildpasses;npm run lintruns again (crash gone).CI=1warns and exits 0, normal run generates 287 dated routes.404.html/500.htmlcontain no GitHub source links; index routes still resolve to.../index.mdx.__NEXT_DATA__contains only its ownlastUpdated, and no client chunk contains the route-to-date map.VERCEL_DEEP_CLONE=true: Updated dates render and sitemap<lastmod>tags are present.