-
Notifications
You must be signed in to change notification settings - Fork 309
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
Conversation
fe39214
to
eb1d549
Compare
# 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): |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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); | ||
} |
There was a problem hiding this comment.
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
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); |
There was a problem hiding this comment.
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
What this PR does
Which issue(s) this PR fixes
Checklist
pr:no public docs
PR label added if not required)CHANGELOG.md
updated (orpr:no changelog
PR label added if not required)