Skip to content

fix: drop Ticketmaster test/placeholder payloads (CCPER-*, Standalone Upsell) during import#418

Merged
chubes4 merged 1 commit into
mainfrom
fix-ticketmaster-test-payloads
Jul 5, 2026
Merged

fix: drop Ticketmaster test/placeholder payloads (CCPER-*, Standalone Upsell) during import#418
chubes4 merged 1 commit into
mainfrom
fix-ticketmaster-test-payloads

Conversation

@chubes4

@chubes4 chubes4 commented Jul 5, 2026

Copy link
Copy Markdown
Member

Root cause

Closes #416.

Ticketmaster's Discovery API returns test/placeholder events — internal QA records with IDs like CCPER-2756 and titles like Upcoming Event with Standalone Upsell CCPER-2756 / Upcoming Event CCPER-2756. These are Ticketmaster's own sandbox/test data leaking through the live discovery feed, and the import pipeline ingested them as real events (draft status). CCPER-2756 is a well-known Ticketmaster test event ID. These recurred on every scrape because there was no junk/test filter on the fetch path.

Filter approach

Added a vendor-agnostic JunkPayloadFilter (inc/Steps/EventImport/JunkPayloadFilter.php) and wired it into the Ticketmaster fetch loop. The matcher is generic; the junk patterns are config-driven and fully filterable via a single WordPress filter:

Filter name: data_machine_events_junk_payload_patterns

Pattern buckets (merged over defaults, all optional):

  • honor_test_flag (bool) — honor an upstream explicit test flag
  • id (string[]) — substring match on the source record ID
  • title (string[]) — substring match on the event title
  • title_prefix_no_artist (string[]) — title prefix match only when no real artist/attraction is attached

The Ticketmaster handler seeds its own defaults via register_junk_patterns() (hooked into the filter), evaluated only when $source_type === 'ticketmaster'. This satisfies layer purity: the generic matcher contains zero vendor strings; all Ticketmaster-specific junk patterns (CCPER-, Standalone Upsell, Test Event, Upcoming Event) live in the handler that owns them.

Drop rules implemented

A Ticketmaster event is dropped during fetch when any of these match:

  1. The upstream test boolean flag on the raw record is true.
  2. Source id contains CCPER-.
  3. Title contains CCPER-, Standalone Upsell, or Test Event.
  4. Title starts with Upcoming Event and the event has no real artist/attraction.

Each dropped item is logged via $context->log() (Ticketmaster: Dropped test/placeholder payload) with title/source_id/artist so the pattern table can be tuned. The matcher is placed in the shared EventImport namespace so Dice and other feeds can reuse it later; only the Ticketmaster wiring is in scope for this PR.

Site-tuning example

add_filter( 'data_machine_events_junk_payload_patterns', function ( $patterns, $source_type ) {
    if ( 'ticketmaster' !== $source_type ) {
        return $patterns;
    }
    $patterns['title'][] = 'QA Sandbox';
    return $patterns;
}, 10, 2 );

Files changed

  • inc/Steps/EventImport/JunkPayloadFilter.php (new) — generic vendor-agnostic matcher with the filterable pattern table.
  • inc/Steps/EventImport/Handlers/Ticketmaster/Ticketmaster.php — instantiates the filter, registers Ticketmaster default patterns via register_junk_patterns() hooked to data_machine_events_junk_payload_patterns, and drops junk in the fetch loop (is_junk_payload()), logging each drop.
  • tests/Unit/JunkPayloadFilterTest.php (new) — 15 tests covering: explicit test flag (true/false/absent), CCPER- on id and title, Standalone Upsell, Test Event, Upcoming Event prefix with/without artist, normal-event pass-through, unknown-source no-match, case-insensitivity, and filterability (add a pattern + remove a default).
  • tests/Unit/TicketmasterHandlerTest.php — adds tests for register_junk_patterns() (TM defaults seeded, other sources ignored), the filter exposure, and end-to-end junk/normal classification through the filter.

Test / lint results

  • php -l clean on all four changed files.
  • PHPStan level 7: PASSED (via homeboy lint, extension-default level 7).
  • PHPUnit could not run on this host — the test sandbox (WP test setup) is unavailable in this environment. php -l is clean and the tests will run in CI.
  • ESLint surfaced a JS-only infra exit (0 findings) — unrelated to this PHP change; homeboy lint overall is gated on that unrelated JS tool.

Confirms

  • Patterns are filterable, not hardcoded — every junk string is registered through data_machine_events_junk_payload_patterns, and site code can add, remove, or override any bucket.
  • Layer purity held — the generic matcher (JunkPayloadFilter) contains no vendor names; the only place Ticketmaster-specific strings appear is Ticketmaster::register_junk_patterns().
  • No CHANGELOG.md edits, no version-string hand-bumps (homeboy owns both).

Scope

PR only. Not releasing, not deploying, not merging.

… Upsell) during import

Add a vendor-agnostic JunkPayloadFilter with a filterable pattern table
(data_machine_events_junk_payload_patterns) and wire the Ticketmaster
handler to drop known test/placeholder records (CCPER-* IDs, 'Standalone
Upsell'/'Test Event' titles, 'Upcoming Event' titles with no artist, and
the upstream 'test' boolean flag) before they enter the import pipeline.

Closes #416.
@homeboy-ci

homeboy-ci Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Homeboy Results — data-machine-events

Review audit

review audit — passed

Deep dive: homeboy review audit data-machine-events --changed-since 5c270f6

Artifacts and drill-down
  • CI results artifact: homeboy-ci-results-data-machine-events-review-audit-homeboy-Linux-node24 contains immediate command JSON for this action invocation.
  • Observation artifact: homeboy-observations-data-machine-events-review-audit-homeboy-Linux-node24 contains exported Homeboy run history for deeper queries.
  • Drill-down: download the observation artifact, then run homeboy runs import <dir>, homeboy runs list, and homeboy runs findings <run-id>.
  • Artifacts are attached to the workflow run: https://github.com/Extra-Chill/data-machine-events/actions/runs/28749696485
Tooling versions
  • Homeboy CLI: homeboy 0.281.8+15d2280a58ed+a25f89a
  • Extension: wordpress from https://github.com/Extra-Chill/homeboy-extensions
  • Extension revision: 68d84557
  • Action: Extra-Chill/homeboy-action@v2

@chubes4 chubes4 merged commit bc36b2e into main Jul 5, 2026
1 check 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.

Ticketmaster test/placeholder payloads (CCPER-*, 'Standalone Upsell') imported as real events

1 participant