-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
ref(project): use hasFlags flag for CTA check #83282
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per @antonpirker's comment we can no longer rely on the context being present. getsentry/sentry-python#3917 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After offline discussion, we need the flags context check.
use the newly implemented `hasFlags` project flag as the final layer to determine whether the CTA should be shown. ## TLDR: the CTA only shows up if... project has never sent flags before, `event.contexts.flags` is undefined, the platform is correct, & the org is under the cta flag. ``` const showCTA = !project.hasFlags && !hasFlagContext && featureFlagOnboardingPlatforms.includes(project.platform ?? 'other') && organization.features.includes('feature-flag-cta'); ``` here are the following possible code paths (all are tested) ## `event.contexts.flags = [ ... ]` -> flag table rendered <img width="870" alt="SCR-20250110-nkne" src="https://github.com/user-attachments/assets/595d0e2e-8c5f-42f6-aa16-2ee5bcead68d" /> ## `event.contexts.flags = [ ]` -> empty state <img width="849" alt="SCR-20250110-nlkr" src="https://github.com/user-attachments/assets/af07507e-e177-4c73-979b-4ea652eb73c2" /> ## `event.contexts.flags = undefined` and `hasFlags = true` -> empty state <img width="849" alt="SCR-20250110-nlkr" src="https://github.com/user-attachments/assets/af07507e-e177-4c73-979b-4ea652eb73c2" /> ## `event.contexts.flags = undefined` and `hasFlags = false` and `feature-flag-cta = true` and `platform in [javascript, python]` -> CTA shown <img width="846" alt="SCR-20250110-nkul" src="https://github.com/user-attachments/assets/07e123a3-fcab-48da-acd0-62d89a9d6a6b" /> ## `event.contexts.flags = undefined` and `feature-flag-cta = true` and `platform !in [javascript, python]` -> section hidden ## `event.contexts.flags = undefined` and `feature-flag-cta = false` -> section hidden Closes getsentry/team-replay#529
use the newly implemented
hasFlags
project flag as the final layer to determine whether the CTA should be shown.TLDR: the CTA only shows up if... project has never sent flags before,
event.contexts.flags
is undefined, the platform is correct, & the org is under the cta flag.here are the following possible code paths (all are tested)
event.contexts.flags = [ ... ]
-> flag table renderedevent.contexts.flags = [ ]
-> empty stateevent.contexts.flags = undefined
andhasFlags = true
-> empty stateevent.contexts.flags = undefined
andhasFlags = false
andfeature-flag-cta = true
andplatform in [javascript, python]
-> CTA shownevent.contexts.flags = undefined
andfeature-flag-cta = true
andplatform !in [javascript, python]
-> section hiddenevent.contexts.flags = undefined
andfeature-flag-cta = false
-> section hiddenCloses https://github.com/getsentry/team-replay/issues/529