mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01: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:
		
							parent
							
								
									b211345a44
								
							
						
					
					
						commit
						3e12c2b5b6
					
				| @ -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 /> | ||||||
|  | |||||||
| @ -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 |  | ||||||
|                 condition={Boolean(disableAllEnvsOnRevive)} |  | ||||||
|                 show={ |  | ||||||
|             <Alert severity='info'> |             <Alert severity='info'> | ||||||
|                         Revived feature toggles will be automatically disabled |                 Revived feature toggles will be automatically disabled in all | ||||||
|                         in all environments |                 environments | ||||||
|             </Alert> |             </Alert> | ||||||
|                 } |  | ||||||
|             /> |  | ||||||
| 
 | 
 | ||||||
|             <ConditionallyRender |             <ConditionallyRender | ||||||
|                 condition={revivedFeatures.length > 1} |                 condition={revivedFeatures.length > 1} | ||||||
|  | |||||||
| @ -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; | ||||||
|  | |||||||
| @ -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, | ||||||
|  | |||||||
| @ -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); | ||||||
| 
 |  | ||||||
|         if (this.flagResolver.isEnabled('disableEnvsOnRevive')) { |  | ||||||
|         await this.featureToggleStore.disableAllEnvironmentsForFeatures([ |         await this.featureToggleStore.disableAllEnvironmentsForFeatures([ | ||||||
|             featureName, |             featureName, | ||||||
|         ]); |         ]); | ||||||
|         } |  | ||||||
|         await this.eventService.storeEvent( |         await this.eventService.storeEvent( | ||||||
|             new FeatureRevivedEvent({ |             new FeatureRevivedEvent({ | ||||||
|                 createdBy, |                 createdBy, | ||||||
|  | |||||||
| @ -16,7 +16,6 @@ beforeAll(async () => { | |||||||
|             experimental: { |             experimental: { | ||||||
|                 flags: { |                 flags: { | ||||||
|                     strictSchemaValidation: true, |                     strictSchemaValidation: true, | ||||||
|                     disableEnvsOnRevive: true, |  | ||||||
|                 }, |                 }, | ||||||
|             }, |             }, | ||||||
|         }, |         }, | ||||||
|  | |||||||
| @ -16,7 +16,6 @@ beforeAll(async () => { | |||||||
|             experimental: { |             experimental: { | ||||||
|                 flags: { |                 flags: { | ||||||
|                     strictSchemaValidation: true, |                     strictSchemaValidation: true, | ||||||
|                     disableEnvsOnRevive: true, |  | ||||||
|                     useLastSeenRefactor: true, |                     useLastSeenRefactor: true, | ||||||
|                 }, |                 }, | ||||||
|             }, |             }, | ||||||
|  | |||||||
| @ -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, | ||||||
|  | |||||||
| @ -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, | ||||||
|                     }, |                     }, | ||||||
|  | |||||||
| @ -18,7 +18,6 @@ beforeAll(async () => { | |||||||
|                 flags: { |                 flags: { | ||||||
|                     strictSchemaValidation: true, |                     strictSchemaValidation: true, | ||||||
|                     dependentFeatures: true, |                     dependentFeatures: true, | ||||||
|                     disableEnvsOnRevive: true, |  | ||||||
|                 }, |                 }, | ||||||
|             }, |             }, | ||||||
|         }, |         }, | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user