Skip to content

Fix sitemap coverage for deployed HTML and locale variants#2562

Closed
pethers with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-sitemap-xml-generation
Closed

Fix sitemap coverage for deployed HTML and locale variants#2562
pethers with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-sitemap-xml-generation

Conversation

Copilot AI commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Sitemap generation omitted generated analysis HTML and did not represent analysis locale variants. The deployment workflow also excluded analysis HTML from the published S3 site.

  • Sitemap collection
    • Recursively collect HTML under docs/ and analysis/.
    • Include analysis pages in sitemap totals and generated URLs.
  • Locale alternates
    • Detect supported locale suffixes such as .en.html and .sv.html.
    • Emit hreflang links for each locale plus x-default.
  • Deployment
    • Explicitly sync analysis/**/*.html to S3 while preserving existing exclusions.
  • Regression coverage
    • Verify recursive HTML discovery and locale-linked analysis URLs.
<xhtml:link rel="alternate"
  hreflang="sv"
  href="https://www.euparliamentmonitor.com/analysis/report.sv.html"/>
<xhtml:link rel="alternate"
  hreflang="x-default"
  href="https://www.euparliamentmonitor.com/analysis/report.en.html"/>

Copilot AI and others added 4 commits July 20, 2026 15:09
Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Copilot AI changed the title Fix sitemap coverage for deployed HTML Fix sitemap coverage for deployed HTML and locale variants Jul 20, 2026
Copilot AI requested a review from pethers July 20, 2026 15:18
@github-actions github-actions Bot added infrastructure CI/CD and build infrastructure github_actions GitHub Actions updates testing Testing improvements config Configuration changes test-coverage-impact Impacts test coverage needs-tests Needs test coverage workflows GitHub workflows scripts Scripts and automation labels Jul 20, 2026
@pethers
pethers marked this pull request as ready for review July 20, 2026 15:31
@pethers
pethers requested a review from Copilot July 20, 2026 15:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates sitemap generation and deployment to include generated analysis HTML pages (including locale-suffixed variants) so the public site and sitemap stay consistent.

Changes:

  • Extend sitemap generation to accept and emit URLs for analysis HTML files, adding hreflang alternates for locale clusters (plus x-default).
  • Add a generic recursive HTML collector (collectHtmlFiles) and wire sitemap CLI to scan both docs/ and analysis/.
  • Add unit regression coverage for recursive analysis HTML discovery and locale alternates; update S3 deploy workflow to sync analysis HTML.

Reviewed changes

Copilot reviewed 5 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/unit/sitemap-xml.test.js Adds regression tests for recursive analysis HTML discovery and hreflang alternates for locale variants.
src/generators/sitemap/xml.ts Adds analysis directory support, new analysisFiles parameter to generateSitemap, and buildAnalysisUrls() with locale alternate detection.
src/generators/sitemap/index.ts Re-exports new sitemap APIs (collectHtmlFiles, SITEMAP_ANALYSIS_DIR).
src/generators/sitemap.ts Updates sitemap CLI wiring to collect analysis HTML and pass it into sitemap generation; adjusts URL count logging.
scripts/generators/sitemap/xml.js Compiled JS equivalent of the TypeScript sitemap updates (analysis URLs + locale alternates).
scripts/generators/sitemap/index.js Compiled JS re-exports updated sitemap APIs.
scripts/generators/sitemap.js Compiled JS CLI wiring updated to include analysis HTML in sitemap generation.
.github/workflows/deploy-s3.yml Adds an explicit S3 sync pass for analysis/**/*.html (intended to publish generated analysis HTML).
Files not reviewed (3)
  • scripts/generators/sitemap.js: Generated file
  • scripts/generators/sitemap/index.js: Generated file
  • scripts/generators/sitemap/xml.js: Generated file

Comment on lines +345 to +355
aws s3 sync "$SRC" "$BUCKET" \
--checksum-algorithm SHA256 \
--no-progress \
--exclude '*' \
--include 'analysis/**/*.html' \
--cache-control 'public, max-age=3600, must-revalidate' \
--content-type 'text/html; charset=utf-8' \
--no-guess-mime-type \
"${EXCL[@]}" \
--exclude "analysis/*" \
--include "analysis/**/*.html"
@pethers pethers closed this Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration changes github_actions GitHub Actions updates infrastructure CI/CD and build infrastructure needs-tests Needs test coverage scripts Scripts and automation test-coverage-impact Impacts test coverage testing Testing improvements workflows GitHub workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants