Repository navigation
Add Brockville Food Help analytics, mirroring Kingston (1.36.0) - #10
Merged
Merged
Conversation
…36.0) Parameterize the Kingston collector by profile and add Brockville: v3 ingestion from https://brockville.food-help.ca only, additive migration 0019 (bfh_daily, bfh_outreach_daily) and GET /report?view=bfh returning exactly report 1.2. Kingston behavior is unchanged.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
buscore-lighthouse | a4edfe2 | Commit Preview URL Branch Preview URL |
Oct 10 2026, 02:06 PM |
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.
Before: Lighthouse only accepts the Kingston collector. Brockville Food Help has analytics disabled, and events from
https://brockville.food-help.caare dropped.After: Brockville is a second aggregate-only community that mirrors Kingston: ingestion v3 from
https://brockville.food-help.caonly, the same six events and the same labels, no product signals (resource_openandinstall_promptare rejected). It has its own site key (brockville_food_help), tables and report (GET /report?view=bfh, exactly report 1.2). Kingston behavior, tables andview=kfhare unchanged.How:
kfhAnalytics.tsnow takes aKfhProfile(site key, origins, tables, signals and legacy flags) with Kingston as the default, so Brockville reuses the parser, atomic batch, body and rate limits instead of copying them.isKfhReport(value, siteKey)makes the two reports mutually invalid, and Brockville accepts only 1.2. Brockville is excluded from raw-event storage,view=site, fleet and source-health like Kingston, and its CORS never allows credentials. The cron prunes each community independently at 400 days.Files:
src/kfhContract.ts,src/kfhAnalytics.ts,src/index.ts(tracked site and origin allowlist,view=bfh, ingest routing by origin, CORS, prune),migrations/0019_add_bfh_daily.sql,contracts/bfh-v1/{empty,sample,unavailable}.json,tests/bfh-analytics.test.mjs,tests/release-control.test.mjs(version pin), plusKFH_ANALYTICS_CONTRACT.md,SOT.md,CHANGELOG.md,OPERATIONS.md,README.md,package.jsonandpackage-lock.json(1.35.0 to 1.36.0).Checks:
npm run typecheckclean;npm test228/228 (7 new Brockville tests: strict v3, key and origin isolation, signals rejected, rollback, no-store auth route, retention, fixture parity). No remote database, production request or deployment was made. The Workers Builds check on this branch uploads a non-promoting preview version only.Migration 0019 is additive:
bfh_dailyandbfh_outreach_daily, same columns and constraints as 0016 and 0017. It is not applied. Migration 0017's production state is still unverified, and Kingston's v3 path depends on it.Rollout, each step separately approved
brockville-bfh-command)./bfhreports unavailable until step 4.main. An approved/bfhread should showno_observed_historywith zero counts. Promoting before 0019 is safe: Brockville events are dropped and/bfhis unavailable, Kingston is unaffected.release/brockville.Rollback: set Brockville
analytics.enabledback to false and re-release the site, then redeploy Lighthouse 1.35.0 (or 1.34.1). Smith simply reports/bfhunavailable. Do not drop the additive tables.Food Help block (later, not part of this PR). In
deployments/brockville/site.json, replace"analytics": { "enabled": false }with:It omits the three optional signal payloads, so none are sent. Release step: after the Food Help PR is reviewed and merged,
npm run release -- --site deployments/brockville --publishmoves onlyrelease/brockville(separate approval). Add a Food Help test that imports this parser and asserts every emitted Brockville payload parses. Verify with a local collector first: a live test view is permanently counted and cannot be removed by identity.https://brockville.food-help.caserves publicly today (page title "Brockville Food Help"); the Pages project and DNS are live.