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

♻️ [RUMF-1529] use an enum for experimental features #2113

Merged
merged 5 commits into from
Mar 29, 2023

Conversation

BenoitZugmeyer
Copy link
Member

Motivation

Improve typecheck, helps to clean flags when enabling them.

Changes

Use an enum for experimental features

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@BenoitZugmeyer BenoitZugmeyer requested review from a team as code owners March 28, 2023 08:13
@BenoitZugmeyer BenoitZugmeyer force-pushed the benoit/stricter-feature-flags branch from 361fba3 to 22b1acf Compare March 28, 2023 08:15
@codecov-commenter
Copy link

Codecov Report

Merging #2113 (22b1acf) into main (28d26bb) will decrease coverage by 0.19%.
The diff coverage is 86.53%.

@@            Coverage Diff             @@
##             main    #2113      +/-   ##
==========================================
- Coverage   93.67%   93.48%   -0.19%     
==========================================
  Files         163      163              
  Lines        5691     5711      +20     
  Branches     1303     1310       +7     
==========================================
+ Hits         5331     5339       +8     
- Misses        360      372      +12     
Impacted Files Coverage Δ
...ges/rum/src/domain/record/shadowRootsController.ts 60.00% <0.00%> (ø)
packages/core/src/tools/contextManager.ts 94.11% <66.66%> (-5.89%) ⬇️
packages/core/src/tools/error.ts 92.59% <66.66%> (-1.64%) ⬇️
packages/logs/src/boot/logsPublicApi.ts 98.07% <66.66%> (-1.93%) ⬇️
packages/logs/src/domain/logger.ts 94.00% <75.00%> (-1.84%) ⬇️
packages/rum-core/src/boot/rumPublicApi.ts 91.75% <83.33%> (-0.96%) ⬇️
packages/core/src/browser/pageExitObservable.ts 100.00% <100.00%> (ø)
...ges/core/src/domain/configuration/configuration.ts 92.50% <100.00%> (+0.60%) ⬆️
...s/core/src/domain/configuration/endpointBuilder.ts 100.00% <100.00%> (ø)
...e/src/domain/configuration/experimentalFeatures.ts 100.00% <100.00%> (+5.88%) ⬆️
... and 6 more

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more


export function updateExperimentalFeatures(enabledFeatures: string[] | undefined): void {
export function updateExperimentalFeatures(enabledFeatures: ExperimentalFeature[] | undefined): void {
Copy link
Contributor

Choose a reason for hiding this comment

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

🥜 nitpick: This function cannot update (disable) a feature already present. Maybe we should name it addExperimentalFeatures ?

Let's define the `enabledExperimentalFeature` during module evaluation.
This way, we don't need to worry about it being undefined.

Also, we are now validating `enabledExperimentalFeature` configuration
in `configuration.ts`, so move validation tests there.
@BenoitZugmeyer BenoitZugmeyer merged commit dd72371 into main Mar 29, 2023
@BenoitZugmeyer BenoitZugmeyer deleted the benoit/stricter-feature-flags branch March 29, 2023 14:21
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.

5 participants