Skip to content
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

[Gitar] Cleaning up stale flag: maintenanceMode with value false #830

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion frontend/src/interfaces/uiConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export type UiFlags = {
UNLEASH_CLOUD?: boolean;
UG?: boolean;
embedProxyFrontend?: boolean;
maintenanceMode?: boolean;
messageBanner?: Variant;
banner?: Variant;
featuresExportImport?: boolean;
Expand Down
1 change: 0 additions & 1 deletion src/lib/__snapshots__/create-config.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ exports[`should create default config 1`] = `
"integrationEvents": false,
"killInsightsUI": false,
"killScheduledChangeRequestCache": false,
"maintenanceMode": false,
"manyStrategiesPagination": false,
"messageBanner": {
"enabled": false,
Expand Down
5 changes: 1 addition & 4 deletions src/lib/features/maintenance/maintenance-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ export default class MaintenanceService implements IMaintenanceStatus {

async isMaintenanceMode(): Promise<boolean> {
try {
return (
this.config.flagResolver.isEnabled('maintenanceMode') ||
(await this.resolveMaintenance())
);
return await this.resolveMaintenance();
} catch (e) {
this.logger.warn('Error checking maintenance mode', e);
return false;
Expand Down
5 changes: 0 additions & 5 deletions src/lib/openapi/spec/ui-config-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ export const uiConfigSchema = {
description: 'Whether this instance can send out emails or not.',
example: true,
},
maintenanceMode: {
type: 'boolean',
description: 'Whether maintenance mode is currently active or not.',
example: false,
},
segmentValuesLimit: {
type: 'number',
description:
Expand Down
5 changes: 0 additions & 5 deletions src/lib/types/experimental.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export type IFlagKey =
| 'embedProxy'
| 'embedProxyFrontend'
| 'responseTimeWithAppNameKillSwitch'
| 'maintenanceMode'
| 'messageBanner'
| 'featuresExportImport'
| 'caseInsensitiveInOperators'
Expand Down Expand Up @@ -87,10 +86,6 @@ const flags: IFlags = {
process.env.UNLEASH_RESPONSE_TIME_WITH_APP_NAME_KILL_SWITCH,
false,
),
maintenanceMode: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_MAINTENANCE_MODE,
false,
),
messageBanner: {
name: 'message-banner',
enabled: parseEnvVarBoolean(
Expand Down
8 changes: 2 additions & 6 deletions src/test/e2e/api/admin/maintenance.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ afterAll(async () => {
test('should not allow to create feature flags in maintenance mode', async () => {
const appWithMaintenanceMode = await setupAppWithCustomConfig(db.stores, {
experimental: {
flags: {
maintenanceMode: true,
},
flags: {},
},
});

Expand Down Expand Up @@ -68,9 +66,7 @@ test('should go into maintenance mode, when user has set it', async () => {
test('maintenance mode flag should take precedence over maintenance mode setting', async () => {
const appWithMaintenanceMode = await setupAppWithCustomConfig(db.stores, {
experimental: {
flags: {
maintenanceMode: true,
},
flags: {},
},
});

Expand Down
Loading