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(core): add feature flag switch for experience app #6564

Merged
merged 8 commits into from
Sep 20, 2024

Conversation

simeng-li
Copy link
Contributor

@simeng-li simeng-li commented Sep 10, 2024

Summary

Add a local feature flag support for the experience package rollout plan.

  • Add a new feature flag percentage settings key in the systems DB. We use this to control the rollout percentage.
  • Always use the new experience package if the dev feature is enabled.
  • Always use the old experience-legacy package for the OSS. Until this feature is fully rolled out.
  • Use the _interaction sessionId from cookies to calculate the feature flag status. Users should use the same package during the same interaction session.

Testing

test locally

Checklist

  • .changeset
  • unit tests
  • integration tests
  • necessary TSDoc comments

@github-actions github-actions bot added the feature Cool stuff label Sep 10, 2024
Copy link

github-actions bot commented Sep 10, 2024

COMPARE TO master

Total Size Diff ⚠️ 📈 +12.56 KB

Diff by File
Name Diff
packages/core/src/middleware/koa-spa-proxy.ts 📈 +587 Bytes
packages/core/src/middleware/utils/experience-proxy.test.ts 📈 +5.75 KB
packages/core/src/middleware/utils/experience-proxy.ts 📈 +2.94 KB
packages/core/src/utils/feature-flag.test.ts 📈 +1.45 KB
packages/core/src/utils/feature-flag.ts 📈 +978 Bytes
packages/core/src/utils/test-utils.ts 📈 +143 Bytes
packages/schemas/src/types/system.ts 📈 +775 Bytes

packages/core/src/utils/a-b-test.ts Fixed Show resolved Hide resolved
@github-actions github-actions bot added size/l and removed size/m labels Sep 11, 2024
@simeng-li simeng-li marked this pull request as ready for review September 11, 2024 03:55
@simeng-li simeng-li requested review from a team September 11, 2024 05:41
@simeng-li simeng-li changed the title feat(core): add A/B test for experience app feat(core): add feature flag switch for experience app Sep 11, 2024
implement experience package a/b test
replace the hash alg and add trySafe wrapper
update function name and comments
optimize the code logic, add head to indicate the experience package
update static module proxy header
packages/core/src/middleware/koa-spa-proxy.ts Outdated Show resolved Hide resolved
simeng-li and others added 2 commits September 19, 2024 14:44
clean up empty line

Co-authored-by: Gao Sun <gao@silverhand.io>
@simeng-li simeng-li merged commit 918f850 into master Sep 20, 2024
35 checks passed
@simeng-li simeng-li deleted the simeng-experience-app-roll-out branch September 20, 2024 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants