Add generated GitLab Pages landing page#34
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8fec2dd752
ℹ️ 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".
| } | ||
| function latestChanges() { | ||
| const section = | ||
| changelog.match(/## \[[^\]]+\][\s\S]*?(?=\n## \[|\n\[Unreleased\]:|$)/)?.[0] ?? ""; |
There was a problem hiding this comment.
Skip empty Unreleased changelog sections
When the changelog follows the current Keep a Changelog layout and starts with an empty ## [Unreleased] section, this match selects that first section and latestChanges() returns an empty list. As a result the generated landing page renders a blank “Latest repo changes” card even though released entries exist immediately below; skip empty Unreleased or select the first section with bullet items.
Useful? React with 👍 / 👎.
| speed: lineMatch(readme, /\*\*A full pre-action gate in ([^*]+)\*\*/m, "118 ms"), | ||
| impact: lineMatch(readme, /answers in \*\*([^*]+)\*\*/m, "0.43 ms"), | ||
| saved: lineMatch(readme, /measured \*\*([^*]+)\*\*/m, "62.1% cost saved"), | ||
| benchUpdated: statSync(join(root, "reports/benchmarks.md")).mtime.toISOString().slice(0, 10), |
There was a problem hiding this comment.
Derive benchmark date from git, not mtime
In a GitLab Pages job or any fresh clone, checkout resets the filesystem mtime for reports/benchmarks.md, so this date will report the page build/checkout date rather than when the benchmark report actually changed. That makes the generated “benchmarks file updated” metadata drift on unrelated deployments; use commit history or a date embedded in the benchmark file instead.
Useful? React with 👍 / 👎.
Motivation
Description
scripts/build-pages.mjsthat renderspublic/index.htmlfrompackage.json,README.md,CHANGELOG.md, andreports/benchmarks.md, with optional live GitHub stats behindBUILD_PAGES_LIVE=1using timeouts, retries with jitter, and ETag/Last-Modified caching.public/index.htmland a GitLab Pages CI job in.gitlab-ci.ymlthat runsnpm run pages:buildand publishespublic/on the default branch.package.jsonto includepublicandscriptsin the publishedfilesand add scriptspages:buildandpages:build:livefor deterministic and live builds.README.mdand adddocs/REPO_REVIEW.mdwith review findings and suggestions.test/pages.test.jscovering the offline renderer and an opt-in integration test that exercises the live GitHub fetch whenRUN_INTEGRATION=1.Testing
npm run pages:buildsucceeded and producedpublic/index.html(unit/offline generator path passed).npm run check -- --diagnostic-level=errorcompleted with no blocking errors after minor formatting fixes were applied (lint/format applied to the new files).npm testran the full test suite and passed the new renderer unit test; the repo's test suite overall passed (402+ tests passed,1skipped for integration).npm run typecheckcompleted successfully.RUN_INTEGRATION=1 node --test test/pages.test.jsfailed in this environment because the no-auth GitHub API fetch failed (the integration test is optional and skips by default); the offline path and unit assertions passed.Codex Task