-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat(flags): add setup integration modal #80437
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
Conversation
static/app/components/events/featureFlags/setupIntegrationModal.tsx
Outdated
Show resolved
Hide resolved
static/app/components/events/featureFlags/setupIntegrationModal.tsx
Outdated
Show resolved
Hide resolved
setState(prevState => { | ||
return { | ||
...prevState, | ||
url: `https://sentry.io/api/0/organizations/${organization?.slug}/flags/hooks/provider/${provider}/token/${encodedToken}/`, |
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.
need to verify that this link is correct/works cc @cmanallen @aliu39
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.
The URL looks correct to me 👍
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.
Let's add a metric tracking the modal opening. Optionally, it would be nice to have metrics for when the FF table renders or when the (to be created) CTA displays or is closed.
@michellewzhang Re: metrics. Anywhere you think it would be useful to know if someone is using feature flags let's add a metric. |
can definitely add analytics for the modal & table rendering now, but will do the CTA-related analytics when that gets created! |
@michellewzhang can you add a border to the empty state container? Other than that, it looks good to me! Great work! |
![]() updated! |
@michellewzhang Can the "Read Docs" button be set up to open a new tab when clicked? I'm thinking people will accidentally lose their generated URL when they realize they don't know what to do with it. |
yep it already opens in a new tab! |
static/app/components/events/featureFlags/eventFeatureFlagList.tsx
Outdated
Show resolved
Hide resolved
setSortBy={setSortBy} | ||
setOrderBy={setOrderBy} | ||
/> | ||
{hasFlagContext && ( |
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.
Do we still need this after the early return check above?
{hasFlagContext && ( | |
{( |
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.
keeping this for now since it'll be useful when we add in the LD feature flag
const ModalHeader = useCallback( | ||
({children: headerChildren}: {children: React.ReactNode}) => { | ||
return ( | ||
<Header closeButton> |
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.
what is closeButton
here?
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.
It closes the modal right, where is it coming from in code though
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.
it's a prop that's passed into the Header
component
const makeClosableHeader = (closeModal: () => void) => { |
static/app/components/events/featureFlags/setupIntegrationModal.tsx
Outdated
Show resolved
Hide resolved
static/app/components/events/featureFlags/setupIntegrationModal.tsx
Outdated
Show resolved
Hide resolved
static/app/components/events/featureFlags/setupIntegrationModal.tsx
Outdated
Show resolved
Hide resolved
## what does this pr do? - this pr implements part of the feature flag onboarding sidebar specified in these [designs](https://www.figma.com/design/6w2ju2MlyuGRLKm2PKpotD/Specs%3A-Feature-Flag-Onboarding?node-id=0-1&node-type=canvas&t=UPuG14gRVUNLLQvo-0). - relates to getsentry/team-replay#502. - currently, only the python onboarding is done, as i want to get feedback on how i've structured it before doing javascript. (javascript & python are the only two SDKs we'll do for now.) - deletes the setup integration modal introduced in #80437, which is no longer needed. ## flow walkthrough The sidebar is triggered by the "set up integration" button on the feature flags table on issue details. <img width="686" alt="SCR-20241115-nhtq" src="https://github.com/user-attachments/assets/a4fecf37-a2b1-4795-aa11-f612035792c3"> It opens a flyout sidebar, which explains onboarding instructions for how to set up feature flag integrations. Depending on whether OpenFeature is selected (which allows for an additional dropdown to pick another provider) or another SDK, the instructions will vary. ### LD: <img width="474" alt="SCR-20241115-njpv" src="https://github.com/user-attachments/assets/6a638bd4-a9ac-4fb1-8646-3a55362fb6b3"> ### OpenFeature with LD: <img width="464" alt="SCR-20241115-nkwd" src="https://github.com/user-attachments/assets/622fe30d-5a66-4638-9314-de621c9f1578"> ### signing secret At the bottom of the sidebar is a spot to post a signing secret, which is what we use to verify the integration. This posts to the `/signing-secret/` endpoint: https://github.com/getsentry/sentry/blob/9dfbc5a6629127614e04b8e95b9b280ccd8e1ea1/src/sentry/api/urls.py#L2072-L2076 https://github.com/user-attachments/assets/a94c92a6-0b46-465e-b805-b1bef2f43460 when the token is saved, a success banner appears: <img width="459" alt="SCR-20241115-nmxv" src="https://github.com/user-attachments/assets/73c5841f-52d8-494d-a905-81dfe1b8cbec"> ## video demos triggering from issue details: https://github.com/user-attachments/assets/06505803-ab2f-477d-a053-2269b9af1be7 example of what it would look like if OpenFeature had multiple options: https://github.com/user-attachments/assets/5893ac06-b1f3-4925-b124-b609440c6e33 ## todo (this PR): - [x] fix/test the secret endpoint - [x] fill in links for docs ## todo (followups) - javascript onboarding - figure out CTA details (another way the sidebar can be triggered) - if we detect that `event.contexts.flags` is not undefined, we should hide the first half of the onboarding as specified in the designs - analytics charts
## what does this pr do? - this pr implements part of the feature flag onboarding sidebar specified in these [designs](https://www.figma.com/design/6w2ju2MlyuGRLKm2PKpotD/Specs%3A-Feature-Flag-Onboarding?node-id=0-1&node-type=canvas&t=UPuG14gRVUNLLQvo-0). - relates to getsentry/team-replay#502. - currently, only the python onboarding is done, as i want to get feedback on how i've structured it before doing javascript. (javascript & python are the only two SDKs we'll do for now.) - deletes the setup integration modal introduced in #80437, which is no longer needed. ## flow walkthrough The sidebar is triggered by the "set up integration" button on the feature flags table on issue details. <img width="686" alt="SCR-20241115-nhtq" src="https://github.com/user-attachments/assets/a4fecf37-a2b1-4795-aa11-f612035792c3"> It opens a flyout sidebar, which explains onboarding instructions for how to set up feature flag integrations. Depending on whether OpenFeature is selected (which allows for an additional dropdown to pick another provider) or another SDK, the instructions will vary. ### LD: <img width="474" alt="SCR-20241115-njpv" src="https://github.com/user-attachments/assets/6a638bd4-a9ac-4fb1-8646-3a55362fb6b3"> ### OpenFeature with LD: <img width="464" alt="SCR-20241115-nkwd" src="https://github.com/user-attachments/assets/622fe30d-5a66-4638-9314-de621c9f1578"> ### signing secret At the bottom of the sidebar is a spot to post a signing secret, which is what we use to verify the integration. This posts to the `/signing-secret/` endpoint: https://github.com/getsentry/sentry/blob/9dfbc5a6629127614e04b8e95b9b280ccd8e1ea1/src/sentry/api/urls.py#L2072-L2076 https://github.com/user-attachments/assets/a94c92a6-0b46-465e-b805-b1bef2f43460 when the token is saved, a success banner appears: <img width="459" alt="SCR-20241115-nmxv" src="https://github.com/user-attachments/assets/73c5841f-52d8-494d-a905-81dfe1b8cbec"> ## video demos triggering from issue details: https://github.com/user-attachments/assets/06505803-ab2f-477d-a053-2269b9af1be7 example of what it would look like if OpenFeature had multiple options: https://github.com/user-attachments/assets/5893ac06-b1f3-4925-b124-b609440c6e33 ## todo (this PR): - [x] fix/test the secret endpoint - [x] fill in links for docs ## todo (followups) - javascript onboarding - figure out CTA details (another way the sidebar can be triggered) - if we detect that `event.contexts.flags` is not undefined, we should hide the first half of the onboarding as specified in the designs - analytics charts
## what does this pr do? - this pr implements part of the feature flag onboarding sidebar specified in these [designs](https://www.figma.com/design/6w2ju2MlyuGRLKm2PKpotD/Specs%3A-Feature-Flag-Onboarding?node-id=0-1&node-type=canvas&t=UPuG14gRVUNLLQvo-0). - relates to getsentry/team-replay#502. - currently, only the python onboarding is done, as i want to get feedback on how i've structured it before doing javascript. (javascript & python are the only two SDKs we'll do for now.) - deletes the setup integration modal introduced in #80437, which is no longer needed. ## flow walkthrough The sidebar is triggered by the "set up integration" button on the feature flags table on issue details. <img width="686" alt="SCR-20241115-nhtq" src="https://github.com/user-attachments/assets/a4fecf37-a2b1-4795-aa11-f612035792c3"> It opens a flyout sidebar, which explains onboarding instructions for how to set up feature flag integrations. Depending on whether OpenFeature is selected (which allows for an additional dropdown to pick another provider) or another SDK, the instructions will vary. ### LD: <img width="474" alt="SCR-20241115-njpv" src="https://github.com/user-attachments/assets/6a638bd4-a9ac-4fb1-8646-3a55362fb6b3"> ### OpenFeature with LD: <img width="464" alt="SCR-20241115-nkwd" src="https://github.com/user-attachments/assets/622fe30d-5a66-4638-9314-de621c9f1578"> ### signing secret At the bottom of the sidebar is a spot to post a signing secret, which is what we use to verify the integration. This posts to the `/signing-secret/` endpoint: https://github.com/getsentry/sentry/blob/9dfbc5a6629127614e04b8e95b9b280ccd8e1ea1/src/sentry/api/urls.py#L2072-L2076 https://github.com/user-attachments/assets/a94c92a6-0b46-465e-b805-b1bef2f43460 when the token is saved, a success banner appears: <img width="459" alt="SCR-20241115-nmxv" src="https://github.com/user-attachments/assets/73c5841f-52d8-494d-a905-81dfe1b8cbec"> ## video demos triggering from issue details: https://github.com/user-attachments/assets/06505803-ab2f-477d-a053-2269b9af1be7 example of what it would look like if OpenFeature had multiple options: https://github.com/user-attachments/assets/5893ac06-b1f3-4925-b124-b609440c6e33 ## todo (this PR): - [x] fix/test the secret endpoint - [x] fill in links for docs ## todo (followups) - javascript onboarding - figure out CTA details (another way the sidebar can be triggered) - if we detect that `event.contexts.flags` is not undefined, we should hide the first half of the onboarding as specified in the designs - analytics charts
this PR adds a "set up integration" button on the feature flag table header actions. this button is visible only if we detect that
event.contexts.flags
is not undefined -- i.e. when an feature flag integration has already been set up.scenario A:
event.contexts.flags
exists and is populated => we show "set up integration" buttonview all, search, sort, setup, & feedback buttons visible. (feedback button not visible in the screenshot because i was on
sentry
dev but it'll be visible in prod.)scenario B:
event.contexts.flags
exists but is empty => we show empty state & "set up integration" buttonsetup & give feedback buttons visible. (feedback button not visible in the screenshot because i was on
sentry
dev but it'll be visible in prod.)scenario C: LD user has not set up integration yet
TODO in the future: add CTA.
right now: we hide the FF section.
scenario D: non LD-user has not set up integration yet
we hide the FF section.
modal
when the "set up integration" button is clicked, we show a modal allowing the user to generate a webhook URL, which they can then paste into their provider website.
the copy field is disabled until the user creates the URL.
when the URL is generated, the "create webhook URL" button is disabled.
notes:
demo flow
Screen.Recording.2024-11-08.at.10.11.31.AM.mov
TODO
resources