-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
ref(rules): Add changes to rule edit confirmation notification #66847
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #66847 +/- ##
==========================================
+ Coverage 84.29% 84.31% +0.01%
==========================================
Files 5306 5309 +3
Lines 237157 237411 +254
Branches 41016 41064 +48
==========================================
+ Hits 199915 200165 +250
- Misses 37023 37027 +4
Partials 219 219
|
87872e2
to
4ae40b8
Compare
src/sentry/integrations/slack/message_builder/notifications/rule_save_edit.py
Outdated
Show resolved
Hide resolved
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.
lgtm
old_value = prior_state.get(key) | ||
new_value = present_state.get(key) | ||
return f"Changed {word} from *{old_value}* to *{new_value}*" | ||
return None |
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.
small nit: can skip returning None
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.
mypy wouldn't let me 😭
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.
apparently by design: python/mypy#7511 (comment)
There's a flag --no-warn-no-return
to disable this but looks like we don't have it on
Follow up to #66285 to add details about what changed happened when a rule was edited to the notification. <img width="748" alt="Screenshot 2024-03-12 at 4 40 24 PM" src="https://github.com/getsentry/sentry/assets/29959063/e0d7c5ca-35e5-4a66-bc67-e53c8d27dcce"> Note that I've made a couple follow up tickets to address poor rendering of issue type enums and frequency: getsentry/team-core-product-foundations#158 and getsentry/team-core-product-foundations#157 --------- Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
if rule_data_before.get("environment_id") and not rule_data.get("environment_id"): | ||
environment = None | ||
try: | ||
environment = Environment.objects.get(id=rule_data.get("environment_id")) | ||
except Environment.DoesNotExist: | ||
pass |
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.
I'm pretty sure this is a typo -- the type checker is pointing this out as a bug when I enable model checking
this is always passing id=None
here -- should this be using rule_data_before["environment_id"]
instead?
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.
Fix here - #73665
Follow up to #66285 to add details about what changed happened when a rule was edited to the notification.
Note that I've made a couple follow up tickets to address poor rendering of issue type enums and frequency: https://github.com/getsentry/team-core-product-foundations/issues/158 and https://github.com/getsentry/team-core-product-foundations/issues/157