Skip to content

chore(format): apply prettier to ADR 0005#1346

Open
jakebromberg wants to merge 1 commit into
mainfrom
chore/prettier-adr-0005
Open

chore(format): apply prettier to ADR 0005#1346
jakebromberg wants to merge 1 commit into
mainfrom
chore/prettier-adr-0005

Conversation

@jakebromberg

Copy link
Copy Markdown
Member

One-line prettier normalization of docs/adr/0005-album-condition-state-machine.md. The file has been silently unformatted since it was committed; the local prettier cache hid it. Surfaces as a format:check failure on any CI run with a fresh cache (e.g. the venue-events-scraper PR #1345).

No semantic changes — diff is 7 lines of whitespace / list-marker normalization. Pre-merge so other in-flight PRs against main pick up a green format check.

Test plan

  • Pre-push: npm run format:check clean
  • CI green on PR

Brings the file into conformance with the prettier config that the
format:check CI step enforces. No semantic changes — only whitespace
and list-marker normalization. Pre-existing drift was hidden by the
local prettier cache; surfaces on any fresh CI run.
jakebromberg added a commit that referenced this pull request Jun 9, 2026
…ce_id, MusicEvent, Etix split, location/date validation, exit guard, error tagging

Iteration-1 hardening pass addressing review of PR #1348.

Correctness / data integrity:
- parse.ts: prepend `venue.site_slug` to `source_id` so two RHP sites sharing
  the same `/event/<slug>/` pathname don't collide on `(source, source_id)`
  UPSERT and silently overwrite each other.
- parse.ts: accept `@type: 'MusicEvent'` (already declared in SchemaEvent
  type) — was rejected at runtime.
- parse.ts: anchor the Etix supporting-act split on the slugified headliner
  prefix instead of the literal `with-` substring so band names containing
  "with" as a word (e.g. "Out With My Friends") don't generate phantom
  support acts.
- parse.ts: validate `location` per docstring + reject unparseable
  `startDate` + cap `name` at the 256-char column ceiling, so source-format
  drift fails loudly at parse time instead of producing mis-attributed rows
  or a cryptic "invalid input syntax for type timestamp" in the INSERT
  path.
- parse.ts: scope `extractEventLinks` to the site's `baseUrl` and resolve
  links through the URL parser so cross-origin sister-venue / partner
  cross-promo links can't pull foreign events into the current site loop,
  query-string suffixes can't produce 404 paths, and uppercase / underscore
  / non-ASCII slugs aren't silently dropped.
- writer.ts: drop the SELECT-then-INSERT in `ensureVenue`; use a single
  INSERT … ON CONFLICT DO UPDATE that refreshes name/city/state/address
  on every call. A later `VENUE_SEEDS` entry now lifts a placeholder row
  rather than getting permanently shadowed by the stale "Unknown / NC"
  default. `created` is now computed from `xmax = 0` so concurrent runners
  don't both claim the create.

Observability:
- orchestrate.ts + job.ts: split the conflated `write_error` tag into
  `venue_resolve_error` (lookup-path) and `upsert_error` (INSERT-path) so
  a DB-connectivity / venues-table incident is distinguishable from an
  enum-drift / FK-contention incident in dashboards.
- job.ts: tighten the non-zero-exit guard. Index fetches succeeding while
  every per-event step fails was previously exit 0 (cron monitor stayed
  green for a wholesale outage). Now exit 1 when `events_seen > 0` and
  `upserts_total == 0`.

Operational:
- rhp-fetch.ts: 5xx / AbortError retry now pauses 500ms + ~0..500ms jitter
  instead of firing immediately, so a struggling origin doesn't see
  concurrency×2 requests per worker on a flap.

Tests:
- parse.test.ts: new regressions for cross-site collision, MusicEvent
  acceptance, headliner-contains-with split, location validation,
  unparseable startDate, name-length cap, cross-origin link filtering,
  query-string normalization, uppercase-slug acceptance.
- orchestrate.test.ts: split write_error tests into venue_resolve_error
  vs upsert_error; updated SiteTotals shape.
- writer.test.ts: ensureVenue tests for xmax-driven `created` + the
  placeholder-lift behavior.
- database.mock.ts: add missing `added_at` / `last_modified` columns to
  the venues mock.

All 83 unit tests pass; lint 0 errors; format clean for the changed files.
The pre-existing `docs/adr/0005-album-condition-state-machine.md`
prettier drift is owned by PR #1346 and is left untouched here.
jakebromberg added a commit that referenced this pull request Jun 9, 2026
…ce_id, MusicEvent, Etix split, location/date validation, exit guard, error tagging

Iteration-1 hardening pass addressing review of PR #1348.

Correctness / data integrity:
- parse.ts: prepend `venue.site_slug` to `source_id` so two RHP sites sharing
  the same `/event/<slug>/` pathname don't collide on `(source, source_id)`
  UPSERT and silently overwrite each other.
- parse.ts: accept `@type: 'MusicEvent'` (already declared in SchemaEvent
  type) — was rejected at runtime.
- parse.ts: anchor the Etix supporting-act split on the slugified headliner
  prefix instead of the literal `with-` substring so band names containing
  "with" as a word (e.g. "Out With My Friends") don't generate phantom
  support acts.
- parse.ts: validate `location` per docstring + reject unparseable
  `startDate` + cap `name` at the 256-char column ceiling, so source-format
  drift fails loudly at parse time instead of producing mis-attributed rows
  or a cryptic "invalid input syntax for type timestamp" in the INSERT
  path.
- parse.ts: scope `extractEventLinks` to the site's `baseUrl` and resolve
  links through the URL parser so cross-origin sister-venue / partner
  cross-promo links can't pull foreign events into the current site loop,
  query-string suffixes can't produce 404 paths, and uppercase / underscore
  / non-ASCII slugs aren't silently dropped.
- writer.ts: drop the SELECT-then-INSERT in `ensureVenue`; use a single
  INSERT … ON CONFLICT DO UPDATE that refreshes name/city/state/address
  on every call. A later `VENUE_SEEDS` entry now lifts a placeholder row
  rather than getting permanently shadowed by the stale "Unknown / NC"
  default. `created` is now computed from `xmax = 0` so concurrent runners
  don't both claim the create.

Observability:
- orchestrate.ts + job.ts: split the conflated `write_error` tag into
  `venue_resolve_error` (lookup-path) and `upsert_error` (INSERT-path) so
  a DB-connectivity / venues-table incident is distinguishable from an
  enum-drift / FK-contention incident in dashboards.
- job.ts: tighten the non-zero-exit guard. Index fetches succeeding while
  every per-event step fails was previously exit 0 (cron monitor stayed
  green for a wholesale outage). Now exit 1 when `events_seen > 0` and
  `upserts_total == 0`.

Operational:
- rhp-fetch.ts: 5xx / AbortError retry now pauses 500ms + ~0..500ms jitter
  instead of firing immediately, so a struggling origin doesn't see
  concurrency×2 requests per worker on a flap.

Tests:
- parse.test.ts: new regressions for cross-site collision, MusicEvent
  acceptance, headliner-contains-with split, location validation,
  unparseable startDate, name-length cap, cross-origin link filtering,
  query-string normalization, uppercase-slug acceptance.
- orchestrate.test.ts: split write_error tests into venue_resolve_error
  vs upsert_error; updated SiteTotals shape.
- writer.test.ts: ensureVenue tests for xmax-driven `created` + the
  placeholder-lift behavior.
- database.mock.ts: add missing `added_at` / `last_modified` columns to
  the venues mock.

All 83 unit tests pass; lint 0 errors; format clean for the changed files.
The pre-existing `docs/adr/0005-album-condition-state-machine.md`
prettier drift is owned by PR #1346 and is left untouched here.
jakebromberg added a commit that referenced this pull request Jun 9, 2026
…ce_id, MusicEvent, Etix split, location/date validation, exit guard, error tagging

Iteration-1 hardening pass addressing review of PR #1348.

Correctness / data integrity:
- parse.ts: prepend `venue.site_slug` to `source_id` so two RHP sites sharing
  the same `/event/<slug>/` pathname don't collide on `(source, source_id)`
  UPSERT and silently overwrite each other.
- parse.ts: accept `@type: 'MusicEvent'` (already declared in SchemaEvent
  type) — was rejected at runtime.
- parse.ts: anchor the Etix supporting-act split on the slugified headliner
  prefix instead of the literal `with-` substring so band names containing
  "with" as a word (e.g. "Out With My Friends") don't generate phantom
  support acts.
- parse.ts: validate `location` per docstring + reject unparseable
  `startDate` + cap `name` at the 256-char column ceiling, so source-format
  drift fails loudly at parse time instead of producing mis-attributed rows
  or a cryptic "invalid input syntax for type timestamp" in the INSERT
  path.
- parse.ts: scope `extractEventLinks` to the site's `baseUrl` and resolve
  links through the URL parser so cross-origin sister-venue / partner
  cross-promo links can't pull foreign events into the current site loop,
  query-string suffixes can't produce 404 paths, and uppercase / underscore
  / non-ASCII slugs aren't silently dropped.
- writer.ts: drop the SELECT-then-INSERT in `ensureVenue`; use a single
  INSERT … ON CONFLICT DO UPDATE that refreshes name/city/state/address
  on every call. A later `VENUE_SEEDS` entry now lifts a placeholder row
  rather than getting permanently shadowed by the stale "Unknown / NC"
  default. `created` is now computed from `xmax = 0` so concurrent runners
  don't both claim the create.

Observability:
- orchestrate.ts + job.ts: split the conflated `write_error` tag into
  `venue_resolve_error` (lookup-path) and `upsert_error` (INSERT-path) so
  a DB-connectivity / venues-table incident is distinguishable from an
  enum-drift / FK-contention incident in dashboards.
- job.ts: tighten the non-zero-exit guard. Index fetches succeeding while
  every per-event step fails was previously exit 0 (cron monitor stayed
  green for a wholesale outage). Now exit 1 when `events_seen > 0` and
  `upserts_total == 0`.

Operational:
- rhp-fetch.ts: 5xx / AbortError retry now pauses 500ms + ~0..500ms jitter
  instead of firing immediately, so a struggling origin doesn't see
  concurrency×2 requests per worker on a flap.

Tests:
- parse.test.ts: new regressions for cross-site collision, MusicEvent
  acceptance, headliner-contains-with split, location validation,
  unparseable startDate, name-length cap, cross-origin link filtering,
  query-string normalization, uppercase-slug acceptance.
- orchestrate.test.ts: split write_error tests into venue_resolve_error
  vs upsert_error; updated SiteTotals shape.
- writer.test.ts: ensureVenue tests for xmax-driven `created` + the
  placeholder-lift behavior.
- database.mock.ts: add missing `added_at` / `last_modified` columns to
  the venues mock.

All 83 unit tests pass; lint 0 errors; format clean for the changed files.
The pre-existing `docs/adr/0005-album-condition-state-machine.md`
prettier drift is owned by PR #1346 and is left untouched here.
jakebromberg added a commit that referenced this pull request Jun 9, 2026
…ce_id, MusicEvent, Etix split, location/date validation, exit guard, error tagging

Iteration-1 hardening pass addressing review of PR #1348.

Correctness / data integrity:
- parse.ts: prepend `venue.site_slug` to `source_id` so two RHP sites sharing
  the same `/event/<slug>/` pathname don't collide on `(source, source_id)`
  UPSERT and silently overwrite each other.
- parse.ts: accept `@type: 'MusicEvent'` (already declared in SchemaEvent
  type) — was rejected at runtime.
- parse.ts: anchor the Etix supporting-act split on the slugified headliner
  prefix instead of the literal `with-` substring so band names containing
  "with" as a word (e.g. "Out With My Friends") don't generate phantom
  support acts.
- parse.ts: validate `location` per docstring + reject unparseable
  `startDate` + cap `name` at the 256-char column ceiling, so source-format
  drift fails loudly at parse time instead of producing mis-attributed rows
  or a cryptic "invalid input syntax for type timestamp" in the INSERT
  path.
- parse.ts: scope `extractEventLinks` to the site's `baseUrl` and resolve
  links through the URL parser so cross-origin sister-venue / partner
  cross-promo links can't pull foreign events into the current site loop,
  query-string suffixes can't produce 404 paths, and uppercase / underscore
  / non-ASCII slugs aren't silently dropped.
- writer.ts: drop the SELECT-then-INSERT in `ensureVenue`; use a single
  INSERT … ON CONFLICT DO UPDATE that refreshes name/city/state/address
  on every call. A later `VENUE_SEEDS` entry now lifts a placeholder row
  rather than getting permanently shadowed by the stale "Unknown / NC"
  default. `created` is now computed from `xmax = 0` so concurrent runners
  don't both claim the create.

Observability:
- orchestrate.ts + job.ts: split the conflated `write_error` tag into
  `venue_resolve_error` (lookup-path) and `upsert_error` (INSERT-path) so
  a DB-connectivity / venues-table incident is distinguishable from an
  enum-drift / FK-contention incident in dashboards.
- job.ts: tighten the non-zero-exit guard. Index fetches succeeding while
  every per-event step fails was previously exit 0 (cron monitor stayed
  green for a wholesale outage). Now exit 1 when `events_seen > 0` and
  `upserts_total == 0`.

Operational:
- rhp-fetch.ts: 5xx / AbortError retry now pauses 500ms + ~0..500ms jitter
  instead of firing immediately, so a struggling origin doesn't see
  concurrency×2 requests per worker on a flap.

Tests:
- parse.test.ts: new regressions for cross-site collision, MusicEvent
  acceptance, headliner-contains-with split, location validation,
  unparseable startDate, name-length cap, cross-origin link filtering,
  query-string normalization, uppercase-slug acceptance.
- orchestrate.test.ts: split write_error tests into venue_resolve_error
  vs upsert_error; updated SiteTotals shape.
- writer.test.ts: ensureVenue tests for xmax-driven `created` + the
  placeholder-lift behavior.
- database.mock.ts: add missing `added_at` / `last_modified` columns to
  the venues mock.

All 83 unit tests pass; lint 0 errors; format clean for the changed files.
The pre-existing `docs/adr/0005-album-condition-state-machine.md`
prettier drift is owned by PR #1346 and is left untouched here.
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