Skip to content

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

Merged
merged 19 commits into from
Oct 18, 2023

Conversation

schew2381
Copy link
Contributor

@schew2381 schew2381 commented Oct 12, 2023

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

Screenshot 2023-10-16 at 12 15 53 PM

@schew2381 schew2381 self-assigned this Oct 12, 2023
@schew2381 schew2381 changed the title feat(alerts): Create Jira Server Alert Rule Action feat(alert-rules): Create Jira Server Alert Rule Action Oct 12, 2023
@github-actions github-actions bot added Scope: Frontend Automatically applied to PRs that change frontend components Scope: Backend Automatically applied to PRs that change backend components labels Oct 12, 2023
@schew2381 schew2381 changed the title feat(alert-rules): Create Jira Server Alert Rule Action feat(alert-rules): Create jira server alert rule action Oct 12, 2023
@schew2381 schew2381 changed the title feat(alert-rules): Create jira server alert rule action feat(alert rules): Create jira server alert rule action Oct 12, 2023
@codecov
Copy link

codecov bot commented Oct 12, 2023

Codecov Report

Merging #58019 (6a7f081) into master (05f116b) will increase coverage by 0.34%.
Report is 1 commits behind head on master.
The diff coverage is 92.15%.

@@            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     
Files Coverage Δ
src/sentry/api/endpoints/project_rule_details.py 85.82% <100.00%> (+0.21%) ⬆️
src/sentry/api/endpoints/project_rules.py 95.45% <ø> (ø)
src/sentry/integrations/jira_server/__init__.py 100.00% <100.00%> (ø)
...entry/integrations/jira_server/actions/__init__.py 100.00% <100.00%> (ø)
src/sentry/integrations/jira_server/integration.py 69.90% <ø> (ø)
.../sentry/integrations/vsts/actions/create_ticket.py 100.00% <ø> (ø)
...y/rules/actions/integrations/create_ticket/base.py 94.44% <100.00%> (+0.21%) ⬆️
src/sentry/rules/base.py 90.19% <100.00%> (ø)
.../integrations/jira_server/actions/create_ticket.py 90.90% <90.90%> (ø)
...rc/sentry/integrations/jira_server/actions/form.py 86.66% <86.66%> (ø)

... and 102 files with indirect coverage changes

@@ -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):
Copy link
Contributor Author

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):
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 tests were copied from JiraTicketRulesTestCase above

@getsentry getsentry deleted a comment from github-actions bot Oct 16, 2023
@schew2381 schew2381 added Scope: Backend Automatically applied to PRs that change backend components and removed Scope: Backend Automatically applied to PRs that change backend components Scope: Frontend Automatically applied to PRs that change frontend components labels Oct 16, 2023
Copy link
Member

@ceorourke ceorourke left a 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?

@ceorourke
Copy link
Member

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

@ceorourke
Copy link
Member

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.

@schew2381
Copy link
Contributor Author

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

Comment on lines -121 to -122
with mock.patch(
"sentry.integrations.jira.integration.JiraIntegration.get_client", self.get_client
Copy link
Contributor Author

@schew2381 schew2381 Oct 17, 2023

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.
Copy link
Contributor Author

@schew2381 schew2381 Oct 17, 2023

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

Copy link
Member

@ceorourke ceorourke left a 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

@schew2381 schew2381 merged commit b254c48 into master Oct 18, 2023
@schew2381 schew2381 deleted the seiji/feat/create-jira-server-ticket-action branch October 18, 2023 21:12
@github-actions github-actions bot locked and limited conversation to collaborators Nov 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants