Skip to content

chore: sync national chapters from live API - #1091

Merged
Wituareard merged 5 commits into
mainfrom
agents/sync-national-chapters-with-api
Sep 8, 2026
Merged

chore: sync national chapters from live API#1091
Wituareard merged 5 commits into
mainfrom
agents/sync-national-chapters-with-api

Conversation

@Wituareard

Copy link
Copy Markdown
Collaborator

Summary

Adds pnpm sync:national-chapters, a script that reconciles national-chapters.json against the live API at https://pauseai.info/api/national-groups (the same data source the /communities page endpoint proxies), plus a scheduled GitHub Actions workflow that opens a PR when they drift.

What changed

  • scripts/sync-national-chapters.ts — single-file script:
    • Fetches groups from the live API (no Airtable dependency; no credentials needed).
    • Merges non-invasively: existing entries keep their file order and are only touched when a link is outdated; new countries are appended at the end; delisted countries are removed.
    • Geocodes only new countries (Nominatim, 1 req/s, descriptive User-Agent/From headers).
    • NAME_OVERRIDES pins Czech RepublicCzechia so local Czech groups in pauseai-communities.json stay grouped under the chapter (they match via parent_name.includes(chapter.name)).
    • EXCLUDED_COUNTRIES: United States stays out (removed in Remove PauseAI US communities from the communities page #1056); --allow "United States" re-adds.
    • Flags: --check (exit 1 on drift, no writes), --dry-run (print without writing).
  • .github/workflows/sync-national-chapters.yml — daily 06:00 UTC + manual dispatch. Runs the sync in write mode so peter-evans/create-pull-request@v8 can commit any diff to the sync-national-chapters branch as a reviewable PR (no-op when in sync). No secrets required.
  • package.jsonsync:national-chapters script.
  • national-chapters.json — refreshed output: 15 → 19 chapters. Original 15 entries keep their order; 4 stale links updated in place (Germany, Italy — placeholder $$WHATSAPP_ITALY$$ resolved, Poland, Romania); Belgium, Ghana, Ireland, Switzerland appended (these live groups have no platform links yet, so mailto: is faithful to the API — future Airtable link updates flow through automatically on the next run).

Validation

  • Script: --check exits 0 in sync / 1 on drift (verified with a mutated link); --dry-run non-destructive; plain run regenerates correctly.
  • pnpm check: 0 errors (only pre-existing svelte warnings).
  • pnpm lint: passes (only pre-existing LanguageSwitcher warnings).
  • pnpm test: 51/51 pass.

Notes for reviewers

  • Run locally with pnpm sync:national-chapters -- --dry-run to preview.
  • Merges are not auto-created: every change lands as a PR for review.

Add pnpm sync:national-chapters, a script that reconciles
src/routes/communities/national-chapters.json against
https://pauseai.info/api/national-groups.

- Merges non-invasively: updates links in place for existing
  chapters, appends new countries at the end, preserves file order
- Geocodes only new countries via Nominatim
- NAME_OVERRIDES pins 'Czech Republic' to 'Czechia' so local
  Czech groups stay grouped under the chapter
- Excludes United States (removed in #1056); --allow re-adds
- --check exits 1 on drift, --dry-run prints without writing
- Daily GitHub Actions workflow opens a PR on the
  sync-national-chapters branch when the script writes changes

Refreshes the JSON: 15 -> 19 chapters, 4 stale links updated
(Germany, Italy, Poland, Romania), Belgium/Ghana/Ireland/
Switzerland appended.
@netlify

netlify Bot commented Sep 8, 2026

Copy link
Copy Markdown

Deploy Preview for pauseai ready!

Name Link
🔨 Latest commit dc277ff
🔍 Latest deploy log https://app.netlify.com/projects/pauseai/deploys/6aa05d457c8a7500084cb266
😎 Deploy Preview https://deploy-preview-1091--pauseai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 63 (🔴 down 5 from production)
Accessibility: 91 (no change from production)
Best Practices: 100 (no change from production)
SEO: 82 (no change from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@Wituareard
Wituareard force-pushed the agents/sync-national-chapters-with-api branch from 9bc77aa to f9abb25 Compare September 8, 2026 19:04
@Wituareard
Wituareard enabled auto-merge (squash) September 8, 2026 19:09
@Wituareard
Wituareard merged commit 47c18a0 into main Sep 8, 2026
8 of 9 checks passed
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