-
-
Notifications
You must be signed in to change notification settings - Fork 723
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow slack-app and webhook to listen to schedule suspended eve…
…nts (#5821) This PR adds the schedule suspended event to the slack-app and webhook definitions. It also slightly tweaks the markdown formatting of change requests to add a definite article. This means the snapshot also needs to be updated.
- Loading branch information
1 parent
d770f62
commit 336eab9
Showing
5 changed files
with
39 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,16 @@ exports[`Should format specialised text for events when IPs changed 1`] = ` | |
} | ||
`; | ||
|
||
exports[`Should format specialised text for events when a scheduled change request is suspended 1`] = ` | ||
{ | ||
"text": "Change request *[#1](unleashUrl/projects/my-other-project/change-requests/1)* in the *production* environment in project *[my-other-project](unleashUrl/projects/my-other-project)* was suspended for the following reason: The user who scheduled this change request (user id: 6) has been deleted from this Unleash instance.", | ||
"url": "unleashUrl/projects/my-other-project/change-requests/1", | ||
} | ||
`; | ||
|
||
exports[`Should format specialised text for events when change request is scheduled 1`] = ` | ||
{ | ||
"text": "*[email protected]* scheduled change request *[#1](unleashUrl/projects/my-other-project/change-requests/1)* for feature toggle *[new-feature](unleashUrl/projects/my-other-project/features/new-feature)* in *production* environment in project *[my-other-project](unleashUrl/projects/my-other-project)* to be applied at in project *my-other-project*", | ||
"text": "*[email protected]* scheduled change request *[#1](unleashUrl/projects/my-other-project/change-requests/1)* for feature toggle *[new-feature](unleashUrl/projects/my-other-project/features/new-feature)* in the *production* environment in project *[my-other-project](unleashUrl/projects/my-other-project)* to be applied at in project *my-other-project*", | ||
"url": "unleashUrl/projects/my-other-project/change-requests/1", | ||
} | ||
`; | ||
|
@@ -163,14 +170,14 @@ exports[`Should format specialised text for events when rollout percentage chang | |
|
||
exports[`Should format specialised text for events when scheduled change request fails 1`] = ` | ||
{ | ||
"text": "*Failed* to apply the scheduled change request *[#1](unleashUrl/projects/my-other-project/change-requests/1)* for feature toggle *[new-feature](unleashUrl/projects/my-other-project/features/new-feature)* in *production* environment in project *[my-other-project](unleashUrl/projects/my-other-project)* by *[email protected]* in project *my-other-project*.", | ||
"text": "*Failed* to apply the scheduled change request *[#1](unleashUrl/projects/my-other-project/change-requests/1)* for feature toggle *[new-feature](unleashUrl/projects/my-other-project/features/new-feature)* in the *production* environment in project *[my-other-project](unleashUrl/projects/my-other-project)* by *[email protected]* in project *my-other-project*.", | ||
"url": "unleashUrl/projects/my-other-project/change-requests/1", | ||
} | ||
`; | ||
|
||
exports[`Should format specialised text for events when scheduled change request succeeds 1`] = ` | ||
{ | ||
"text": "*Successfully* applied the scheduled change request *[#1](unleashUrl/projects/my-other-project/change-requests/1)* for feature toggle *[new-feature](unleashUrl/projects/my-other-project/features/new-feature)* in *production* environment in project *[my-other-project](unleashUrl/projects/my-other-project)* by *[email protected]* in project *my-other-project*.", | ||
"text": "*Successfully* applied the scheduled change request *[#1](unleashUrl/projects/my-other-project/change-requests/1)* for feature toggle *[new-feature](unleashUrl/projects/my-other-project/features/new-feature)* in the *production* environment in project *[my-other-project](unleashUrl/projects/my-other-project)* by *[email protected]* in project *my-other-project*.", | ||
"url": "unleashUrl/projects/my-other-project/change-requests/1", | ||
} | ||
`; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ import { | |
CHANGE_REQUEST_SCHEDULED, | ||
CHANGE_REQUEST_SCHEDULED_APPLICATION_FAILURE, | ||
CHANGE_REQUEST_SCHEDULED_APPLICATION_SUCCESS, | ||
CHANGE_REQUEST_SCHEDULE_SUSPENDED, | ||
FEATURE_STRATEGY_ADD, | ||
FEATURE_STRATEGY_REMOVE, | ||
FEATURE_STRATEGY_UPDATE, | ||
|
@@ -552,6 +553,24 @@ const testCases: [string, IEvent][] = [ | |
environment: 'production', | ||
}, | ||
], | ||
[ | ||
'when a scheduled change request is suspended', | ||
{ | ||
id: 921, | ||
type: CHANGE_REQUEST_SCHEDULE_SUSPENDED, | ||
createdBy: '[email protected]', | ||
createdByUserId: SYSTEM_USER_ID, | ||
createdAt: new Date('2022-06-01T10:03:11.549Z'), | ||
data: { | ||
changeRequestId: 1, | ||
reason: 'The user who scheduled this change request (user id: 6) has been deleted from this Unleash instance.', | ||
}, | ||
preData: {}, | ||
tags: [], | ||
project: 'my-other-project', | ||
environment: 'production', | ||
}, | ||
], | ||
]; | ||
|
||
testCases.forEach(([description, event]) => | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters