1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +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:
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 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 />

View File

@ -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}

View File

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

View File

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

View File

@ -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,

View File

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

View File

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

View File

@ -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,

View File

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

View File

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