-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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(flags): support Statsig webhook provider and secrets format #85132
Conversation
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #85132 +/- ##
==========================================
+ Coverage 87.97% 87.98% +0.01%
==========================================
Files 9620 9619 -1
Lines 543130 543933 +803
Branches 21021 21021
==========================================
+ Hits 477800 478575 +775
- Misses 65025 65053 +28
Partials 305 305 |
this will need to be updated in the frontend because the input box for provider secrets is limited to 32 char to pass backend validation (since prev secrets were all 32 char). i think it might be best to standardize all of them to 32 char for simplicity, but not tied to this |
This won't be possible for Statsig since all the secrets I've gotten from creating a webhook are >32 chars. |
ohh ok i see - yeah try casing on the input box (applies to both the sidebar input box & also the settings input box, maybe somewhere else too but i forget the exact places) and see if that works two spots i can find: sentry/static/app/views/settings/featureFlags/newProviderForm.tsx Lines 144 to 153 in 3bc8ccf
sentry/static/app/components/events/featureFlags/onboardingIntegrationSection.tsx Lines 178 to 180 in 3bc8ccf
|
Oo great thanks for the refs! |
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.
Looks good. Did you test with ngrok?
@cmanallen yeah I tested with ngrok and based the coverage here on some sample events |
Closes https://github.com/getsentry/team-replay/issues/537
Ref
Test coverage is based on these docs and an actual statsig webhook setup, using ngrok + devserver. I also used this setup to verify the signing scheme and secret format/lengths.
Decisions:
Only
statsig::config_change
events are relevant for change tracking. This is subclassed by flag type inmetadata.type
. The choices are "Gate" (boolean release flags), "Experiment" (JSON) and more.-> I decided to only track gate changes for now, since we don't record non-bool flag evaluations.
FlagWebhookSigningSecretValidator
: Statsig secrets have format "webhook-". There's no documentation on min/max length but I've seen 48, 50, 51 so it's variable. I've chosen to enforce a min/max of 32-64. Validation for other providers is unchanged (exactly 32 characters)TODO:
archive
eventand handle it as a delete action-> both archive and unarchive use thearchived
action, which is annoying since we can't categorize as create/delete. Deciding to drop these events.