-
Notifications
You must be signed in to change notification settings - Fork 97
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: support running without a STATSIG_API_KEY #6403
Merged
+175
−79
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,7 +79,6 @@ export const FIATCONNECT_NETWORK = | |
export const STATSIG_ENV = { | ||
tier: DEFAULT_TESTNET === 'mainnet' ? 'production' : 'development', | ||
} | ||
export const E2E_TEST_STATSIG_ID = 'e2e_test_statsig_id' | ||
|
||
// Keyless backup settings | ||
export const TORUS_NETWORK = | ||
|
@@ -122,10 +121,8 @@ export const ALCHEMY_BASE_API_KEY = keyOrUndefined( | |
) | ||
|
||
export const ZENDESK_API_KEY = keyOrUndefined(secretsFile, DEFAULT_TESTNET, 'ZENDESK_API_KEY') | ||
export const STATSIG_API_KEY = | ||
keyOrUndefined(secretsFile, DEFAULT_TESTNET, 'STATSIG_API_KEY') ?? | ||
// dummy key as fallback for e2e tests, which use local mode | ||
'client-key' | ||
export const STATSIG_API_KEY = keyOrUndefined(secretsFile, DEFAULT_TESTNET, 'STATSIG_API_KEY') | ||
export const STATSIG_ENABLED = !isE2EEnv && !!STATSIG_API_KEY | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Kept I think with the move to the runtime we'll update "secrets" management and will just use env variables. So this special case of e2e env will not be needed anymore. |
||
export const SEGMENT_API_KEY = keyOrUndefined(secretsFile, DEFAULT_TESTNET, 'SEGMENT_API_KEY') | ||
export const SENTRY_CLIENT_URL = keyOrUndefined(secretsFile, DEFAULT_TESTNET, 'SENTRY_CLIENT_URL') | ||
export const BIDALI_URL = keyOrUndefined(secretsFile, DEFAULT_TESTNET, 'BIDALI_URL') | ||
|
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Should we just initialize the statsig client in local mode if statsig is disabled? That way we can avoid the custom gate overrides code too. And we can avoid the noisy logs by tweaking the logging condition.
Also, it seems like for statsig to be enabled, we'll need the segment key too because of the stable id dependency. Wonder if we should remove that dependency. We can probably let statsig set it's own anonymous id in cases where segment is not enabled.
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.
ah I didn't know about the
localMode
option.However my intention is to be able to run even if the statsig lib is not installed. So the approach here of not instantiating the client is preferrable I think. We're planning to make 3rd party deps like segment, clevertap, etc optional in the modular runtime.
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.
Yes I thought about that, and was on the fence whether to make that change now.
I'm not sure if we'll need statsig enabled without segment.
To run experiments we need segment to be connected to statsig, right?
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.
makes sense re running without installing those libraries.
For experiments, yes segment is needed but it doesn't need to be. Metrics can potentially go to statsig directly without segment. Also, maybe there's a case where statsig is just needed for dynamic config. But I guess we could do that separately.
should we just drop the localMode option now that it is always going to be false?
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.
yes definitely I'll remove it.