Conversation
…d propositions Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix hardcoded riksmöte year in review generators
Replace hardcoded riksmöte '2025/26' with dynamic getCurrentRiksmote() in weekly-review, monthly-review, and propositions
Feb 27, 2026
Contributor
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request replaces hardcoded riksmöte (parliamentary session) strings '2025/26' with dynamic calculation using the getCurrentRiksmote() utility function across three news generator modules. This change prevents silent failures when the parliamentary session changes in September 2026 to '2026/27'.
Changes:
- Replace 8 instances of hardcoded
'2025/26'with dynamicgetCurrentRiksmote()calls - Add missing imports to
monthly-review.tsandpropositions.ts - Ensure consistent session calculation across all news-type generators
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
scripts/news-types/weekly-review.ts |
Declares const rm = getCurrentRiksmote(today) at line 825 and uses it in 4 call sites (3 in Step 2 typed fetchers, 1 in Step 4 speech search). Import already existed. |
scripts/news-types/monthly-review.ts |
Adds getCurrentRiksmote import from ./motions.js, declares const rm = getCurrentRiksmote(today) at line 119, and replaces 3 hardcoded values in Step 2 fetchers. |
scripts/news-types/propositions.ts |
Adds getCurrentRiksmote import from ./motions.js and replaces 1 inline hardcoded value with getCurrentRiksmote() call in Step 4 speech search. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three generators hardcoded
'2025/26'as thermparameter, which will break silently when the parliamentary session rolls to'2026/27'in September 2026.Changes
weekly-review.ts— declareconst rm = getCurrentRiksmote(today)(import already present) and use it in Step 2 typed fetchers and Step 4 speech search (4 call sites)monthly-review.ts— addimport { getCurrentRiksmote } from './motions.js', declareconst rm = getCurrentRiksmote(today), replace 3 hardcoded values in Step 2 fetcherspropositions.ts— add same import, replace 1 inline hardcoded value insearchSpeechesgetCurrentRiksmoteuses 0-based month>= 8to determine session boundary, consistent withmotions.ts,committee-reports.ts, andmonth-ahead.ts.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.