Skip to content

Conversation

@Christinarlong
Copy link
Contributor

@Christinarlong Christinarlong commented Apr 14, 2025

need to add tests :oopsie

Context: When a user deletes a Jira issue that's created or somehow linked to a Sentry issue, we don't delete that link, so when a user updates the Sentry issue, then we'll try and update a ghost issue.

This behavior is happening because we don't actually listen to the issue-deleted webhook from Jira. We only listen to issue-updated, which is different 🫠 . This PR adds a new webhook endpoint and does the following

  1. Get the Jira issue key (e.g ECO-1)
  2. Look up the corresponding External Issue object
    • ExternalIssue represents a Jira issue that's connected to an Integration object
    • [❓] I'm not sure if Jira supports having 1 Sentry issue be connected to many Jira integrations/orgs. In the UI it looks like this isn't supported but wanna confirm.
  3. Look up the corresponding Group Link objects (there can be many)
    • GroupLink represents a 'link' between a Sentry issue and some external(3p) object, in this case a Jira issue
  4. Delete the GroupLink , I believe we can do this because the Jira issue is being deleted so there's nothing to link to
    • [❓] One concern is that the group_integration_details endpoint (where I yoinked a lot of logic from), specifies not the delete the GroupLink if there are many connected to the same ExternalIssue. I'm not 100% on what case this comment is referencing, e.g if there are many Sentry issues connected to 1 Jira issue? But I think we just create a new ExternalIssue for each link, so the relationship stays 1:1 (?)
  5. Delete the ExternalIssue, Same as above
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 14, 2025
@codecov
Copy link

codecov bot commented Apr 14, 2025

Codecov Report

❌ Patch coverage is 51.51515% with 16 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...sentry/integrations/jira/webhooks/issue_deleted.py 50.00% 16 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #89498      +/-   ##
==========================================
- Coverage   85.48%   85.47%   -0.01%     
==========================================
  Files       10158    10162       +4     
  Lines      573620   573694      +74     
  Branches    22565    22565              
==========================================
+ Hits       490343   490393      +50     
- Misses      82678    82702      +24     
  Partials      599      599              
@getsantry
Copy link
Contributor

getsantry bot commented Jun 6, 2025

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you add the label WIP, I will leave it alone unless WIP is removed ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry bot added Stale and removed Stale labels Jun 6, 2025
@getsantry getsantry bot added Stale and removed Stale labels Jun 29, 2025
@getsantry
Copy link
Contributor

getsantry bot commented Jul 22, 2025

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry bot added Stale and removed Stale labels Jul 22, 2025
@Christinarlong
Copy link
Contributor Author

dont close this pr please ;-;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components WIP

2 participants