Skip to content

feat(events-crawler): stage West Vancouver Memorial Library behind an enabled flag - #83

Merged
ltanafranca1004 merged 1 commit into
mainfrom
feat/events-crawler-westvan
Jul 31, 2026
Merged

feat(events-crawler): stage West Vancouver Memorial Library behind an enabled flag#83
ltanafranca1004 merged 1 commit into
mainfrom
feat/events-crawler-westvan

Conversation

@ltanafranca1004

@ltanafranca1004 ltanafranca1004 commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

What & why

West Vancouver Memorial Library runs The Events Calendar (Tribe) on the exact REST shape the five Phase-1 orgs already use, so adding it needs no adapter code — a registry entry and an image allowlist. First of four Phase-2 PRs from the 2026-07-29 source-scoping round.

Verified live against the crawler's own URL shape (per_page=25 + start_date + end_date across a 4-month window):

total reported: 456 | returned: 25
  - 'In the Gallery: At the Table…'      venue='Art Gallery & Lower Level'  img=yes
  - 'Device Clinic'                      venue='The Lab'                    img=yes
  - 'Outdoor Family Storytime | All Ages' venue='Swáy̓wi Temíxw (rooftop)'  img=yes

Every event carries a venue and a real featured image, so all three cover tiers and the venue→event_type logic work unchanged.

Decisions baked in

The new org lands enabled: false. The weekly cron is live20260724120000_events_crawler_cron.sql, pg_cron jobid 18, events-crawler-weekly, Mondays 14:00 UTC, active = true. That makes deploying this function the act that puts a new org into production: the next run would auto-publish it into the shared events table the mobile app reads. Landing new orgs disabled decouples "merged" from "live", leaving activation as its own one-line reviewable change — which needs Savar's sign-off per CLAUDE.md Decision Authority (Activating anything that writes to shared production tables automatically).

The fan-out iterates ACTIVE_ORGS, so a disabled org is genuinely inert, not merely missing from the response counts.

Image hosts are allowlisted now, ahead of activation, so flipping enabled later needs no accompanying web-side change.

Relevance filtering is deliberately not in this PR. West Van is a public library, not a settlement agency, so its calendar mixes relevant programming (Device Clinic, English conversation) with toddler storytimes and Pride Bingo. A keyword relevance filter for library sources lands with the Phase-2 adapter work; this org stays disabled until then, so nothing unfiltered can reach the Events tab.

Changes

  • supabase/functions/events-crawler/index.ts — add Org.enabled (documented against the live cron), mark the five Phase-1 orgs enabled: true, add westvan-library as enabled: false, and derive ACTIVE_ORGS for the fetch fan-out.
  • next.config.ts — allowlist westvanlibrary.ca + www.westvanlibrary.ca in images.remotePatterns (apex + www, matching the existing Phase-1 convention).

⚠️ Coordination

Nothing here changes production. No migration, cron job, Vault secret, or DB object was touched, and the function was not deployed. The new source only goes live when someone both deploys events-crawler and flips enabled — both of which need Savar's sign-off, since they write into shared mobile-facing data.

Verification

Check Result
deno check --node-modules-dir=auto supabase/functions/*/index.ts supabase/functions/_shared/*.ts clean
npx tsc --noEmit clean (0 lines)
npx eslint next.config.ts clean
git diff --name-only origin/main | grep -E 'migrations|backfills' empty
Live feed probe (crawler's URL shape) 456 events, 25 returned, venues + images present

Note: tsc and eslint do not cover supabase/functions/** (tsconfig exclude, eslint globalIgnores) — they validate the next.config.ts change only. deno check is the gate that sees the crawler, and it is currently weakened by the file's // @ts-nocheck; removing that lands in the next PR alongside the adapter refactor.

Reviewer notes

  • ACTIVE_ORGS is computed once at module scope. That's intentional — the registry is static, and a per-request filter would imply runtime configurability the design doesn't have.
  • Two Phase-1 orgs already had non-www and www hosts allowlisted separately; West Van follows the same pattern rather than introducing a wildcard.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added support for preparing event content from West Vancouver Memorial Library as an additional source.
  • Bug Fixes
    • Improved event processing so only currently enabled sources are included in event updates and reporting.
  • Improvements
    • Enhanced support for displaying images from the new event source when it becomes active.

… enabled flag

West Van Memorial Library runs The Events Calendar (Tribe) on the same REST shape the
five Phase-1 orgs use, so it needs no adapter code — only a registry entry and an image
allowlist. Verified live against the crawler's exact URL shape (per_page + start_date +
end_date over a 4-month window): 456 upcoming events, 25 returned, every one carrying a
venue and a real featured image.

Adds `Org.enabled` and lands the new org disabled. This matters because the weekly cron
is LIVE (20260724120000_events_crawler_cron.sql — pg_cron jobid 18, Mondays 14:00 UTC),
which makes deploying this function the act that puts a new org into production: the next
run would auto-publish it into the shared events table the mobile app reads. Landing it
disabled decouples "the code is merged" from "the source is live", so activation stays a
separate one-line change gated on Savar's sign-off, per CLAUDE.md Decision Authority.
The fan-out now iterates ACTIVE_ORGS, so a disabled org is genuinely inert rather than
merely absent from the response counts.

West Van is a public library rather than a settlement agency, so its calendar mixes
relevant programming (Device Clinic, English conversation) with toddler storytimes and
Pride Bingo. A relevance filter for library sources lands with the Phase-2 adapter work;
keeping this org disabled until then means nothing unfiltered can reach the Events tab.

The image hosts are allowlisted now rather than at activation, so flipping `enabled`
later needs no accompanying web-side change.

No migration, cron, or DB object touched. Nothing deployed.

Verification:
  deno check --node-modules-dir=auto supabase/functions/*/index.ts supabase/functions/_shared/*.ts  → clean
  npx tsc --noEmit  → clean (0 lines)
  npx eslint next.config.ts  → clean
  git diff --name-only origin/main | grep -E 'migrations|backfills'  → empty

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web-app Ready Ready Preview Jul 31, 2026 3:15pm

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: db18ee30-218d-4ea5-b262-46b531a0877d

📥 Commits

Reviewing files that changed from the base of the PR and between 915fde3 and 485b578.

📒 Files selected for processing (2)
  • next.config.ts
  • supabase/functions/events-crawler/index.ts

Walkthrough

The change stages West Vancouver Memorial Library as a disabled crawler organization. It adds activation filtering to crawler execution and allows images from the library’s domains.

Changes

Phase 2 organization staging

Layer / File(s) Summary
Organization configuration and image hosts
supabase/functions/events-crawler/index.ts, next.config.ts
Adds the Org.enabled field, marks existing organizations enabled, stages West Vancouver Memorial Library as disabled, and allowlists its HTTPS image hosts.
Active organization crawl filtering
supabase/functions/events-crawler/index.ts
Uses ACTIVE_ORGS for concurrent crawling, results, and per-organization counts.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • UnifyCN/web-app#74: Extends the events crawler organization configuration and image-host allowlist used to stage West Vancouver Memorial Library.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes staging West Vancouver Memorial Library behind an enabled flag, which is the primary change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/events-crawler-westvan

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ltanafranca1004
ltanafranca1004 merged commit e9c01dd into main Jul 31, 2026
4 checks passed
@ltanafranca1004
ltanafranca1004 deleted the feat/events-crawler-westvan branch July 31, 2026 15:18
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