-
Notifications
You must be signed in to change notification settings - Fork 799
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
[backend/frontend] Introduce dev flags to deactivate feature in ongoing development #5802
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #5802 +/- ##
==========================================
- Coverage 64.82% 64.75% -0.08%
==========================================
Files 521 521
Lines 61348 61366 +18
Branches 4900 4905 +5
==========================================
- Hits 39770 39737 -33
- Misses 21578 21629 +51 ☔ View full report in Codecov by Sentry. |
3972324
to
3d01224
Compare
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.
I just did a PR review, I did not tried it yet.
To avoid mispelling, I think it's better to have the 'ed' everywhere (enabled, disabled, activated etc..) so I did suggestions in that way.
|
||
const CustomizationMenu: FunctionComponent = () => { | ||
const { isFeatureEnable } = useHelper(); |
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.
const { isFeatureEnable } = useHelper(); | |
const { isFeatureEnabled } = useHelper(); |
@@ -19,6 +21,10 @@ const CustomizationMenu: FunctionComponent = () => { | |||
path: '/dashboard/settings/customization/retention', | |||
label: 'Retention policies', | |||
}, | |||
...(isFeatureEnable('INDICATOR_DECAY') ? [{ |
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.
...(isFeatureEnable('INDICATOR_DECAY') ? [{ | |
...(isFeatureEnabled('INDICATOR_DECAY') ? [{ |
@@ -36,7 +36,7 @@ const isFeatureEnable = ( | |||
) => { | |||
const flags = settings.platform_feature_flags ?? []; | |||
const feature = flags.find((f) => f.id === id); | |||
return feature !== undefined && feature.enable === true; | |||
return feature === undefined || feature.enable === true; |
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.
return feature === undefined || feature.enable === true; | |
return feature === undefined || feature.enabled === true; |
label={ | ||
module.enable ? t_i18n('Enabled') : t_i18n('Disabled') | ||
} | ||
label={module.enable ? t_i18n('Enabled') : t_i18n('Disabled')} |
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.
label={module.enable ? t_i18n('Enabled') : t_i18n('Disabled')} | |
label={module.enabled ? t_i18n('Enabled') : t_i18n('Disabled')} |
Let's enable all feature flags in the backend tests, to cover the code during development even if not enabled in production yet. |
That's a good point but there is more work and alignment to do than your proposal to really align everything around "enabled" like the modules that share the graphql object for the result. Modules "enable" is currently written in redis so the modification of the name must be changed carefully. For now i will propose to only focus on the flag here and do the change of semantic in another PR |
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.
Tested locally on Decay feature, it's working as expected.
I tested:
- without disabled_dev_features => decay hidden, ok
- with disabled_dev_features empty => decay enabled, ok
- with disabled_dev_features = ['INDICATOR_DECAY'] => decay hidden, ok
Done |
This PR aims to introduce a dev configuration to disable features that are currently in development but not ready yet.
That's will ease the merging of large feature but providing simple tools to hide the feature.
In this PR you will find a example of Decay indicator feature deactivation.