Skip to content
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(multichain): Use new dynamic config for multichain features #4265

Merged
merged 10 commits into from
Oct 9, 2023

Conversation

jophish
Copy link
Contributor

@jophish jophish commented Oct 5, 2023

Description

For ACT-931. Replaces three of our existing feature gates with a single Statsig Dynamic Config (available here).

The show_native_tokens feature gate is a straggler here in terms of multichain config. This was added as part of a quick and dirty hack to get non-Celo transfers showing up in the home feed a while back, and ought to be removed. I'll remove this in a followup PR.

Test plan

Manual and unit tested.

Related issues

Backwards compatibility

Yes.

@jophish jophish changed the title feat(multichain): Use new dynamic config for multichain features. feat(multichain): Use new dynamic config for multichain features Oct 5, 2023
@codecov
Copy link

codecov bot commented Oct 5, 2023

Codecov Report

Merging #4265 (45430a6) into main (d17825b) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4265      +/-   ##
==========================================
- Coverage   83.96%   83.95%   -0.01%     
==========================================
  Files         705      705              
  Lines       25989    25985       -4     
  Branches     3378     3372       -6     
==========================================
- Hits        21821    21817       -4     
- Misses       4103     4104       +1     
+ Partials       65       64       -1     
Files Coverage Δ
src/fiatExchanges/FiatExchangeCurrency.tsx 81.08% <100.00%> (+0.79%) ⬆️
src/statsig/constants.ts 100.00% <100.00%> (ø)
src/statsig/types.ts 100.00% <100.00%> (ø)
src/tokens/saga.ts 59.30% <100.00%> (-0.70%) ⬇️
src/tokens/utils.ts 96.49% <100.00%> (-1.82%) ⬇️
src/transactions/feed/queryHelper.ts 94.89% <100.00%> (+0.68%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d17825b...45430a6. Read the comment docs.

src/statsig/constants.ts Outdated Show resolved Hide resolved
src/tokens/TokenBalances.test.tsx Outdated Show resolved Hide resolved
@@ -18,6 +18,11 @@ import { mockCusdAddress } from 'test/values'

jest.mock('src/statsig', () => ({
getFeatureGate: jest.fn(() => false),
getDynamicConfigParams: jest.fn(() => ({
Copy link
Contributor

Choose a reason for hiding this comment

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

Noticed these in a bunch of test files, are the mocks on these test files required because there's a nested dependency to this dynamic config? And is the getFeatureGate mock now required? I wonder if we should consider creating a shared mock under __mocks__ similar to how navigate / analytics is mocked so we don't need this everywhere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's correct, re: nested dependency. And yes, the getFeatureGate mock is still required here. And interesting -- I haven't messed around with shared mocks before. How would that work? Would there be a mock for the entirety of src/statsig that would automatically be included in all tests? What if we want to override this mock (which will certainly be the case)?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes it would mock src/statsig for all tests. We can still setup test specific mocks as we do normally and it will override this mock. In any case its outside the scope of this PR, but something to consider if we have more of these shared mocks.

src/fiatExchanges/FiatExchangeCurrency.tsx Show resolved Hide resolved
@@ -18,6 +18,11 @@ import { mockCusdAddress } from 'test/values'

jest.mock('src/statsig', () => ({
getFeatureGate: jest.fn(() => false),
getDynamicConfigParams: jest.fn(() => ({
Copy link
Contributor

Choose a reason for hiding this comment

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

yes it would mock src/statsig for all tests. We can still setup test specific mocks as we do normally and it will override this mock. In any case its outside the scope of this PR, but something to consider if we have more of these shared mocks.

@jophish jophish enabled auto-merge (squash) October 9, 2023 14:39
@jophish jophish merged commit e2dcd67 into main Oct 9, 2023
15 checks passed
@jophish jophish deleted the jophish/multi-chain-statsig branch October 9, 2023 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants