Import Action Network events (incl. campaign events) with scheduled refresh#462
Merged
Conversation
…uled refresh
Action Network data sources can now import events, not just people. Events
can live in two places — the flat /events collection and inside event
campaigns — and some events only appear via a campaign, so the adaptor crawls
event campaigns first (capturing each campaign's title) then the flat
collection, deduping by event id. Events arrive geocoded by Action Network, so
new event sources default to Coordinates geocoding with title/start_date roles.
Events have no webhook, so they are kept up to date by a daily scheduled
re-import sweep, mirroring how Zetkin sources are refreshed.
- Add recordType ("people" | "events") to the Action Network config, with a
migration backfilling existing sources to "people"
- Two-crawl + dedupe event fetch, normalizeEvent, read-only guards
- importActionNetworkEventDataSources sweep job, registered + scheduled at 5am
- People/Events selector in the new data source form
- Mocked unit tests for the crawl/dedupe/read-only behaviour
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
Adds event import to the Action Network data source adaptor (previously people-only), plus a daily scheduled refresh since Action Network has no events webhook.
Why the two-crawl approach
Action Network events live in two places: the flat
/api/v2/eventscollection and inside event campaigns (/event_campaigns/{id}/events). Some events only appear via a campaign. Verified against a real key:/eventsImporting from
/eventsalone would miss ~68% of events. So the adaptor crawls campaigns first (capturing each campaign's title), then the flat collection, deduping by event id. A live run of the adaptor yielded 37 events, all geocoded, 27 with campaign names, zero duplicates.Changes
recordType: "people" | "events"on the Action Network config (defaults topeople), with a migration backfilling existing sources topeople.normalizeEventflattens title/dates/status/venue/address/postcode and Action Network's server-side coordinates;fetchFirstworks for campaign-only orgs; events are read-only (no write-back / tagging).Coordinatesgeocoding onlatitude/longitudewithtitleas name andstart_dateas date column — map-ready with no geocoding pass.importActionNetworkEventDataSourcessweep job (mirrorsimportZetkinDataSources), registered in the worker and scheduled at 5am daily.Scope
Read-only import (no attendances/RSVPs, no write-back) and daily cron refresh (no live webhook — Action Network doesn't offer one for events).
Migration
Run
npm run migrateto apply1784819176587_action_network_config_record_type.🤖 Generated with Claude Code