-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat(alert rules): Create jira server alert rule action #58019
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
feat(alert rules): Create jira server alert rule action #58019
Conversation
Codecov Report
@@ Coverage Diff @@
## master #58019 +/- ##
==========================================
+ Coverage 78.74% 79.08% +0.34%
==========================================
Files 5140 5143 +3
Lines 223843 223891 +48
Branches 37696 37699 +3
==========================================
+ Hits 176254 177068 +814
+ Misses 41821 41154 -667
+ Partials 5768 5669 -99
|
27e9a61
to
8727fea
Compare
@@ -357,6 +361,65 @@ def test_with_jira_action_error(self): | |||
["EPIC-2", "The Comeback Kid"], | |||
] | |||
|
|||
@responses.activate | |||
def test_with_jira_server_action_error(self): |
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.
copied from above jira integration test
@@ -149,3 +150,140 @@ def test_fails_validation(self): | |||
}, | |||
) | |||
assert response.status_code == 400 | |||
|
|||
|
|||
class JiraServerTicketRulesTestCase(RuleTestCase, BaseAPITestCase): |
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 tests were copied from JiraTicketRulesTestCase
above
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.
Did you test this locally with our Jira Server instance?
You'll also want to add this to the feature description list - see how it's defined in Jira cloud - https://github.com/getsentry/sentry/blob/master/src/sentry/integrations/jira/integration.py#L73-L78 |
I'd also blocked the sprint field ever being set for this in Jira cloud (see the PR) since it quickly results in failure once the sprint ends. |
I think this was already done for Jira Server if you check here: https://github.com/getsentry/sentry/blob/master/src/sentry/integrations/jira_server/integration.py#L823-L825 |
with mock.patch( | ||
"sentry.integrations.jira.integration.JiraIntegration.get_client", self.get_client |
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 test is exactly the same except I removed this patch because the endpoint correctly fails before the mock is called
@@ -78,6 +78,12 @@ | |||
""", | |||
IntegrationFeatures.ISSUE_SYNC, | |||
), | |||
FeatureDescription( | |||
""" | |||
Automatically create Jira tickets based on Issue Alert conditions. |
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.
We don't say Jira Server for the other features, so I'm keeping parity by just using this Jira tickets
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.
looks good! very thorough run through in the video
Requires #58058 #58186
Summary
Create a new alert rule action for Jira Server that mirrors the existing Jira alert rule action.
Sending Test Notification
In the video below, I test creating all task types (epic, story, task, sub-task, bug) in Jira Server using the test notification
There is a visual bug here where the
sending test notifications
button disappears after a while, even though it's still going on. After all the actions have been run,Notifications sent!
pops up but there's a big gap in between where nothing shows on screen to indicate things are still running.Screen.Recording.2023-10-18.at.1.50.49.PM.mov
New Action on Create Alert Rule