Skip to content

Resolve merge conflicts with main, fix pre-existing Vitest failures, and extend CI build timeouts#2805

Merged
pethers merged 8 commits into
mainfrom
copilot/add-global-reader-context
May 28, 2026
Merged

Resolve merge conflicts with main, fix pre-existing Vitest failures, and extend CI build timeouts#2805
pethers merged 8 commits into
mainfrom
copilot/add-global-reader-context

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 28, 2026

The branch had diverged from main, producing 15 conflicts across the daily realtime-monitor article and its 14 rendered news HTML pages.

All conflicts were in generated content. The branch side carried only timestamp churn (generated_at, og:updated_time, dateModified, footer "Last updated"), while main carried real new content — the TU digital-governance cluster (HD01TU17 telecom anti-spoofing rules, HD01TU18 interoperability law), added significance-table rows, and a new cross-reference cluster node.

Resolution

  • Generated content (15 files) — adopted main's newer, content-rich versions; discarded the branch's stale timestamp-only edits.
  • Feature codedata/political-glossary.json, scripts/render-lib/political-context.ts, scripts/types/language.ts, and the article.ts/article-aside.ts wiring auto-merged without conflict and remain intact.
  • Finalized as a true merge commit (two parents: branch HEAD + origin/main).

No source logic was authored during resolution — the choice was strictly between two existing content versions, favoring main's latest published output. The political-context feature is unaffected; its HTML output will be applied on the next render pipeline regeneration, consistent with the branch's pre-merge state.

Vitest CI fixes

After the merge, the Unit Tests (Vitest) job reported 7 failures (2 files). These were pre-existing on main, introduced by commit f41c7307 "Refine narrative aggregation for reader-friendly flow", which renamed reader labels and section titles and changed order.ts but left two test files (and one consumer) unaligned. Both root causes were fixed:

  • scripts/check-headline-quality.ts (source fix, 3 tests) — Rule E (which flags H1s that merely echo the subfolder slug) was routing through the renderer's prettifyFallbackTitle, whose curated CATEGORY_FALLBACK_TITLES map turns slugs like propositions into engaging titles ("Government Bills — Swedish Legislative Agenda") and thereby defeated the bare-slug detection. Added a local plain slug→Title-Case prettifier (prettifySlugSegment) used by prettifySubfolderPath and the leaf comparison, and removed the now-unused import. Rule E once again flags lazy slug-echo H1s for curated subfolders.
  • tests/article-aside.test.ts (test fix, 4 tests) — updated stale string expectations to match f41c7307's deliberate, merged renames (BLUF → "Lede and editorial decisions"; political-classification#rm-deep-dive-political-classification; classification-resultsrm-deep-dive-classification-results). f41c7307 updated render-lib.test.ts/render-lib-leaf-modules.test.ts but missed this file; all structural assertions remain intact.

Verified: both files green in isolation (36/36, 18/18), related batch (render-lib, render-lib-leaf-modules, political-context) 382/382, tsc typecheck clean, and full npm test reports 0 failures.

CI build timeout extension

The Test News / Build for News Tests job was cancelled after 15m, which then skipped its dependent News & Sitemap Tests job. Investigating the Actions logs showed the shared npm run build step now takes ~14m42s on its own (it renders ~5,400 pages — 391 subfolders × 14 languages), pushing the full build job (checkout + npm ci + build + artifact upload) to ~17min — past the 15-min cap. The passing Build Test (Vite) job (no timeout cap) confirmed the build genuinely needs ~17min.

  • .github/workflows/test-news.yml — build job timeout-minutes 15 → 25.
  • .github/workflows/test-homepage.yml — build job timeout-minutes 15 → 25 (identical build, same cap, same risk).

25min gives ~8min of durable headroom over the observed ~17min job as the news corpus keeps growing. On performance: the build hot spot is the CPU-bound unified/remark/rehype markdown pipeline, where bounded Promise.all concurrency gives no real wall-clock gain (single-threaded, no I/O to overlap) and would risk the render test suite; true parallelism would require a worker_threads rewrite, so the safe, deterministic timeout fix was chosen instead. CodeQL (actions) scan reports 0 alerts.

@github-actions github-actions Bot added the size-xs Extra small change (< 10 lines) label May 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🏷️ Automatic Labeling Summary

This PR has been automatically labeled based on the files changed and PR metadata.

Applied Labels: size-xs

Label Categories

  • 🗳️ Content: news, dashboard, visualization, intelligence
  • 💻 Technology: html-css, javascript, workflow, security
  • 📊 Data: cia-data, riksdag-data, data-pipeline, schema
  • 🌍 I18n: i18n, translation, rtl
  • 🔒 ISMS: isms, iso-27001, nist-csf, cis-controls
  • 🏗️ Infrastructure: ci-cd, deployment, performance, monitoring
  • 🔄 Quality: testing, accessibility, documentation, refactor
  • 🤖 AI: agent, skill, agentic-workflow

For more information, see .github/labeler.yml.

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
@github-actions github-actions Bot added the documentation Documentation updates label May 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Copilot AI changed the title [WIP] Add global reader context for political glossary tooltips and actor cards Add global political context onboarding: glossary tooltips, party first-use expansions, and article context panel May 28, 2026
Copilot AI requested a review from pethers May 28, 2026 16:36
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

@pethers pethers marked this pull request as ready for review May 28, 2026 16:48
Copilot AI review requested due to automatic review settings May 28, 2026 16:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@pethers
Copy link
Copy Markdown
Member

pethers commented May 28, 2026

@copilot analyse and improve code and test quality and fix root cause of
TypeScript & JavaScript Testing / Unit Tests (Vitest) (pull_request)
TypeScript & JavaScript Testing / Unit Tests (Vitest) (pull_request)Failing after 4m

and resolve merge conflicts

…ader-context

# Conflicts:
#	analysis/daily/2026-05-28/realtime-monitor/article.md
#	news/2026-05-28-realtime-monitor-ar.html
#	news/2026-05-28-realtime-monitor-da.html
#	news/2026-05-28-realtime-monitor-de.html
#	news/2026-05-28-realtime-monitor-en.html
#	news/2026-05-28-realtime-monitor-es.html
#	news/2026-05-28-realtime-monitor-fi.html
#	news/2026-05-28-realtime-monitor-fr.html
#	news/2026-05-28-realtime-monitor-he.html
#	news/2026-05-28-realtime-monitor-ja.html
#	news/2026-05-28-realtime-monitor-ko.html
#	news/2026-05-28-realtime-monitor-nl.html
#	news/2026-05-28-realtime-monitor-no.html
#	news/2026-05-28-realtime-monitor-sv.html
#	news/2026-05-28-realtime-monitor-zh.html

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Copilot AI changed the title Add global political context onboarding: glossary tooltips, party first-use expansions, and article context panel Resolve merge conflicts with main on global reader context branch May 28, 2026
@pethers pethers requested a review from Copilot May 28, 2026 20:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

@pethers
Copy link
Copy Markdown
Member

pethers commented May 28, 2026

@copilot analyse and improve all changes. MUST fix so all PR checks pass and all code is correct

TypeScript & JavaScript Testing / Unit Tests (Vitest) (pull_request)
TypeScript & JavaScript Testing / Unit Tests (Vitest) (pull_request)Failing after 4m

…ion titles

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 28, 2026

@copilot analyse and improve all changes. MUST fix so all PR checks pass and all code is correct

[TypeScript & JavaScript Testing / Unit Tests (Vitest) (pull_request)](https://githu...

Fixed in 76f56fc. The 7 Vitest failures were pre-existing on main (introduced by f41c7307 "Refine narrative aggregation for reader-friendly flow"), surfaced here after the merge:

  • 3 check-headline-quality (Rule E) — root cause in source: prettifySubfolderPath/matchesPrettifiedSubfolder routed through the renderer's curated prettifyFallbackTitle, which maps propositions → "Government Bills — …" and stopped Rule E from flagging lazy bare-slug H1s. Fixed by adding a local plain slug→Title-Case prettifier so Rule E compares against the bare label.
  • 4 article-aside — those expectations still asserted the pre-rename strings (BLUF, #rm-political-classification, rm-classification-results). f41c7307 deliberately renamed the labels (BLUF→"Lede", section titles→"Deep Dive: …") and updated render-lib.test.ts/render-lib-leaf-modules.test.ts but missed article-aside.test.ts. Updated the stale strings; all structural assertions kept intact.

Verified: both files green in isolation (36/36, 18/18), related batch 382/382, tsc typecheck clean, full npm test reports 0 failures.

Copilot AI changed the title Resolve merge conflicts with main on global reader context branch Resolve merge conflicts with main and fix pre-existing Vitest failures May 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

@pethers
Copy link
Copy Markdown
Member

pethers commented May 28, 2026

@copilot and fix issues in

failing checks
Test News / Build for News Tests (pull_request)
Test News / Build for News Tests (pull_request)Cancelled after 15m
in progress checks
Loading
TypeScript & JavaScript Testing / Multi-Language Sanity Tests (pull_request)
TypeScript & JavaScript Testing / Multi-Language Sanity Tests (pull_request)Started 1 minute ago — This check has started...
skipped checks
Test News / News & Sitemap Tests (pull_request)
Test News / News & Sitemap Tests (pull_request)Skipped 2 minutes ago

extend timeouts so all test have time to complete. improve performance if possible

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 28, 2026

@copilot and fix issues in

failing checks
...

Fixed in the latest commit. Root cause of the cancellations: the shared npm run build step now takes ~14m42s on its own (renders ~5,400 pages — 391 subfolders × 14 languages), pushing the full build job (checkout + npm ci + build + artifact upload) to ~17min. The Test News / Build for News Tests job was capped at timeout-minutes: 15, so it was cancelled mid-render, which in turn skipped the dependent News & Sitemap Tests job. (The Multi-Language Sanity Tests check completed once its build artifact was available.)

  • Extended test-news.yml build timeout-minutes 15 → 25.
  • Extended test-homepage.yml build timeout-minutes 15 → 25 (identical build, same cap, same risk).
  • 25min gives durable headroom (~8min over the observed ~17min job) as the news corpus keeps growing.

On performance: the build hot spot is the CPU-bound unified/remark/rehype markdown pipeline. Bounded Promise.all concurrency wouldn't meaningfully cut wall-clock (single-threaded, no real I/O to overlap) and would risk the render test suite; true parallelism would require a worker_threads rewrite. I opted for the safe, deterministic timeout fix rather than risk regressions.

@github-actions github-actions Bot added workflow GitHub Actions workflows ci-cd CI/CD pipeline changes labels May 28, 2026
Copilot AI changed the title Resolve merge conflicts with main and fix pre-existing Vitest failures Resolve merge conflicts with main, fix pre-existing Vitest failures, and extend CI build timeouts May 28, 2026
@pethers
Copy link
Copy Markdown
Member

pethers commented May 28, 2026

@copilot resolve the merge conflicts in this pull request

…ader-context

# Conflicts:
#	.github/workflows/test-homepage.yml
#	scripts/render-lib/article.ts

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 28, 2026

@copilot resolve the merge conflicts in this pull request

Resolved in 029fcf8. Two conflicts from main's recent merges:

tsc typecheck clean, 159/159 relevant tests passing.

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

@pethers pethers merged commit 609ff95 into main May 28, 2026
16 checks passed
@pethers pethers deleted the copilot/add-global-reader-context branch May 28, 2026 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-cd CI/CD pipeline changes documentation Documentation updates size-xs Extra small change (< 10 lines) workflow GitHub Actions workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add global reader context: political glossary tooltips, actor cards, and comparative international anchors

3 participants