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 setupApi = (disableEnvsOnRevive = false) => {
 | 
			
		||||
const setupApi = () => {
 | 
			
		||||
    testServerRoute(
 | 
			
		||||
        server,
 | 
			
		||||
        '/api/admin/projects/default/revive',
 | 
			
		||||
@ -65,9 +65,6 @@ const setupApi = (disableEnvsOnRevive = false) => {
 | 
			
		||||
 | 
			
		||||
    testServerRoute(server, '/api/admin/ui-config', {
 | 
			
		||||
        environment: 'Open Source',
 | 
			
		||||
        flags: {
 | 
			
		||||
            disableEnvsOnRevive,
 | 
			
		||||
        },
 | 
			
		||||
    });
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@ -79,7 +76,7 @@ test('should load the table', async () => {
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
test('should show confirm dialog when reviving toggle', async () => {
 | 
			
		||||
    setupApi(false);
 | 
			
		||||
    setupApi();
 | 
			
		||||
    render(
 | 
			
		||||
        <>
 | 
			
		||||
            <ToastRenderer />
 | 
			
		||||
@ -104,7 +101,7 @@ test('should show confirm dialog when reviving toggle', async () => {
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
test('should show confirm dialog when batch reviving toggle', async () => {
 | 
			
		||||
    setupApi(false);
 | 
			
		||||
    setupApi();
 | 
			
		||||
    render(
 | 
			
		||||
        <>
 | 
			
		||||
            <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 () => {
 | 
			
		||||
    setupApi(true);
 | 
			
		||||
    setupApi();
 | 
			
		||||
    render(
 | 
			
		||||
        <>
 | 
			
		||||
            <ToastRenderer />
 | 
			
		||||
 | 
			
		||||
@ -28,7 +28,6 @@ export const ArchivedFeatureReviveConfirm = ({
 | 
			
		||||
}: IArchivedFeatureReviveConfirmProps) => {
 | 
			
		||||
    const { setToastData, setToastApiError } = useToast();
 | 
			
		||||
    const { reviveFeatures } = useProjectApi();
 | 
			
		||||
    const disableAllEnvsOnRevive = useUiFlag('disableEnvsOnRevive');
 | 
			
		||||
 | 
			
		||||
    const onReviveFeatureToggle = async () => {
 | 
			
		||||
        try {
 | 
			
		||||
@ -70,15 +69,10 @@ export const ArchivedFeatureReviveConfirm = ({
 | 
			
		||||
            onClick={onReviveFeatureToggle}
 | 
			
		||||
            onClose={clearModal}
 | 
			
		||||
        >
 | 
			
		||||
            <ConditionallyRender
 | 
			
		||||
                condition={Boolean(disableAllEnvsOnRevive)}
 | 
			
		||||
                show={
 | 
			
		||||
            <Alert severity='info'>
 | 
			
		||||
                        Revived feature toggles will be automatically disabled
 | 
			
		||||
                        in all environments
 | 
			
		||||
                Revived feature toggles will be automatically disabled in all
 | 
			
		||||
                environments
 | 
			
		||||
            </Alert>
 | 
			
		||||
                }
 | 
			
		||||
            />
 | 
			
		||||
 | 
			
		||||
            <ConditionallyRender
 | 
			
		||||
                condition={revivedFeatures.length > 1}
 | 
			
		||||
 | 
			
		||||
@ -65,7 +65,6 @@ export type UiFlags = {
 | 
			
		||||
    privateProjects?: boolean;
 | 
			
		||||
    dependentFeatures?: boolean;
 | 
			
		||||
    banners?: boolean;
 | 
			
		||||
    disableEnvsOnRevive?: boolean;
 | 
			
		||||
    playgroundImprovements?: boolean;
 | 
			
		||||
    scheduledConfigurationChanges?: boolean;
 | 
			
		||||
    featureSearchAPI?: boolean;
 | 
			
		||||
 | 
			
		||||
@ -78,7 +78,6 @@ exports[`should create default config 1`] = `
 | 
			
		||||
      "dependentFeatures": false,
 | 
			
		||||
      "detectSegmentUsageInChangeRequests": false,
 | 
			
		||||
      "disableBulkToggle": false,
 | 
			
		||||
      "disableEnvsOnRevive": false,
 | 
			
		||||
      "disableMetrics": false,
 | 
			
		||||
      "disableNotifications": false,
 | 
			
		||||
      "embedProxy": true,
 | 
			
		||||
 | 
			
		||||
@ -1953,11 +1953,9 @@ class FeatureToggleService {
 | 
			
		||||
        );
 | 
			
		||||
        await this.featureToggleStore.batchRevive(eligibleFeatureNames);
 | 
			
		||||
 | 
			
		||||
        if (this.flagResolver.isEnabled('disableEnvsOnRevive')) {
 | 
			
		||||
        await this.featureToggleStore.disableAllEnvironmentsForFeatures(
 | 
			
		||||
            eligibleFeatureNames,
 | 
			
		||||
        );
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        await this.eventService.storeEvents(
 | 
			
		||||
            eligibleFeatures.map(
 | 
			
		||||
@ -1974,12 +1972,9 @@ class FeatureToggleService {
 | 
			
		||||
    // TODO: add project id.
 | 
			
		||||
    async reviveFeature(featureName: string, createdBy: string): Promise<void> {
 | 
			
		||||
        const toggle = await this.featureToggleStore.revive(featureName);
 | 
			
		||||
 | 
			
		||||
        if (this.flagResolver.isEnabled('disableEnvsOnRevive')) {
 | 
			
		||||
        await this.featureToggleStore.disableAllEnvironmentsForFeatures([
 | 
			
		||||
            featureName,
 | 
			
		||||
        ]);
 | 
			
		||||
        }
 | 
			
		||||
        await this.eventService.storeEvent(
 | 
			
		||||
            new FeatureRevivedEvent({
 | 
			
		||||
                createdBy,
 | 
			
		||||
 | 
			
		||||
@ -16,7 +16,6 @@ beforeAll(async () => {
 | 
			
		||||
            experimental: {
 | 
			
		||||
                flags: {
 | 
			
		||||
                    strictSchemaValidation: true,
 | 
			
		||||
                    disableEnvsOnRevive: true,
 | 
			
		||||
                },
 | 
			
		||||
            },
 | 
			
		||||
        },
 | 
			
		||||
 | 
			
		||||
@ -16,7 +16,6 @@ beforeAll(async () => {
 | 
			
		||||
            experimental: {
 | 
			
		||||
                flags: {
 | 
			
		||||
                    strictSchemaValidation: true,
 | 
			
		||||
                    disableEnvsOnRevive: true,
 | 
			
		||||
                    useLastSeenRefactor: true,
 | 
			
		||||
                },
 | 
			
		||||
            },
 | 
			
		||||
 | 
			
		||||
@ -28,7 +28,6 @@ export type IFlagKey =
 | 
			
		||||
    | 'disableMetrics'
 | 
			
		||||
    | 'useLastSeenRefactor'
 | 
			
		||||
    | 'banners'
 | 
			
		||||
    | 'disableEnvsOnRevive'
 | 
			
		||||
    | 'playgroundImprovements'
 | 
			
		||||
    | 'featureSearchAPI'
 | 
			
		||||
    | 'featureSearchFrontend'
 | 
			
		||||
@ -129,10 +128,6 @@ const flags: IFlags = {
 | 
			
		||||
        process.env.UNLEASH_EXPERIMENTAL_USE_LAST_SEEN_REFACTOR,
 | 
			
		||||
        false,
 | 
			
		||||
    ),
 | 
			
		||||
    disableEnvsOnRevive: parseEnvVarBoolean(
 | 
			
		||||
        process.env.UNLEASH_EXPERIMENTAL_DISABLE_ENVS_ON_REVIVE,
 | 
			
		||||
        false,
 | 
			
		||||
    ),
 | 
			
		||||
    playgroundImprovements: parseEnvVarBoolean(
 | 
			
		||||
        process.env.UNLEASH_EXPERIMENTAL_PLAYGROUND_IMPROVEMENTS,
 | 
			
		||||
        false,
 | 
			
		||||
 | 
			
		||||
@ -41,8 +41,6 @@ process.nextTick(async () => {
 | 
			
		||||
                        privateProjects: true,
 | 
			
		||||
                        dependentFeatures: true,
 | 
			
		||||
                        useLastSeenRefactor: true,
 | 
			
		||||
                        disableEnvsOnRevive: true,
 | 
			
		||||
                        playgroundImprovements: true,
 | 
			
		||||
                        featureSearchAPI: true,
 | 
			
		||||
                        featureSearchFrontend: false,
 | 
			
		||||
                    },
 | 
			
		||||
 | 
			
		||||
@ -18,7 +18,6 @@ beforeAll(async () => {
 | 
			
		||||
                flags: {
 | 
			
		||||
                    strictSchemaValidation: true,
 | 
			
		||||
                    dependentFeatures: true,
 | 
			
		||||
                    disableEnvsOnRevive: true,
 | 
			
		||||
                },
 | 
			
		||||
            },
 | 
			
		||||
        },
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user