1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-15 01:16:22 +02:00

chore: remove scheduledConfigurationChanges flag (#6360)

What is says on the box

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
This commit is contained in:
andreas-unleash 2024-02-27 14:57:34 +02:00 committed by GitHub
parent 43b013ff2f
commit 9101c39eb7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 113 additions and 230 deletions

View File

@ -18,9 +18,6 @@ const uiConfigForEnterprise = () =>
versionInfo: { versionInfo: {
current: { oss: 'version', enterprise: 'version' }, current: { oss: 'version', enterprise: 'version' },
}, },
flags: {
scheduledConfigurationChanges: true,
},
}); });
const featureWithStrategyVariants = () => const featureWithStrategyVariants = () =>

View File

@ -142,9 +142,6 @@ const uiConfig = () => {
versionInfo: { versionInfo: {
current: { oss: 'version', enterprise: 'version' }, current: { oss: 'version', enterprise: 'version' },
}, },
flags: {
scheduledConfigurationChanges: true,
},
}); });
}; };

View File

@ -28,7 +28,6 @@ import { changesCount } from '../changesCount';
import { ChangeRequestReviewers } from './ChangeRequestReviewers/ChangeRequestReviewers'; import { ChangeRequestReviewers } from './ChangeRequestReviewers/ChangeRequestReviewers';
import { ChangeRequestRejectDialogue } from './ChangeRequestRejectDialog/ChangeRequestRejectDialog'; import { ChangeRequestRejectDialogue } from './ChangeRequestRejectDialog/ChangeRequestRejectDialog';
import { ApplyButton } from './ApplyButton/ApplyButton'; import { ApplyButton } from './ApplyButton/ApplyButton';
import { useUiFlag } from 'hooks/useUiFlag';
import { import {
ChangeRequestApplyScheduledDialogue, ChangeRequestApplyScheduledDialogue,
ChangeRequestRejectScheduledDialogue, ChangeRequestRejectScheduledDialogue,
@ -103,7 +102,6 @@ export const ChangeRequestOverview: FC = () => {
const { setToastData, setToastApiError } = useToast(); const { setToastData, setToastApiError } = useToast();
const { isChangeRequestConfiguredForReview } = const { isChangeRequestConfiguredForReview } =
useChangeRequestsEnabled(projectId); useChangeRequestsEnabled(projectId);
const scheduleChangeRequests = useUiFlag('scheduledConfigurationChanges');
const [disabled, setDisabled] = useState(false); const [disabled, setDisabled] = useState(false);
if (!changeRequest) { if (!changeRequest) {
@ -382,9 +380,6 @@ export const ChangeRequestOverview: FC = () => {
/> />
<ConditionallyRender <ConditionallyRender
condition={changeRequest.state === 'Approved'} condition={changeRequest.state === 'Approved'}
show={
<ConditionallyRender
condition={scheduleChangeRequests}
show={ show={
<ApplyButton <ApplyButton
onApply={onApplyChanges} onApply={onApplyChanges}
@ -393,41 +388,15 @@ export const ChangeRequestOverview: FC = () => {
disabled disabled
} }
onSchedule={() => onSchedule={() =>
setShowScheduleChangeDialog( setShowScheduleChangeDialog(true)
true,
)
} }
> >
Apply or schedule changes Apply or schedule changes
</ApplyButton> </ApplyButton>
} }
elseShow={
<PermissionButton
variant='contained'
onClick={onApplyChanges}
projectId={projectId}
permission={
APPLY_CHANGE_REQUEST
}
environmentId={
changeRequest.environment
}
disabled={
!allowChangeRequestActions ||
disabled
}
>
Apply changes
</PermissionButton>
}
/>
}
/> />
<ConditionallyRender <ConditionallyRender
condition={ condition={changeRequest.state === 'Scheduled'}
scheduleChangeRequests &&
changeRequest.state === 'Scheduled'
}
show={ show={
<ApplyButton <ApplyButton
onApply={() => onApply={() =>
@ -457,10 +426,7 @@ export const ChangeRequestOverview: FC = () => {
} }
show={ show={
<ConditionallyRender <ConditionallyRender
condition={ condition={Boolean(scheduledAt)}
scheduleChangeRequests &&
Boolean(scheduledAt)
}
show={ show={
<StyledButton <StyledButton
variant='outlined' variant='outlined'
@ -513,17 +479,12 @@ export const ChangeRequestOverview: FC = () => {
onClose={onCancelReject} onClose={onCancelReject}
disabled={disabled} disabled={disabled}
/> />
<ConditionallyRender
condition={scheduleChangeRequests}
show={
<> <>
<ScheduleChangeRequestDialog <ScheduleChangeRequestDialog
open={showScheduleChangesDialog} open={showScheduleChangesDialog}
onConfirm={onScheduleChangeRequest} onConfirm={onScheduleChangeRequest}
onClose={onScheduleChangeAbort} onClose={onScheduleChangeAbort}
disabled={ disabled={!allowChangeRequestActions || disabled}
!allowChangeRequestActions || disabled
}
projectId={projectId} projectId={projectId}
environment={changeRequest.environment} environment={changeRequest.environment}
primaryButtonText={ primaryButtonText={
@ -543,9 +504,7 @@ export const ChangeRequestOverview: FC = () => {
onConfirm={onApplyChanges} onConfirm={onApplyChanges}
onClose={onApplyScheduledAbort} onClose={onApplyScheduledAbort}
scheduledTime={scheduledAt} scheduledTime={scheduledAt}
disabled={ disabled={!allowChangeRequestActions || disabled}
!allowChangeRequestActions || disabled
}
projectId={projectId} projectId={projectId}
environment={changeRequest.environment} environment={changeRequest.environment}
/> />
@ -557,8 +516,6 @@ export const ChangeRequestOverview: FC = () => {
disabled={disabled} disabled={disabled}
/> />
</> </>
}
/>
</ChangeRequestBody> </ChangeRequestBody>
</> </>
); );

View File

@ -100,9 +100,6 @@ const uiConfig = () => {
versionInfo: { versionInfo: {
current: { oss: 'version', enterprise: 'version' }, current: { oss: 'version', enterprise: 'version' },
}, },
flags: {
scheduledConfigurationChanges: true,
},
}); });
}; };

View File

@ -93,9 +93,6 @@ const uiConfig = () => {
versionInfo: { versionInfo: {
current: { oss: 'version', enterprise: 'version' }, current: { oss: 'version', enterprise: 'version' },
}, },
flags: {
scheduledConfigurationChanges: true,
},
}); });
}; };

View File

@ -21,9 +21,6 @@ export const ChangeRequestProcessHelp: VFC<IChangeRequestProcessHelpProps> =
const theme = useTheme(); const theme = useTheme();
const isSmallScreen = useMediaQuery(theme.breakpoints.down('md')); const isSmallScreen = useMediaQuery(theme.breakpoints.down('md'));
const [isOpen, setIsOpen] = useState(false); const [isOpen, setIsOpen] = useState(false);
const showScheduleInformation = useUiFlag(
'scheduledConfigurationChanges',
);
const descriptionId = 'change-request-process-description'; const descriptionId = 'change-request-process-description';
@ -96,113 +93,71 @@ export const ChangeRequestProcessHelp: VFC<IChangeRequestProcessHelpProps> =
</li> </li>
</ul> </ul>
</li> </li>
<ConditionallyRender
condition={showScheduleInformation}
show={
<> <>
<li> <li>
Once approved, a user with the{' '} Once approved, a user with the{' '}
<strong> <strong>
Apply/Reject change Apply/Reject change request
request
</strong>{' '} </strong>{' '}
permission can apply, schedule, permission can apply, schedule, or
or reject the changes. reject the changes.
<ul> <ul>
<li> <li>
If applied, the changes If applied, the changes will
will take effect and the take effect and the change
change request will be request will be closed.
closed.
</li> </li>
<li> <li>
If scheduled, Unleash If scheduled, Unleash will
will attempt to apply attempt to apply the changes at
the changes at the the scheduled date and time.
scheduled date and time.
</li> </li>
<li> <li>
The user who created the The user who created the change
change request can request can cancel the changes
cancel the changes up up until they are applied or
until they are applied scheduled.
or scheduled.
</li> </li>
</ul> </ul>
</li> </li>
<li> <li>
A user with the{' '} A user with the{' '}
<strong> <strong>
Apply/Reject change Apply/Reject change request
request
</strong>{' '} </strong>{' '}
permission can reschedule, permission can reschedule, reject, or
reject, or immediately apply a immediately apply a scheduled change
scheduled change request. request.
<ul> <ul>
<li> <li>
If any of the flags or If any of the flags or
strategies in the change strategies in the change request
request are archived or are archived or deleted (outside
deleted (outside of the of the change request), thus
change request), thus creating a conflict, Unleash
creating a conflict, will send an email out to the
Unleash will send an change request author and to the
email out to the change user who (last) scheduled the
request author and to change request.
the user who (last)
scheduled the change
request.
</li> </li>
<li> <li>
If the scheduled changes If the scheduled changes contain
contain any conflicts, any conflicts, Unleash will
Unleash will refuse to refuse to apply them.
apply them.
</li> </li>
<li> <li>
If the user who If the user who scheduled the
scheduled the changes is changes is removed from this
removed from this Unleash instance, the scheduled
Unleash instance, the changes will also not be
scheduled changes will applied.
also not be applied.
</li> </li>
</ul> </ul>
</li> </li>
</> </>
}
elseShow={
<li>
Once approved, a user with the{' '}
<strong>
Apply/Reject change request
</strong>{' '}
permission can apply or reject the
changes.
<ul>
<li>
Once applied, the changes
will take effect and the
change request will be
closed.
</li>
<li>
The user who created the
change request can cancel
the changes up until they
are applied.
</li>
</ul>
</li>
}
/>
</ol> </ol>
</Typography> </Typography>
<Box sx={{ mt: 3 }}> <Box sx={{ mt: 3 }}>
<ConditionallyRender
condition={showScheduleInformation}
show={
<ChangeRequestProcessWithScheduleImage <ChangeRequestProcessWithScheduleImage
aria-details={descriptionId} aria-details={descriptionId}
style={{ style={{
@ -210,16 +165,6 @@ export const ChangeRequestProcessHelp: VFC<IChangeRequestProcessHelpProps> =
height: 'auto', height: 'auto',
}} }}
/> />
}
elseShow={
<ChangeRequestProcessImage
aria-details={descriptionId}
style={{
maxWidth: 'calc(100vw - 4rem)',
}}
/>
}
/>
</Box> </Box>
</Box> </Box>
</Popover> </Popover>

View File

@ -62,7 +62,6 @@ export type UiFlags = {
strategyVariant?: boolean; strategyVariant?: boolean;
doraMetrics?: boolean; doraMetrics?: boolean;
dependentFeatures?: boolean; dependentFeatures?: boolean;
scheduledConfigurationChanges?: boolean;
newStrategyConfiguration?: boolean; newStrategyConfiguration?: boolean;
incomingWebhooks?: boolean; incomingWebhooks?: boolean;
automatedActions?: boolean; automatedActions?: boolean;

View File

@ -133,7 +133,6 @@ exports[`should create default config 1`] = `
"personalAccessTokensKillSwitch": false, "personalAccessTokensKillSwitch": false,
"proPlanAutoCharge": false, "proPlanAutoCharge": false,
"responseTimeWithAppNameKillSwitch": false, "responseTimeWithAppNameKillSwitch": false,
"scheduledConfigurationChanges": false,
"scimApi": false, "scimApi": false,
"sdkReporting": false, "sdkReporting": false,
"showInactiveUsers": false, "showInactiveUsers": false,

View File

@ -26,7 +26,6 @@ export type IFlagKey =
| 'advancedPlayground' | 'advancedPlayground'
| 'filterInvalidClientMetrics' | 'filterInvalidClientMetrics'
| 'disableMetrics' | 'disableMetrics'
| 'scheduledConfigurationChanges'
| 'stripClientHeadersOn304' | 'stripClientHeadersOn304'
| 'stripHeadersOnAPI' | 'stripHeadersOnAPI'
| 'incomingWebhooks' | 'incomingWebhooks'
@ -130,10 +129,6 @@ const flags: IFlags = {
process.env.UNLEASH_EXPERIMENTAL_DISABLE_METRICS, process.env.UNLEASH_EXPERIMENTAL_DISABLE_METRICS,
false, false,
), ),
scheduledConfigurationChanges: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_SCHEDULED_CONFIGURATION_CHANGES,
false,
),
stripClientHeadersOn304: parseEnvVarBoolean( stripClientHeadersOn304: parseEnvVarBoolean(
process.env process.env
.UNLEASH_EXPERIMENTAL_DETECT_SEGMENT_USAGE_IN_CHANGE_REQUESTS, .UNLEASH_EXPERIMENTAL_DETECT_SEGMENT_USAGE_IN_CHANGE_REQUESTS,