Skip to content

feat: add active_ab_tests to swap events#8152

Open
bfullam wants to merge 2 commits intomainfrom
swaps-add-activeabtests-to-swap-bridge
Open

feat: add active_ab_tests to swap events#8152
bfullam wants to merge 2 commits intomainfrom
swaps-add-activeabtests-to-swap-bridge

Conversation

@bfullam
Copy link
Contributor

@bfullam bfullam commented Mar 9, 2026

Explanation

This PR updates Unified SwapBridge metrics migration support so legacy and new A/B test payloads can coexist without conflation.

Current state:

  • Bridge events already supported legacy ab_tests.
  • active_ab_tests needed to be supported in parallel during migration.
  • Earlier wiring could make these appear equivalent if the same context was reused.

What changed:

  • Added optional active_ab_tests support to bridge-controller metrics event context/payload types.
  • In bridge-status-controller, introduced separate activeAbTests context input/storage alongside legacy abTests.
  • Updated event tracking resolution so ab_tests and active_ab_tests are handled independently.
  • Updated pre-confirmation metrics property generation to accept and emit separate legacy/new test maps.
  • Clarified JSDoc/type comments to document why both fields currently exist and how migration is intended.

Why another package was updated:

  • bridge-status-controller publishes events through bridge-controller metrics types, so bridge-controller type definitions had to include active_ab_tests to keep typing aligned.

References

  • No linked issue.

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Low Risk
Low risk: this is additive metrics/type plumbing that keeps legacy ab_tests behavior intact while emitting a new optional active_ab_tests payload when provided.

Overview
Adds dual A/B test context support for SwapBridge metrics. Unified SwapBridge event context/payload types now include optional active_ab_tests alongside legacy ab_tests, with documentation noting the migration window.

Bridge Status Controller now accepts/persists activeAbTests in history and resolves/emits both ab_tests and active_ab_tests independently when tracking post-submission events (including pre-confirmation payload builders). Tests and changelogs are updated accordingly.

Written by Cursor Bugbot for commit fccc363. This will update automatically on new commits. Configure here.

@bfullam bfullam requested review from a team as code owners March 9, 2026 19:20
@bfullam bfullam changed the title Include active_ab_tests alongside ab_tests in Unified SwapBridge metrics Support parallel ab_tests and active_ab_tests metrics contexts Mar 9, 2026
@bfullam bfullam changed the title Support parallel ab_tests and active_ab_tests metrics contexts fix: keep ab_tests and active_ab_tests metrics contexts independent Mar 9, 2026
@bfullam bfullam changed the title fix: keep ab_tests and active_ab_tests metrics contexts independent feat: add active_ab_tests to swap events Mar 9, 2026
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