-
Notifications
You must be signed in to change notification settings - Fork 23
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
Feature: add option to delay new assignments after review has been submitted #2464
base: master
Are you sure you want to change the base?
Changes from 4 commits
88720f8
871b183
0a080b7
546243b
a14f3f3
18b36a0
520ccca
41afdf0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3667,8 +3667,9 @@ def set_review_invitation(self): | |
invitation_content = { | ||
'process_script': { | ||
'value': self.get_process_content('process/review_process.py') | ||
} | ||
} | ||
} | ||
|
||
edit_content = { | ||
'noteId': { | ||
'value': { | ||
|
@@ -3812,7 +3813,21 @@ def set_review_invitation(self): | |
|
||
if self.journal.get_review_additional_fields(): | ||
for key, value in self.journal.get_review_additional_fields().items(): | ||
invitation['edit']['note']['content'][key] = value if value else { "delete": True } | ||
invitation['edit']['note']['content'][key] = value if value else { "delete": True } | ||
|
||
if self.journal.get_assignment_delay_after_submitted_review() > 0: | ||
weeks = datetime.timedelta(weeks=self.journal.get_assignment_delay_after_submitted_review()) | ||
milliseconds = int(weeks.total_seconds() * 1000) | ||
invitation['postprocesses'] = [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. when a postprocesses run? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The postprocess will run after a reply is posted to the invitation, so kind of like the process function. However, we can add a delay, so the postprocess will run after the specified delay (in ms). More info here: https://github.com/openreview/openreview-api/pull/630 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we always add this post process and if the delay is 0 then we update the pending review edge right away? then we need to remove the code that updates the edge in the review process |
||
{ | ||
'script': self.get_super_process_content('post_process_script'), | ||
'delay': milliseconds | ||
} | ||
] | ||
|
||
invitation_content['post_process_script'] = { | ||
'value': self.get_process_content('process/review_post_process.py') | ||
} | ||
|
||
self.save_super_invitation(self.journal.get_review_id(), invitation_content, edit_content, invitation) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
def process(client, edit, invitation): | ||
|
||
journal = openreview.journal.Journal() | ||
|
||
review_note=client.get_note(edit.note.id) | ||
print('Review id:', review_note.id) | ||
|
||
## Decrease pending reviews counter | ||
signature_group = client.get_group(id=review_note.signatures[0]) | ||
reviewer_profile = openreview.tools.get_profile(client, signature_group.members[0]) | ||
print('reviewer profile:', reviewer_profile.id) | ||
edges = client.get_edges(invitation=journal.get_reviewer_pending_review_id(), tail=(reviewer_profile.id if reviewer_profile else signature_group.members[0])) | ||
|
||
if edges and edges[0].weight > 0: | ||
pending_review_edge = edges[0] | ||
if not review_note.ddate and journal.get_assignment_delay_after_submitted_review() > 0: | ||
print('Decreasing pending review count!') | ||
pending_review_edge.weight -= 1 | ||
client.post_edge(pending_review_edge) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -313,6 +313,10 @@ def test_ae_assignment(self, journal, openreview_client, test_client, helpers): | |
## Post a review edit | ||
reviewer_one_client = OpenReviewClient(username='[email protected]', password=helpers.strong_password) | ||
reviewer_one_anon_groups=reviewer_one_client.get_groups(prefix=f'{venue_id}/Paper1/Reviewer_.*', signatory='~MELBARev_One1') | ||
|
||
edges = reviewer_one_client.get_grouped_edges(invitation=f'{venue_id}/Reviewers/-/Pending_Reviews', groupby='weight') | ||
assert len(edges) == 1 | ||
assert edges[0]['values'][0]['weight'] == 1 | ||
|
||
review_note = reviewer_one_client.post_note_edit(invitation=f'{venue_id}/Paper1/-/Review', | ||
signatures=[reviewer_one_anon_groups[0].id], | ||
|
@@ -331,6 +335,13 @@ def test_ae_assignment(self, journal, openreview_client, test_client, helpers): | |
|
||
helpers.await_queue_edit(openreview_client, edit_id=review_note['id']) | ||
|
||
edges = reviewer_one_client.get_grouped_edges(invitation=f'{venue_id}/Reviewers/-/Pending_Reviews', groupby='weight') | ||
assert len(edges) == 1 | ||
assert edges[0]['values'][0]['weight'] == 0 | ||
|
||
logs = openreview_client.get_process_logs(invitation=f'{venue_id}/Paper1/-/Review', status='ok') | ||
assert logs and len(logs) == 1 | ||
|
||
reviewer_two_client = OpenReviewClient(username='[email protected]', password=helpers.strong_password) | ||
reviewer_two_anon_groups=reviewer_two_client.get_groups(prefix=f'{venue_id}/Paper1/Reviewer_.*', signatory='~MELBARev_Two1') | ||
|
||
|
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.
we need to wait until this is merged before merging this