Skip to content

Document the event pipeline and expose priority constants - #42

Merged
loevgaard merged 1 commit into
masterfrom
fix/22-pipeline-priorities
Sep 7, 2026
Merged

Document the event pipeline and expose priority constants#42
loevgaard merged 1 commit into
masterfrom
fix/22-pipeline-priorities

Conversation

@loevgaard

Copy link
Copy Markdown
Member

Fixes #22

Stacked on #41.

Problem

The bundle is a pipeline of ten listeners on ConversionsApiEventRaised whose order lived as magic numbers spread across ten files, documented nowhere. An integrator could not tell that a listener at the default priority is the intended place to enrich the event, that everything is already populated by then, or that a listener below -850 may never run because a filter stopped propagation.

Change

No behaviour change. Every priority keeps the exact value it had.

  • Four constants on ConversionsApiEventRaised name the bands: PRIORITY_POPULATE, PRIORITY_ENRICH, PRIORITY_FILTER and PRIORITY_SEND. Every subscriber now derives its priority from them, so there is one source of truth.
  • The class docblock carries the table.
  • README.md gains a How it works section with the full pipeline, the two rules that follow from it, and a worked enrichment listener that attaches the logged-in customer's email, name and external id.

Tests

Five unit tests pin the contract down: the pipeline is in descending order, the four populate listeners run above PRIORITY_ENRICH, the filters and sinks run below it, and the two sinks sit at PRIORITY_SEND.

@codecov

codecov Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.79%. Comparing base (1d50dd3) to head (3bc77c7).

Additional details and impacted files
@@                       Coverage Diff                       @@
##             fix/21-pixel-access-token      #42      +/-   ##
===============================================================
+ Coverage                        67.07%   67.79%   +0.72%     
  Complexity                         135      135              
===============================================================
  Files                               30       30              
  Lines                              413      413              
===============================================================
+ Hits                               277      280       +3     
+ Misses                             136      133       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The order of the ten listeners on ConversionsApiEventRaised lived as
magic numbers in ten files and was documented nowhere, so integrators
could not tell where to hook in or that a late listener may never run.

Name the four bands as constants on the event, derive every subscriber
priority from them, and document the pipeline with an enrichment
example. No priority changes value.

Fixes #22
@loevgaard
loevgaard force-pushed the fix/21-pixel-access-token branch from f7941c5 to 1d50dd3 Compare September 7, 2026 12:18
@loevgaard
loevgaard force-pushed the fix/22-pipeline-priorities branch from f495dfc to 3bc77c7 Compare September 7, 2026 12:18
Base automatically changed from fix/21-pixel-access-token to master September 7, 2026 12:44
@loevgaard
loevgaard merged commit 6b6e0a6 into master Sep 7, 2026
47 checks passed
@loevgaard
loevgaard deleted the fix/22-pipeline-priorities branch September 7, 2026 12:47
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.

Document the event pipeline and expose priority constants

1 participant