Skip to content
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

Merged
merged 4 commits into from
Aug 8, 2017

Conversation

bhearsum
Copy link
Contributor

@bhearsum bhearsum commented Aug 1, 2017

@bhearsum bhearsum self-assigned this Aug 1, 2017
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
Copy link
Contributor

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.

Copy link
Contributor Author

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,
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops, yup.

@bhearsum
Copy link
Contributor Author

bhearsum commented Aug 4, 2017

How's this, @nthomas-mozilla?

@nthomas-mozilla
Copy link
Contributor

Ship it!

@bhearsum bhearsum merged commit 21355e3 into mozilla-releng:master Aug 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants