Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: pass e2e unleash experiments as a header to Metaphysics #13557

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nickskalkin
Copy link
Contributor

@nickskalkin nickskalkin commented Mar 1, 2024

The type of this PR is: Feat

Description

This PR is a proof-of-concept and one of a few moving parts for the "Share split-test assignments with back-ends, for safer data/API roll-outs" technical plan.

The idea is that Force and Eigen detect e2e experiments (by "e2e_" prefix in their name) and sends such experiments in "X-Variants" header to Metaphysics.

For demo and testing purposes, I've created two Unleash experiments, they are enabled for dev/staging:

You can test it in action in the review app.

@nickskalkin nickskalkin self-assigned this Mar 1, 2024
@nickskalkin
Copy link
Contributor Author

Interesting, I do not see "X-Variants" header until I log in

Copy link
Contributor

@joeyAghion joeyAghion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pleasantly surprised by how little code this requires! Will try the review app...

Object.entries(featureFlags).filter(
([key, value]) => key.startsWith("e2e_") && value.flagEnabled
)
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Despite what we proposed in the tech plan, this recommends hyphenating feature names so maybe we should align with that.

@joeyAghion
Copy link
Contributor

Logged out, I saw a partial X-Variants header being attached to Metaphysics requests associated with the initial page-load:

X-Variants: {"e2e_test_2_nikita":{"flagEnabled":true,"variant":{"name":"disabled","enabled":false}}}

But I didn't see the header added to later requests when I navigated around (client-side). After logging in, I seemed to see the full list on all requests:

X-Variants: {"e2e_test_nikita":{"flagEnabled":true,"variant":{"name":"disabled","enabled":false}},"e2e_test_2_nikita":{"flagEnabled":true,"variant":{"name":"disabled","enabled":false}}}

@mzikherman
Copy link
Contributor

Sweet!

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.

None yet

3 participants