Skip to content

Comments

Refactor news workflows and update article generation#177

Merged
pethers merged 9 commits intomainfrom
news23
Feb 14, 2026
Merged

Refactor news workflows and update article generation#177
pethers merged 9 commits intomainfrom
news23

Conversation

@pethers
Copy link
Member

@pethers pethers commented Feb 14, 2026

Refactor news generation workflows for improved clarity and efficiency, remove obsolete files, and update article types and language options to enhance generation schedules and descriptions. Adjust documentation to reflect these changes.

pethers and others added 7 commits February 14, 2026 21:44
- Deleted `REFACTORING_SUMMARY.md` and `IMPLEMENTATION_SUMMARY.md` as they are no longer needed.
- Updated `WORKFLOWS.md` to reflect changes in news generation workflows, consolidating agentic workflows and improving clarity.
- Removed `LANGUAGE_OPTIONS_TESTING.md` references to outdated language handling logic.
- Deleted unused screenshots: `economist-style-article-screenshot.png` and `risk-dashboard-screenshot.png`.
- Removed `tests/workflows/news-generation.test.js` as it is no longer applicable after workflow refactoring.
- Updated `news/metadata/README.md` to align with current workflow coordination and error logging practices.
@github-actions
Copy link
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
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

Copy link
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.

Pull request overview

This PR refactors the news generation system by removing the traditional GitHub Actions-based workflow (news-generation.yml) and its supporting files, consolidating entirely on three complementary GitHub Agentic Workflows. The changes update workflow schedules, article type defaults, language defaults, and documentation to reflect this architectural shift.

Changes:

  • Removes obsolete traditional workflow, test files, and implementation summaries (7 files deleted)
  • Adds weekend schedules to agentic workflows (realtime-monitor: Sat-Sun 12:00 UTC; evening-analysis: Saturday 16:00 UTC for weekly wrap-up)
  • Changes default language from "en,sv" to "all" (14 languages) across all agentic workflows
  • Updates documentation to reflect agentic-only architecture and remove traditional workflow references

Reviewed changes

Copilot reviewed 17 out of 19 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/workflows/news-generation.test.js Removed test file for traditional workflow (430 lines) - tests migrated to agentic-specific files
risk-dashboard-screenshot.png Removed obsolete documentation screenshot
economist-style-article-screenshot.png Removed obsolete documentation screenshot
news/metadata/workflow-state.json Updated note to remove "traditional workflow" reference
news/metadata/README.md Updated to document agentic-only architecture, removed traditional workflow references
news/metadata/IMPLEMENTATION_SUMMARY.md Removed obsolete implementation summary (299 lines)
REFACTORING_SUMMARY.md Removed obsolete refactoring summary (218 lines)
NORWEGIAN_LANGUAGE_STANDARDIZATION.md Removed obsolete language standardization doc (104 lines)
docs/LANGUAGE_OPTIONS_TESTING.md Updated example to reference agentic workflows and bash tool usage
WORKFLOWS.md Updated to reflect 15 workflows (down from 16), removed traditional workflow section, updated agentic workflow descriptions
MODULAR_NEWS_ARCHITECTURE.md Updated reference from "Existing Workflow" to "Agentic Workflows"
MULTI_LANGUAGE_STATUS.md Updated example from traditional workflow YAML to CLI usage
.github/workflows/news-realtime-monitor.md Added weekend schedule (12:00 UTC Sat-Sun), changed default language to "all", enhanced government activity detection
.github/workflows/news-realtime-monitor.lock.yml Compiled version with gh-aw v0.44.0, reflects weekend schedule changes
.github/workflows/news-evening-analysis.md Added Saturday weekly wrap-up schedule (16:00 UTC), enhanced instructions for weekly vs daily analysis
.github/workflows/news-evening-analysis.lock.yml Compiled version with gh-aw v0.44.0, reflects Saturday schedule
.github/workflows/news-article-generator.md Changed default article types and language to "all", added day-of-week scheduling logic and documentation
.github/workflows/news-article-generator.lock.yml Compiled version with gh-aw v0.44.0, reflects updated defaults
.github/workflows/news-generation.yml Removed traditional workflow file (477 lines) - replaced by agentic workflows

Comment on lines 12 to 345
@@ -18,7 +18,7 @@ on:
languages:
description: 'Languages to generate (en,sv | nordic | eu-core | all | custom comma-separated)'
required: false
default: en,sv
default: all

permissions:
contents: read
@@ -82,17 +82,25 @@ Generate news articles based on the latest data from riksdag-regering-mcp server
### Workflow Inputs

Check the GitHub event inputs:
- **article_types**: Available from `github.event.inputs.article_types` (default: week-ahead if not provided)
- **article_types**: Available from `github.event.inputs.article_types` (if empty, uses day-of-week schedule — see below)
- **force_generation**: Available from `github.event.inputs.force_generation` (default: false if not provided)
- **languages**: Available from `github.event.inputs.languages` (default: en,sv if not provided)
- **languages**: Available from `github.event.inputs.languages` (default: all — all 14 languages)

### Day-of-Week Article Schedule (when article_types not specified)

| Day | Article Types | Rationale |
|-----|--------------|-----------|
| **Monday–Thursday** | `committee-reports,propositions,motions` | Active parliamentary days |
| **Friday** | `week-ahead,committee-reports,propositions,motions` | Parliamentary activity + next week preview |
| **Saturday–Sunday** | `committee-reports,propositions,motions` | Government/Riksdag document monitoring (press releases, crisis, SOU) |

### Language Options

The `languages` input supports:
- **en,sv** (default) - English and Swedish only
- **en,sv** - English and Swedish only
- **nordic** - Nordic languages: en,sv,da,no,fi
- **eu-core** - EU core languages: en,sv,de,fr,es,nl
- **all** - All 14 languages: en,sv,da,no,fi,de,fr,es,nl,ar,he,ja,ko,zh
- **all** (default) - All 14 languages: en,sv,da,no,fi,de,fr,es,nl,ar,he,ja,ko,zh
- **custom** - Any comma-separated list (e.g., "en,sv,de,fr")

### Article Types to Generate
@@ -273,10 +281,10 @@ For the data retrieved:
First, parse the `languages` input from `github.event.inputs.languages` and expand presets:

```bash
# Get languages input (default: en,sv)
# Get languages input (default: all 14 languages)
LANGUAGES_INPUT="${{ github.event.inputs.languages }}"
if [ -z "$LANGUAGES_INPUT" ]; then
LANGUAGES_INPUT="en,sv"
LANGUAGES_INPUT="all"
fi

# Trim and normalize the input before preset expansion
@@ -307,13 +315,33 @@ echo "📋 Final languages: $LANG_ARG"

#### Run Automated News Generation Script

Use the `generate-news-enhanced.js` script to generate articles for all requested types and languages:
Use the `generate-news-enhanced.js` script to generate articles for the appropriate types and languages:

```bash
# Get article types input
# Get article types input — use day-of-week schedule if not manually specified
ARTICLE_TYPES="${{ github.event.inputs.article_types }}"
if [ -z "$ARTICLE_TYPES" ]; then
ARTICLE_TYPES="week-ahead"
DAY_OF_WEEK=$(date -u +"%u") # 1=Monday, 7=Sunday

case "$DAY_OF_WEEK" in
5)
# Friday: parliamentary activity + next week preview
ARTICLE_TYPES="week-ahead,committee-reports,propositions,motions"
echo "📅 Friday schedule: week-ahead preview + parliamentary activity"
;;
6|7)
# Weekend: Riksdag closed but government may publish press releases,
# crisis communications, SOU reports, or other urgent documents.
# Check for new committee reports, propositions, and motions.
ARTICLE_TYPES="committee-reports,propositions,motions"
echo "📅 Weekend schedule: government & riksdag document monitoring"
;;
*)
# Monday-Thursday: active parliamentary days
ARTICLE_TYPES="committee-reports,propositions,motions"
echo "📅 Weekday schedule: parliamentary activity coverage"
;;
esac
fi
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

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

The day-of-week article type scheduling logic on lines 321-345 will never execute for scheduled runs because the article_types input has a default value (line 12 in frontmatter).

When triggered by schedule: daily, github.event.inputs.article_types will use the default value week-ahead,committee-reports,propositions,motions, so the bash check if [ -z "$ARTICLE_TYPES" ] will always be false.

To fix this, either:

  1. Remove the default: from the article_types input (line 12) so scheduled runs use day-of-week logic, OR
  2. Remove the day-of-week logic and documentation if the default value is intentional

The documentation on lines 85 and 89-95 suggests the day-of-week schedule should apply to scheduled runs, which implies option 1 is correct.

Copilot uses AI. Check for mistakes.
WORKFLOWS.md Outdated
Comment on lines 480 to 495
**Triggers:**
- **Manual:** Schedule (daily), Workflow dispatch
- **Agentic:** Schedule (daily 05:51 UTC), Workflow dispatch
- **Article Generator:** Daily ~05:51 UTC, Workflow dispatch
- **Realtime Monitor:** 10:00 + 14:00 UTC Mon-Fri, Workflow dispatch
- **Evening Analysis:** 18:00 UTC Mon-Fri, Workflow dispatch

**Purpose:** Automated political news article generation from riksdag-regering-mcp data
**Purpose:** AI-powered political news article generation from riksdag-regering-mcp data using GitHub Agentic Workflows (gh-aw) with Claude Opus 4.

### Overview

Riksdagsmonitor features **dual news generation pipelines**:
Riksdagsmonitor uses **three complementary agentic workflows** for full-day news coverage:

1. **Manual Workflow** (`news-generation.yml`) - Script-based generation
2. **Agentic Workflow** (`news-article-generator.lock.yml`) - AI-powered generation with Claude Opus 4
| Workflow | Schedule | Purpose |
|----------|----------|---------|
| `news-article-generator.lock.yml` | ~05:51 UTC daily | General article generation (all types) |
| `news-realtime-monitor.lock.yml` | 10:00 + 14:00 UTC Mon-Fri | Breaking news / live monitoring |
| `news-evening-analysis.lock.yml` | 18:00 UTC Mon-Fri | Deep evening analysis wrap-up |
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

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

The WORKFLOWS.md documentation doesn't reflect the updated schedules for the agentic workflows:

  1. Realtime Monitor: Now runs 3 times (10:00 + 14:00 UTC Mon-Fri, plus 12:00 UTC Sat-Sun for weekend government press releases), but the table and text only mention "10:00 + 14:00 UTC Mon-Fri"

  2. Evening Analysis: Now runs twice (18:00 UTC Mon-Fri for daily wrap-up, plus 16:00 UTC Saturday for weekly review), but the table and text only mention "18:00 UTC Mon-Fri"

The schedules described on lines 482-483 and in the table on lines 491-495 should be updated to match the actual cron schedules defined in the .md workflow files.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
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
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 c73e405 into main Feb 14, 2026
14 checks passed
@pethers pethers deleted the news23 branch February 14, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant