-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Fix bug in notifications #5678
Fix bug in notifications #5678
Conversation
If an exception is raised before setting the self.build and self.version objects, we ended up with those having the value of `{}` (empty dict). In send_notification we expect to have these objects initialized. We should refactor this to only have one point where to catch exceptions and send the notification from there. Related to readthedocs#5672
Here is where these objects don't get initialized if the api call fails |
No changes are needed for the coporate site |
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!
I think we need to adapt one of the cases to not raise an exception when there is no id
for the build.
So, current flow granitize that if we ended up in the I'm keeping the if statement just in case we mutate the object in another part of the code (not likely or I hope so p:). If the object ended up without an id or None we will see it in sentry. Current implementation has the same problem anyway. |
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.
👍
except vcs_support_utils.LockTimeout as e: | ||
self.task.retry(exc=e, throw=False) | ||
raise VersionLockedError | ||
except SoftTimeLimitExceeded: | ||
raise BuildTimeoutError | ||
|
||
# Finalize build and update web servers | ||
if build_id: | ||
if self.build.get('id'): |
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 had a slightly different fix for this in #5549.
If an exception is raised before setting the self.build and self.version
objects, we ended up with those having the value of
{}
(empty dict).In send_notification we expect to have these objects initialized.
We should refactor this to only have one point where to catch exceptions
and send the notification from there. Related to #5672