1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-05-17 01:17:29 +02:00

Chore: remove disableEnvsOnRevive flag (#5391)

Closes #
[1-1646](https://linear.app/unleash/issue/1-1646/clean-disableenvsonrevive-flag-for-release)

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
This commit is contained in:
andreas-unleash 2023-11-23 10:10:37 +02:00 committed by GitHub
parent b211345a44
commit 3e12c2b5b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 14 additions and 40 deletions

View File

@ -54,7 +54,7 @@ const Component = () => {
const server = testServerSetup(); const server = testServerSetup();
const setupApi = (disableEnvsOnRevive = false) => { const setupApi = () => {
testServerRoute( testServerRoute(
server, server,
'/api/admin/projects/default/revive', '/api/admin/projects/default/revive',
@ -65,9 +65,6 @@ const setupApi = (disableEnvsOnRevive = false) => {
testServerRoute(server, '/api/admin/ui-config', { testServerRoute(server, '/api/admin/ui-config', {
environment: 'Open Source', environment: 'Open Source',
flags: {
disableEnvsOnRevive,
},
}); });
}; };
@ -79,7 +76,7 @@ test('should load the table', async () => {
}); });
test('should show confirm dialog when reviving toggle', async () => { test('should show confirm dialog when reviving toggle', async () => {
setupApi(false); setupApi();
render( render(
<> <>
<ToastRenderer /> <ToastRenderer />
@ -104,7 +101,7 @@ test('should show confirm dialog when reviving toggle', async () => {
}); });
test('should show confirm dialog when batch reviving toggle', async () => { test('should show confirm dialog when batch reviving toggle', async () => {
setupApi(false); setupApi();
render( render(
<> <>
<ToastRenderer /> <ToastRenderer />
@ -135,7 +132,7 @@ test('should show confirm dialog when batch reviving toggle', async () => {
}); });
test('should show info box when disableAllEnvsOnRevive flag is on', async () => { test('should show info box when disableAllEnvsOnRevive flag is on', async () => {
setupApi(true); setupApi();
render( render(
<> <>
<ToastRenderer /> <ToastRenderer />

View File

@ -28,7 +28,6 @@ export const ArchivedFeatureReviveConfirm = ({
}: IArchivedFeatureReviveConfirmProps) => { }: IArchivedFeatureReviveConfirmProps) => {
const { setToastData, setToastApiError } = useToast(); const { setToastData, setToastApiError } = useToast();
const { reviveFeatures } = useProjectApi(); const { reviveFeatures } = useProjectApi();
const disableAllEnvsOnRevive = useUiFlag('disableEnvsOnRevive');
const onReviveFeatureToggle = async () => { const onReviveFeatureToggle = async () => {
try { try {
@ -70,15 +69,10 @@ export const ArchivedFeatureReviveConfirm = ({
onClick={onReviveFeatureToggle} onClick={onReviveFeatureToggle}
onClose={clearModal} onClose={clearModal}
> >
<ConditionallyRender <Alert severity='info'>
condition={Boolean(disableAllEnvsOnRevive)} Revived feature toggles will be automatically disabled in all
show={ environments
<Alert severity='info'> </Alert>
Revived feature toggles will be automatically disabled
in all environments
</Alert>
}
/>
<ConditionallyRender <ConditionallyRender
condition={revivedFeatures.length > 1} condition={revivedFeatures.length > 1}

View File

@ -65,7 +65,6 @@ export type UiFlags = {
privateProjects?: boolean; privateProjects?: boolean;
dependentFeatures?: boolean; dependentFeatures?: boolean;
banners?: boolean; banners?: boolean;
disableEnvsOnRevive?: boolean;
playgroundImprovements?: boolean; playgroundImprovements?: boolean;
scheduledConfigurationChanges?: boolean; scheduledConfigurationChanges?: boolean;
featureSearchAPI?: boolean; featureSearchAPI?: boolean;

View File

@ -78,7 +78,6 @@ exports[`should create default config 1`] = `
"dependentFeatures": false, "dependentFeatures": false,
"detectSegmentUsageInChangeRequests": false, "detectSegmentUsageInChangeRequests": false,
"disableBulkToggle": false, "disableBulkToggle": false,
"disableEnvsOnRevive": false,
"disableMetrics": false, "disableMetrics": false,
"disableNotifications": false, "disableNotifications": false,
"embedProxy": true, "embedProxy": true,

View File

@ -1953,11 +1953,9 @@ class FeatureToggleService {
); );
await this.featureToggleStore.batchRevive(eligibleFeatureNames); await this.featureToggleStore.batchRevive(eligibleFeatureNames);
if (this.flagResolver.isEnabled('disableEnvsOnRevive')) { await this.featureToggleStore.disableAllEnvironmentsForFeatures(
await this.featureToggleStore.disableAllEnvironmentsForFeatures( eligibleFeatureNames,
eligibleFeatureNames, );
);
}
await this.eventService.storeEvents( await this.eventService.storeEvents(
eligibleFeatures.map( eligibleFeatures.map(
@ -1974,12 +1972,9 @@ class FeatureToggleService {
// TODO: add project id. // TODO: add project id.
async reviveFeature(featureName: string, createdBy: string): Promise<void> { async reviveFeature(featureName: string, createdBy: string): Promise<void> {
const toggle = await this.featureToggleStore.revive(featureName); const toggle = await this.featureToggleStore.revive(featureName);
await this.featureToggleStore.disableAllEnvironmentsForFeatures([
if (this.flagResolver.isEnabled('disableEnvsOnRevive')) { featureName,
await this.featureToggleStore.disableAllEnvironmentsForFeatures([ ]);
featureName,
]);
}
await this.eventService.storeEvent( await this.eventService.storeEvent(
new FeatureRevivedEvent({ new FeatureRevivedEvent({
createdBy, createdBy,

View File

@ -16,7 +16,6 @@ beforeAll(async () => {
experimental: { experimental: {
flags: { flags: {
strictSchemaValidation: true, strictSchemaValidation: true,
disableEnvsOnRevive: true,
}, },
}, },
}, },

View File

@ -16,7 +16,6 @@ beforeAll(async () => {
experimental: { experimental: {
flags: { flags: {
strictSchemaValidation: true, strictSchemaValidation: true,
disableEnvsOnRevive: true,
useLastSeenRefactor: true, useLastSeenRefactor: true,
}, },
}, },

View File

@ -28,7 +28,6 @@ export type IFlagKey =
| 'disableMetrics' | 'disableMetrics'
| 'useLastSeenRefactor' | 'useLastSeenRefactor'
| 'banners' | 'banners'
| 'disableEnvsOnRevive'
| 'playgroundImprovements' | 'playgroundImprovements'
| 'featureSearchAPI' | 'featureSearchAPI'
| 'featureSearchFrontend' | 'featureSearchFrontend'
@ -129,10 +128,6 @@ const flags: IFlags = {
process.env.UNLEASH_EXPERIMENTAL_USE_LAST_SEEN_REFACTOR, process.env.UNLEASH_EXPERIMENTAL_USE_LAST_SEEN_REFACTOR,
false, false,
), ),
disableEnvsOnRevive: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_DISABLE_ENVS_ON_REVIVE,
false,
),
playgroundImprovements: parseEnvVarBoolean( playgroundImprovements: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_PLAYGROUND_IMPROVEMENTS, process.env.UNLEASH_EXPERIMENTAL_PLAYGROUND_IMPROVEMENTS,
false, false,

View File

@ -41,8 +41,6 @@ process.nextTick(async () => {
privateProjects: true, privateProjects: true,
dependentFeatures: true, dependentFeatures: true,
useLastSeenRefactor: true, useLastSeenRefactor: true,
disableEnvsOnRevive: true,
playgroundImprovements: true,
featureSearchAPI: true, featureSearchAPI: true,
featureSearchFrontend: false, featureSearchFrontend: false,
}, },

View File

@ -18,7 +18,6 @@ beforeAll(async () => {
flags: { flags: {
strictSchemaValidation: true, strictSchemaValidation: true,
dependentFeatures: true, dependentFeatures: true,
disableEnvsOnRevive: true,
}, },
}, },
}, },