Skip to content

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

Merged
merged 9 commits into from
Nov 12, 2024
Merged

feat(flags): add setup integration modal #80437

merged 9 commits into from
Nov 12, 2024

Conversation

michellewzhang
Copy link
Member

@michellewzhang michellewzhang commented Nov 8, 2024

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" button

SCR-20241107-twid

view 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" button

SCR-20241108-jhwl

setup & 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.

SCR-20241107-twpz

the copy field is disabled until the user creates the URL.

SCR-20241107-txkn

when the URL is generated, the "create webhook URL" button is disabled.

notes:

  • we default to LaunchDarkly since they're our only provider right now.
  • when the modal is closed, old URLs still work, but they’re hidden and not shown again. (they can still be referenced in the org auth token page in org settings -- maybe we should make a note about this somewhere in the modal?)
  • the token is named "{provider_name} Token {timestamp}" to keep them unique and user readable

demo flow

Screen.Recording.2024-11-08.at.10.11.31.AM.mov

TODO

  • add CTA & feature flag for LD users

resources

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 8, 2024
setState(prevState => {
return {
...prevState,
url: `https://sentry.io/api/0/organizations/${organization?.slug}/flags/hooks/provider/${provider}/token/${encodedToken}/`,
Copy link
Member Author

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

Copy link
Member

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 👍

@michellewzhang michellewzhang requested review from a team, cmanallen, Jesse-Box and aliu39 November 8, 2024 16:57
@getsentry getsentry deleted a comment from codecov bot Nov 8, 2024
Copy link
Member

@cmanallen cmanallen left a 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.

@cmanallen
Copy link
Member

@michellewzhang Re: metrics. Anywhere you think it would be useful to know if someone is using feature flags let's add a metric.

@michellewzhang
Copy link
Member Author

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.

can definitely add analytics for the modal & table rendering now, but will do the CTA-related analytics when that gets created!

@Jesse-Box
Copy link
Contributor

Jesse-Box commented Nov 8, 2024

@michellewzhang can you add a border to the empty state container?

Figma for reference
Section on Issue Details

Other than that, it looks good to me! Great work!

@michellewzhang
Copy link
Member Author

@michellewzhang can you add a border to the empty state container?

Figma for reference Section on Issue Details

Other than that, it looks good to me! Great work!

SCR-20241108-jhwl

updated!

@cmanallen
Copy link
Member

@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.

@michellewzhang
Copy link
Member Author

@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!

setSortBy={setSortBy}
setOrderBy={setOrderBy}
/>
{hasFlagContext && (
Copy link
Member

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?

Suggested change
{hasFlagContext && (
{(

Copy link
Member Author

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>
Copy link
Member

Choose a reason for hiding this comment

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

what is closeButton here?

Copy link
Member

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

Copy link
Member Author

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) => {

@michellewzhang michellewzhang merged commit 973b354 into master Nov 12, 2024
43 of 44 checks passed
@michellewzhang michellewzhang deleted the mz/ff-modal branch November 12, 2024 23:19
michellewzhang added a commit that referenced this pull request Nov 20, 2024
## 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
harshithadurai pushed a commit that referenced this pull request Nov 25, 2024
## 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
evanh pushed a commit that referenced this pull request Nov 25, 2024
## 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
@github-actions github-actions bot locked and limited conversation to collaborators Nov 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants