-
Notifications
You must be signed in to change notification settings - Fork 148
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
bug 1335861: add notifications for most tables #361
Conversation
auslib/db.py
Outdated
"""Create a new AUSDatabase. Before this object is useful, dburi must be | ||
set, either through the constructor or setDburi()""" | ||
if dburi: | ||
self.setDburi(dburi, mysql_traditional_mode) | ||
self.log = logging.getLogger(self.__class__.__name__) | ||
if notify_tables: | ||
self.notify_tables = notify_tables |
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.
How would this work ? Seems a bit like you're passing references to tables/attributes that don't exist yet, but perhaps I've forgotten how we instantiate all this.
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.
This works because in practice, AUSDatabase is always constructed with dburi being passed, via https://github.com/mozilla/balrog/blob/4d6f673a850cbd2924eb55145f047fadfceabeea/auslib/global_state.py#L18.
However, it's quite clear that if someone were to construct an AUSDatabase without dburi, this would fail. I didn't realize this when I was writing it - I'll fix it up.
auslib/db.py
Outdated
self.notify_tables = [ | ||
self.rules, self.rules.scheduled_changes, self.rules.scheduled_changes.signoffs, | ||
self.permissions, self.permissions.user_roles, self.permissions.scheduled_changes, self.permissions.scheduled_changes.signoffs, | ||
self.permissionsRequiredSignoffs, self.productRequiredSignoffs.scheduled_changes, self.productRequiredSignoffs.scheduled_changes.signoffs, |
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 think you mean self.productRequiredSignoffs at the start of this line.
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.
Whoops, yup.
…le calls to AUSDatabase.
How's this, @nthomas-mozilla? |
Ship it! |
Per https://bugzilla.mozilla.org/show_bug.cgi?id=1335861#c0.