-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
ref(project): use hasFlags flag for CTA check #83282
Merged
Merged
Conversation
This file contains 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
github-actions
bot
added
the
Scope: Frontend
Automatically applied to PRs that change frontend components
label
Jan 10, 2025
This comment was marked as outdated.
This comment was marked as outdated.
michellewzhang
requested review from
cmanallen and
aliu39
and removed request for
a team
January 10, 2025 23:18
cmanallen
requested changes
Jan 13, 2025
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)
cmanallen
approved these changes
Jan 13, 2025
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.
andrewshie-sentry
pushed a commit
that referenced
this pull request
Jan 22, 2025
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
# for free
to join this conversation on GitHub.
Already have an account?
# 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.
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