feat: Implement A/B Testing Framework for Campaign Variants (#624)#660
Merged
joelpeace48-cell merged 2 commits intoJun 18, 2026
Merged
Conversation
|
@Gbangbolaoluwagbemiga is attempting to deploy a commit to the joelpeace48-cell's projects Team on Vercel. A member of the Team first needs to authorize it. |
…tudioLab#624) - Add database schema for campaign variants, assignments, and results tracking - Implement deterministic hash-based variant assignment with traffic weights - Add comprehensive API endpoints for variant management and analytics - Include statistical significance testing (z-test for proportions) - Support sticky assignments to ensure user consistency - Add validation schemas and comprehensive unit tests - Integrate with existing campaign infrastructure and rate limiting - Add detailed documentation and usage examples Key features: - Create/manage campaign variants with traffic weight configuration - Assign users to variants based on configurable traffic splits - Track experiment results and calculate statistical significance - RESTful API under /api/v1/campaigns/:id/variants endpoints - Database migration with proper indexes and foreign key constraints Closes FinesseStudioLab#624
69eb204 to
c622b30
Compare
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…work - Add JSDoc type annotations to fix TypeScript errors - Fix validation order in validateTrafficWeights (check individual weights first) - Explicitly spread object properties to satisfy TypeScript type checking - Add missing zScore to return type and early return - All tests now passing (105/105)
5 tasks
Contributor
|
Nice Job @Williams-1604 , all CI passes, feel free to apply to more issues the quality of code is good |
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.
A/B Testing Framework for Campaign Variants
Implements comprehensive A/B testing infrastructure for Trivela campaigns addressing issue #624.
Features
/api/v1/campaigns/:id/variantsAPI Endpoints
POST /campaigns/:id/variants- Create variantGET /campaigns/:id/variants- List variantsPUT /campaigns/:id/variants/:variantId- Update variantDELETE /campaigns/:id/variants/:variantId- Delete variantPOST /campaigns/:id/variants/assign- Assign user to variantGET /campaigns/:id/variants/assignment/:userId- Get assignmentPOST /campaigns/:id/variants/results- Track resultsGET /campaigns/:id/variants/results/:metric- Get analyticsUsage Example
Create control and test variants, assign users based on traffic weights, track conversion metrics, and analyze results with statistical significance testing.
Technical Details
Files Changed
New: 6 files including migration, repository, service, routes, tests, docs
Modified: 3 files for schema validation and integration
Production-ready implementation with full documentation in IMPLEMENTATION_ISSUE_624.md
Closes #624