Skip to content

Add generated GitLab Pages landing page#34

Merged
CodeWithJuber merged 1 commit into
masterfrom
codex/review-repository-for-updates-and-improvements
Jul 7, 2026
Merged

Add generated GitLab Pages landing page#34
CodeWithJuber merged 1 commit into
masterfrom
codex/review-repository-for-updates-and-improvements

Conversation

@CodeWithJuber

Copy link
Copy Markdown
Owner

Motivation

  • Provide a professional, deterministic landing page that is always generated from real repository sources so marketing/docs don't drift from code and benchmarks.
  • Make the public site auto-updatable while keeping live external counters optional and rate-limit/caching friendly.
  • Keep the landing page zero-runtime and testable (no framework or external runtime deps) so it can be validated in CI and reproduced locally.

Description

  • Add a repo-driven page generator at scripts/build-pages.mjs that renders public/index.html from package.json, README.md, CHANGELOG.md, and reports/benchmarks.md, with optional live GitHub stats behind BUILD_PAGES_LIVE=1 using timeouts, retries with jitter, and ETag/Last-Modified caching.
  • Add the generated artifact public/index.html and a GitLab Pages CI job in .gitlab-ci.yml that runs npm run pages:build and publishes public/ on the default branch.
  • Update package.json to include public and scripts in the published files and add scripts pages:build and pages:build:live for deterministic and live builds.
  • Add documentation and notes: insert a GitLab Pages section into README.md and add docs/REPO_REVIEW.md with review findings and suggestions.
  • Add tests in test/pages.test.js covering the offline renderer and an opt-in integration test that exercises the live GitHub fetch when RUN_INTEGRATION=1.

Testing

  • npm run pages:build succeeded and produced public/index.html (unit/offline generator path passed).
  • npm run check -- --diagnostic-level=error completed with no blocking errors after minor formatting fixes were applied (lint/format applied to the new files).
  • npm test ran the full test suite and passed the new renderer unit test; the repo's test suite overall passed (402+ tests passed, 1 skipped for integration).
  • npm run typecheck completed successfully.
  • RUN_INTEGRATION=1 node --test test/pages.test.js failed 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

@CodeWithJuber CodeWithJuber merged commit 09928cf into master Jul 7, 2026
10 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread scripts/build-pages.mjs
}
function latestChanges() {
const section =
changelog.match(/## \[[^\]]+\][\s\S]*?(?=\n## \[|\n\[Unreleased\]:|$)/)?.[0] ?? "";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread scripts/build-pages.mjs
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),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant