Skip to content

Conversation

@scttcper
Copy link
Member

@scttcper scttcper commented Dec 12, 2024

On integrations that sync status like jira, it can override the user's in-app resolution.

Problem Workflow:

  • User marks an issue as resolved in specific release
  • Group activity is recorded saying user resolved in release and matching Group Resolution created
  • We sync status to jira resolving the linked issue
  • Jira webhooks us back attempting to sync status (resolve in next release)
  • We update the Group Resolution to resolve in next release but we don't create an activity. When the issue regresses it is confusing since the GroupResolution and Group Activities don't make sense

This change would ignore the jira webhook if the group is already resolved and was resolved in the last 3 minutes.

fixes #74448
more internal notion docs

will follow up with a PR to test that GroupResolution and Group Activity always make sense

On integrations that sync status like jira, it can override the user's in app resolution.

Workflow:
- User marks an issue as resolved in release A
- Group activity is recorded saying user resolved in release
- We sync status to jira resolving the linked issue
- Jira webhooks us back attempting to sync status (resolve in next release)
- We update the group resolution to resolve in next release but we don't create an activity. When the issue regresses it is confusing since the GroupResolution and Group Activities don't make sense.

This change would ignore the jira webhook if the group is already resolved and was resolved in the last 3 minutes.

fixes #74448
@scttcper scttcper requested review from a team and GabeVillalobos December 12, 2024 00:47
@scttcper scttcper requested review from a team as code owners December 12, 2024 00:48
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Dec 12, 2024
@codecov
Copy link

codecov bot commented Dec 12, 2024

Codecov Report

Attention: Patch coverage is 88.23529% with 2 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...c/sentry/integrations/tasks/sync_status_inbound.py 88.23% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #82001   +/-   ##
=======================================
  Coverage   80.35%   80.35%           
=======================================
  Files        7279     7279           
  Lines      321322   321378   +56     
  Branches    20957    20957           
=======================================
+ Hits       258207   258254   +47     
- Misses      62701    62710    +9     
  Partials      414      414           

# which would override the in-app resolution
for group in affected_groups:
if group.status == GroupStatus.RESOLVED and group_was_recently_resolved(group):
affected_groups.remove(group)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it safe to remove items from a list you're iterating through? I always thought of this as bad practice but I'm not sure how Python handles this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tested this, and removing items in place can result in skipping over list items unintentionally. Verified this behavior with the example from this SO post: https://stackoverflow.com/questions/4960968/how-to-safely-remove-elements-from-a-list-in-python

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops i remember seeing that before. python really has that nice .remove function that is so tempting to use

Comment on lines 233 to 238
if group.status == GroupStatus.RESOLVED and group_was_recently_resolved(group):
recently_resolved_groups.append(group)

affected_groups = [
group for group in affected_groups if group not in recently_resolved_groups
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super tiny nit, totally optional: this is a bit cleaner if you invert the check and append to a different list when a group has not been resolved recently. I'm not sure how many possible groups a single status inbound task can handle, but I imagine it won't make much of a practical difference.

@scttcper scttcper merged commit 91aa349 into master Dec 12, 2024
48 of 49 checks passed
@scttcper scttcper deleted the scttcper/ignore-jira-reresolve branch December 12, 2024 20:50
scttcper added a commit that referenced this pull request Dec 13, 2024
related to #82001

logs when the group activities don't make sense
@github-actions github-actions bot locked and limited conversation to collaborators Dec 28, 2024
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.

Regression version comparison incorrectly identified issue as regressed, when version was older than resolved-in version

4 participants