-
Notifications
You must be signed in to change notification settings - Fork 310
Conversation
cb5d10e
to
b789720
Compare
I'm pretty close on review url adaptations. Will pick up |
f70a898
to
17f256e
Compare
Okay! Leaving off with this one, on to the next! |
f86148c
to
a10ca2e
Compare
gratipay/project_review_repo.py
Outdated
"""Given team objects, POST to GitHub, and return the URL of the new issue. | ||
""" | ||
if not teams: | ||
return |
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.
Maybe log and/or raise an Exception, unless this is expected.
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.
Done in bcb5b11.
tests/py/test_teams.py
Outdated
package = self.make_package(name='enterprise') | ||
with self.db.get_cursor() as c: | ||
team = package.create_linked_team(c, alice) | ||
pytest.raises(AssertionError, team.update, field='foo') |
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.
Where is this testing homepage?
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.
Oops! Fixed in ff933e9. 😊
ca01581
to
da0c3da
Compare
Half-way through rebasing, will pick up next time ... |
gratipay/models/participant/email.py
Outdated
package_ids.append(package.id) | ||
team = package.get_or_create_linked_team(cursor, self) |
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.
@dowski Related to #4397 (comment), it looks like this is where it becomes useful public API to return a team object from get_or_create_linked_team
. You okay to bring that back here, to avoid an awkward package._load_team(cursor)
?
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.
Yep.
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.
Done in 80d2655.
Rebased, was a10ca2e. |
a10ca2e
to
b21bda0
Compare
be18500
to
ff933e9
Compare
Actually, moved that to #4422 to keep this PR manageable (we target 400 max net lines changed per PR). |
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.
One minor thing - nice clean code!
review_url = self.app.project_review_repo.create_issue(*teams) | ||
|
||
cursor.run('DELETE FROM claims WHERE nonce=%s', (nonce,)) | ||
cursor.run('UPDATE teams SET review_url=%s WHERE id=ANY(%s)', (review_url, team_ids,)) |
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.
Is this stuff happening in a transaction? Maybe there's a test that verifies that or something - I'll look as I scroll down.
I didn't see one. Maybe you know? I can't really tell.
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.
If you're seeing cursor
instead of self.db
then yes, the expectation is that this is happening in a transaction. The transaction begins when the cursor is created, which happens in a context manager invocation. It will be rolled back if there's an exception, or committed when the context manager exits normally. Docs.
In terms of a test, I believe we're covered by the one added in eaa8699 under #4397, no?
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.
Thanks!
Part of #4305, follows on #4398.
Todo
homepage
to URL on npmjs.comproduct_or_service
to npm descriptiondistributingdidn't check; let's make an 🐴 out of you and me