Skip to content

Commit

Permalink
run comment stage if commenting is enabled (#1785)
Browse files Browse the repository at this point in the history
Co-authored-by: Melisa Bok <[email protected]>
  • Loading branch information
celestemartinez and melisabok authored Jul 25, 2023
1 parent 0c3809d commit 1871388
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 13 deletions.
3 changes: 2 additions & 1 deletion openreview/conference/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,8 @@ def get_ethics_review_stage(request_forum):
release_to_reviewers = release_to_reviewers,
additional_fields = review_form_additional_options,
remove_fields = review_form_remove_options,
submission_numbers = flagged_submissions
submission_numbers = flagged_submissions,
enable_comments = (request_forum.content.get('enable_comments_for_ethics_reviewers', '').startswith('Yes'))
)

def get_meta_review_stage(request_forum):
Expand Down
4 changes: 3 additions & 1 deletion openreview/stages/venue_stages.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,8 @@ def __init__(self,
release_to_reviewers = Readers.ETHICS_REVIEWER_SIGNATURE,
additional_fields = {},
remove_fields = [],
submission_numbers = []
submission_numbers = [],
enable_comments = False
):

self.start_date = start_date
Expand All @@ -662,6 +663,7 @@ def __init__(self,
self.additional_fields = additional_fields
self.remove_fields = remove_fields
self.submission_numbers = submission_numbers
self.enable_comments = enable_comments

def get_readers(self, conference, number, ethics_review_signature=None):

Expand Down
18 changes: 10 additions & 8 deletions openreview/venue/invitation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ def set_official_comment_invitation(self):
if comment_expdate:
invitation.edit['invitation']['expdate'] = comment_expdate

if self.venue.ethics_review_stage:
if self.venue.ethics_review_stage and self.venue.ethics_review_stage.enable_comments:
invitation.edit['content']['noteReaders'] = {
'value': {
'param': {
Expand All @@ -1048,7 +1048,7 @@ def set_official_comment_invitation(self):
invitation.content['comment_readers'] = {
'value': comment_stage.get_readers(self.venue, '{number}')
}
invitation.content['readers_delection'] = {
invitation.content['readers_selection'] = {
'value': comment_stage.reader_selection
}
comment_readers = ['${5/content/noteReaders/value}']
Expand Down Expand Up @@ -2890,12 +2890,6 @@ def set_ethics_stage_invitation(self):
content = {
'review_readers': {
'value': self.venue.review_stage.get_readers(self.venue, '{number}')
},
'comment_readers': {
'value': self.venue.comment_stage.get_readers(self.venue, '{number}')
},
'readers_selection': {
'value': self.venue.comment_stage.reader_selection
}
},
edit = {
Expand Down Expand Up @@ -2948,5 +2942,13 @@ def set_ethics_stage_invitation(self):
}
}

if ethics_review_stage.enable_comments:
ethics_stage_invitation.content['comment_readers'] = {
'value': self.venue.comment_stage.get_readers(self.venue, '{number}')
}
ethics_stage_invitation.content['readers_selection'] = {
'value': self.venue.comment_stage.reader_selection
}

self.save_invitation(ethics_stage_invitation, replacement=False)
return ethics_stage_invitation
4 changes: 2 additions & 2 deletions openreview/venue/process/ethics_flag_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ def process(client, edit, invitation):
)

# edit comment invitation
invitation = openreview.tools.get_invitation(client, f'{venue_id}/{submission_name}{submission.number}/-/Official_Comment')
if invitation:
comment_invitation = openreview.tools.get_invitation(client, f'{venue_id}/{submission_name}{submission.number}/-/Official_Comment')
if comment_invitation and 'comment_readers' in invitation.content:
comment_readers = invitation.content['comment_readers']['value']
final_readers = []
final_readers.extend(comment_readers)
Expand Down
2 changes: 2 additions & 0 deletions openreview/venue/venue.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,8 @@ def create_ethics_review_stage(self):
self.invitation_builder.set_ethics_paper_groups_invitation()
self.invitation_builder.set_review_invitation()
self.invitation_builder.set_ethics_review_invitation()
if self.ethics_review_stage.enable_comments:
self.invitation_builder.set_official_comment_invitation()

# setup paper matching
group = tools.get_group(self.client, id=self.get_ethics_reviewers_id())
Expand Down
10 changes: 10 additions & 0 deletions openreview/venue_request/venue_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,16 @@ def setup_ethics_review_stage(self):
"order": 9,
"value-checkbox": "We confirm we want to release the submissions and reviews to the ethics reviewers",
"required": True
},
'enable_comments_for_ethics_reviewers': {
'description': 'Should ethics reviewers be able to post comments? Note you can control the comment stage deadline as well who else can post comments by using the Comment Stage button.',
'value-radio': [
'Yes, enable commenting for ethics reviewers.',
'No, do not enable commenting for ethics reviewers.'
],
'required': False,
'default': 'No, do not enable commenting for ethics reviewers.',
'order': 10
}
}

Expand Down
9 changes: 8 additions & 1 deletion tests/test_icml_conference.py
Original file line number Diff line number Diff line change
Expand Up @@ -3311,7 +3311,8 @@ def test_ethics_review_stage(self, openreview_client, helpers, selenium, request
}
}
},
'release_submissions_to_ethics_reviewers': 'We confirm we want to release the submissions and reviews to the ethics reviewers'
'release_submissions_to_ethics_reviewers': 'We confirm we want to release the submissions and reviews to the ethics reviewers',
'enable_comments_for_ethics_reviewers': 'Yes, enable commenting for ethics reviewers.'
},
forum=request_form.forum,
referent=request_form.forum,
Expand Down Expand Up @@ -3418,6 +3419,12 @@ def test_ethics_review_stage(self, openreview_client, helpers, selenium, request
assert invitation
assert 'ICML.cc/2023/Conference/Submission52/Ethics_Reviewers' in invitation.invitees

# comment invitations are created for all papers, with only PCs and ethics reviewers as invitees
invitations = openreview_client.get_all_invitations(invitation='ICML.cc/2023/Conference/-/Official_Comment')
assert len(invitations) == 100
invitation = openreview_client.get_invitation('ICML.cc/2023/Conference/Submission1/-/Official_Comment')
assert invitation.invitees == ['ICML.cc/2023/Conference', 'openreview.net/Support', 'ICML.cc/2023/Conference/Submission1/Ethics_Reviewers']

def test_comment_stage(self, openreview_client, helpers):

pc_client=openreview.Client(username='[email protected]', password=helpers.strong_password)
Expand Down

0 comments on commit 1871388

Please sign in to comment.