Skip to content

Comments

fix: prebuild entry point, 3 failing integration tests, and duplicate workflow headings#513

Merged
pethers merged 2 commits intoreduceconflictsfrom
copilot/sub-pr-512
Feb 24, 2026
Merged

fix: prebuild entry point, 3 failing integration tests, and duplicate workflow headings#513
pethers merged 2 commits intoreduceconflictsfrom
copilot/sub-pr-512

Conversation

Copy link
Contributor

Copilot AI commented Feb 24, 2026

The prebuild script silently did nothing because it invoked the barrel re-export (scripts/generate-news-indexes.ts) instead of the actual executable entry point — so npm run prebuild never generated index files. This caused 3 integration tests to fail with ENOENT after news/index*.html was removed from git tracking.

Changes

  • package.json — Fix prebuild to invoke scripts/generate-news-indexes/index.ts (executable) instead of the barrel re-export
  • tests/news-realtime-monitor.test.ts — Add beforeAll/afterAll to "Real-world Integration Tests" that generates then cleans up index files at test time; tracks only newly created files to avoid deleting pre-existing ones; logs unexpected cleanup errors rather than silencing all of them
  • .github/workflows/news-committee-reports.md — Rename duplicate "Step 5: Validate & Create PR" → "Step 5: Build-time Generation Note"; extend note with local npm run prebuild instruction
  • .github/workflows/news-week-ahead.md — Extend build-time generation note to tell agents to run npm run prebuild (or npm run build) on a fresh checkout when they need to preview/validate derived outputs
// beforeAll in "Real-world Integration Tests"
beforeAll(() => {
  const ROOT_DIR = path.join(__dirname, '..');
  const before = new Set(fs.readdirSync(NEWS_DIR).filter(f => f.startsWith('index') && f.endsWith('.html')));
  execSync('npx tsx scripts/generate-news-indexes/index.ts', { cwd: ROOT_DIR, stdio: 'pipe' });
  const after = fs.readdirSync(NEWS_DIR).filter(f => f.startsWith('index') && f.endsWith('.html'));
  GENERATED_INDEX_FILES.push(...after.filter(f => !before.has(f)));
}, 30000);

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

- Fix prebuild script to use correct entry point (scripts/generate-news-indexes/index.ts instead of the barrel re-export)
- Add beforeAll/afterAll in Real-world Integration Tests to generate and clean up index files since they are no longer committed to git
- Rename duplicate 'Validate & Create PR' heading in news-committee-reports.md to 'Build-time Generation Note'
- Extend build-time generation notes in news-committee-reports.md and news-week-ahead.md with local npm run prebuild instruction

Co-authored-by: pethers <[email protected]>
Copilot AI changed the title [WIP] Refactor derived files to build-time generation fix: prebuild entry point, 3 failing integration tests, and duplicate workflow headings Feb 24, 2026
Copilot AI requested a review from pethers February 24, 2026 23:50
@pethers pethers marked this pull request as ready for review February 24, 2026 23:51
@pethers pethers merged commit eb57581 into reduceconflicts Feb 24, 2026
@pethers pethers deleted the copilot/sub-pr-512 branch February 24, 2026 23:51
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.

2 participants