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

remove organization maintenance mode + fix integration maintenance mode #2511

Merged
merged 8 commits into from
Jul 12, 2023

Conversation

joeyorlando
Copy link
Contributor

@joeyorlando joeyorlando commented Jul 12, 2023

What this PR does

Which issue(s) this PR fixes

Checklist

  • Unit, integration, and e2e (if applicable) tests updated
  • Documentation added (or pr:no public docs PR label added if not required)
  • CHANGELOG.md updated (or pr:no changelog PR label added if not required)

@joeyorlando joeyorlando force-pushed the jorlando/remove-org-maintenance-mode branch from fe39214 to eb1d549 Compare July 12, 2023 12:13
Comment on lines +76 to +78
# TODO: in a subsequent PR, remove the inheritance from MaintainableObject (plus generate the database migration file)
# this will remove the maintenance related columns that're no longer used on the organization object
# class Organization(models.Model):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these columns will be removed in a subsequent PR, for now I just removed any reference to them. I believe if we remove them in this PR, it'd cause a brief period of HTTP 500s where Organization serializers in pods running the old version fail to find these columns in the database (because they were just dropped).

const maintenanceModeEnabledTooltip = page.getByTestId(remainingTimeTooltipTestId);
await maintenanceModeEnabledTooltip.waitFor({ state: 'visible' });

expect(await page.getByTestId(`${remainingTimeTooltipTestId}-text`).innerText()).toContain(REMAINING_TIME_TEXT);
Copy link
Contributor Author

@joeyorlando joeyorlando Jul 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO

  • add step to create a few alert groups and assert they're grouped based on which mode we selected
  • stop maintenance

@joeyorlando joeyorlando changed the title [WIP] remove organization maintenance mode + fix integration maintenance mode remove organization maintenance mode + fix integration maintenance mode Jul 12, 2023
@joeyorlando joeyorlando marked this pull request as ready for review July 12, 2023 12:15
@joeyorlando joeyorlando requested review from a team July 12, 2023 12:15
Copy link
Member

@vstpme vstpme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@joeyorlando joeyorlando added the pr:no public docs Added to a PR that does not require public documentation updates label Jul 12, 2023
Comment on lines +38 to +51
const handleSubmit = useCallback(async (data) => {
try {
await alertReceiveChannelStore.startMaintenanceMode(
initialData.alert_receive_channel_id,
data.mode,
data.duration,
data.alert_receive_channel_id
)
.then(() => {
onHide();
onUpdate();
data.duration
);

openNotification('Maintenance has been started');
})
.catch(showApiError);
onHide();
onUpdate();
openNotification('Maintenance has been started');
} catch (err) {
showApiError(err);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was the main fix on the UI for starting maintenance mode

Comment on lines +949 to +955
async function onStopMaintenance() {
setConfirmModal(undefined);

maintenanceStore
.stopMaintenanceMode(MaintenanceType.alert_receive_channel, id)
.then(() => maintenanceStore.updateMaintenances())
.then(() => openNotification('Maintenance has been stopped'))
.then(() => alertReceiveChannelStore.updateItem(alertReceiveChannel.id));
await alertReceiveChannelStore.stopMaintenanceMode(id);

openNotification('Maintenance has been stopped');
await alertReceiveChannelStore.updateItem(id);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main fix on the UI for stopping maintenance mode

@joeyorlando joeyorlando merged commit d24dc4b into dev Jul 12, 2023
@joeyorlando joeyorlando deleted the jorlando/remove-org-maintenance-mode branch July 12, 2023 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:no public docs Added to a PR that does not require public documentation updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants