-
Notifications
You must be signed in to change notification settings - Fork 36
ARR: Merge Post-Submission and Preprint Release #2908
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
Open
haroldrubio
wants to merge
35
commits into
master
Choose a base branch
from
fix/arr-preprint-in-post
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
30d1122
Remove preprint release
haroldrubio fae13eb
Remove preprint process
haroldrubio 7fe70c3
Change post submission process function
haroldrubio 4d4c2fd
Change tests
haroldrubio 07895a9
Merge branch 'master' into fix/arr-preprint-in-post
haroldrubio 6406213
Remove old test
haroldrubio 55e4f45
Merge branch 'master' into fix/arr-preprint-in-post
haroldrubio 4aec93d
Merge branch 'master' into fix/arr-preprint-in-post
melisabok 0ab123c
Parameterize post submission
haroldrubio 9f1a738
Call venue invitation builder
haroldrubio b13b237
Duplicate Venue logic into ARR
haroldrubio da99720
Update process function
haroldrubio d3bfd13
Update tests
haroldrubio 0572c67
Merge branch 'master' into fix/arr-preprint-in-post
haroldrubio 59cb630
Refactor source
haroldrubio 9c7ea9a
Merge branch 'master' into fix/arr-preprint-in-post
haroldrubio 13a0fae
Fix level of nesting
haroldrubio 5134dbf
Merge branch 'fix/arr-preprint-in-post' of https://github.com/openrev…
haroldrubio f05db47
Remove process function and fix explanation logic
haroldrubio 811d2ca
Merge branch 'master' into fix/arr-preprint-in-post
haroldrubio 9e541c8
Merge branch 'master' into fix/arr-preprint-in-post
haroldrubio 3d3fc38
Merge branch 'master' into fix/arr-preprint-in-post
haroldrubio a3456a8
Merge branch 'master' into fix/arr-preprint-in-post
haroldrubio 07723c3
Remove process function
haroldrubio 1c40b6c
Update invitation schema
haroldrubio 347724d
Move explanation of revisions assertions
haroldrubio 1059204
Add back assertions
haroldrubio e2005b8
Merge branch 'master' into fix/arr-preprint-in-post
haroldrubio f342066
Merge branch 'master' into fix/arr-preprint-in-post
haroldrubio ee81cfd
Only keep custom source
haroldrubio a635ad7
Merge branch 'master' into fix/arr-preprint-in-post
haroldrubio bbe439d
Merge branch 'master' into fix/arr-preprint-in-post
celestemartinez 19ef4e4
Merge branch 'master' into fix/arr-preprint-in-post
haroldrubio e4a6bf9
Merge branch 'master' into fix/arr-preprint-in-post
haroldrubio e54da3f
Merge branch 'master' into fix/arr-preprint-in-post
melisabok File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,165 @@ | ||
| def process(client, invitation): | ||
|
haroldrubio marked this conversation as resolved.
Outdated
|
||
| import datetime | ||
| import openreview | ||
| from openreview.stages.arr_content import hide_fields, hide_fields_from_public | ||
|
|
||
| domain = client.get_group(invitation.domain) | ||
| venue_id = domain.id | ||
| submission_venue_id = domain.content['submission_venue_id']['value'] | ||
| venue_name = domain.content['title']['value'] | ||
| meta_invitation_id = domain.content['meta_invitation_id']['value'] | ||
| program_chairs_id = domain.content['program_chairs_id']['value'] | ||
| submission_name = domain.content['submission_name']['value'] | ||
| authors_name = domain.content['authors_name']['value'] | ||
| reviewers_name = domain.content['reviewers_name']['value'] | ||
| reviewers_submitted_name = domain.content['reviewers_submitted_name']['value'] | ||
| area_chairs_name = domain.content['area_chairs_name']['value'] | ||
| senior_area_chairs_name = domain.content['senior_area_chairs_name']['value'] | ||
|
|
||
| now = openreview.tools.datetime_millis(datetime.datetime.now()) | ||
| cdate = invitation.cdate | ||
|
|
||
| if cdate and cdate > now: | ||
| # invitation is in the future, do not process | ||
| print('invitation is not yet active', cdate) | ||
| return | ||
|
|
||
| client_v1 = openreview.Client( | ||
| baseurl=openreview.tools.get_base_urls(client)[0], | ||
| token=client.token | ||
| ) | ||
|
|
||
| submissions = client.get_all_notes(content={'venueid': submission_venue_id}) | ||
|
|
||
| def is_preprint(note): | ||
| return note.content.get('preprint', {}).get('value') == 'yes' | ||
|
|
||
| preprints = [] | ||
| non_preprints = [] | ||
| for note in submissions: | ||
| if is_preprint(note): | ||
| preprints.append(note) | ||
| else: | ||
| non_preprints.append(note) | ||
|
|
||
| print(f'Processing {len(non_preprints)} non-preprint submissions') | ||
| print(f'Processing {len(preprints)} preprint submissions') | ||
|
|
||
| def post_submission_edit(submission): | ||
| updated_note = openreview.api.Note(id=submission.id) | ||
| client.post_note_edit( | ||
| invitation=invitation.id, | ||
| note=updated_note, | ||
| signatures=[venue_id] | ||
| ) | ||
|
|
||
| def get_paper_authors_group_id(number): | ||
| return f"{venue_id}/{submission_name}{number}/{authors_name}" | ||
|
|
||
| def get_committee_readers(number, include_authors=True): | ||
| readers = [ | ||
| program_chairs_id, | ||
| f"{venue_id}/{submission_name}{number}/{senior_area_chairs_name}", | ||
| f"{venue_id}/{submission_name}{number}/{area_chairs_name}", | ||
| f"{venue_id}/{submission_name}{number}/{reviewers_name}" | ||
| ] | ||
| if include_authors: | ||
| readers.append(get_paper_authors_group_id(number)) | ||
| return readers | ||
|
|
||
| def get_explanation_of_revisions_readers(submission): | ||
| """ | ||
| Always replace current-cycle Reviewers with Reviewers/Submitted for this field | ||
|
|
||
| If previous_URL exists and author doesn't want new reviewers: | ||
| include previous-cycle Reviewers/Submitted | ||
| """ | ||
| readers = [ | ||
| program_chairs_id, | ||
| f"{venue_id}/{submission_name}{submission.number}/{senior_area_chairs_name}", | ||
| f"{venue_id}/{submission_name}{submission.number}/{area_chairs_name}", | ||
| f"{venue_id}/{submission_name}{submission.number}/{reviewers_name}/{reviewers_submitted_name}", | ||
| get_paper_authors_group_id(submission.number) | ||
| ] | ||
|
|
||
| paper_link = submission.content.get('previous_URL', {}).get('value') | ||
| wants_new_reviewers = submission.content.get('reassignment_request_reviewers', {}).get('value', '').startswith('Yes') | ||
|
|
||
| if paper_link and not wants_new_reviewers: | ||
| paper_forum = paper_link.split('?id=')[-1] | ||
| arr_submission_v1 = openreview.tools.get_note(client_v1, paper_forum) | ||
| if arr_submission_v1: | ||
| v1_domain = arr_submission_v1.invitation.split('/-/')[0] | ||
| readers.append(f"{v1_domain}/Paper{arr_submission_v1.number}/{reviewers_name}/{reviewers_submitted_name}") | ||
| arr_submission_v2 = openreview.tools.get_note(client, paper_forum) | ||
| if arr_submission_v2: | ||
| v2_domain = arr_submission_v2.domain | ||
| readers.append(f"{v2_domain}/{submission_name}{arr_submission_v2.number}/{reviewers_name}/{reviewers_submitted_name}") | ||
|
|
||
| return readers | ||
|
|
||
| def release_preprint_submission(submission): | ||
| authors_group_id = get_paper_authors_group_id(submission.number) | ||
| committee_readers = get_committee_readers(submission.number, include_authors=True) | ||
|
|
||
| # Build content with field-level readers | ||
| content = {} | ||
|
|
||
| # Authors and authorids are always readable only by venue and authors | ||
| venue_authors_readers = [venue_id, authors_group_id] | ||
| content['authors'] = {'readers': venue_authors_readers} | ||
| content['authorids'] = {'readers': venue_authors_readers} | ||
|
|
||
| for field in hide_fields: | ||
| content[field] = {'readers': venue_authors_readers} | ||
|
|
||
| # hide_fields_from_public -> committee_readers (with authors) | ||
| for field in hide_fields_from_public: | ||
| if field == 'explanation_of_revisions_PDF': | ||
| content[field] = {'readers': get_explanation_of_revisions_readers(submission)} | ||
| else: | ||
| content[field] = {'readers': committee_readers} | ||
|
|
||
| # Set _bibtex and odate only if not already set | ||
| if submission.odate is None: | ||
| content['_bibtex'] = { | ||
| 'value': openreview.tools.generate_bibtex( | ||
| note=submission, | ||
| venue_fullname=venue_name, | ||
| year=str(datetime.datetime.now().year), | ||
| url_forum=submission.forum, | ||
| paper_status='under review', | ||
| anonymous=True | ||
| ) | ||
| } | ||
|
|
||
| # Build the note edit | ||
| updated_note = openreview.api.Note( | ||
| id=submission.id, | ||
| readers=['everyone'], | ||
| content=content | ||
| ) | ||
|
|
||
| # Set odate only if not already set | ||
| if submission.odate is None: | ||
| updated_note.odate = now | ||
|
|
||
| client.post_note_edit( | ||
| invitation=meta_invitation_id, | ||
| readers=[venue_id], | ||
| writers=[venue_id], | ||
| signatures=[venue_id], | ||
| note=updated_note | ||
| ) | ||
|
|
||
| openreview.tools.concurrent_requests( | ||
|
Member
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. This seems to be two different types of post_submission invitations so I would try doing that:
@celestemartinez this is something that we discussed yesterday and this is a good case to support it.
|
||
| post_submission_edit, | ||
| non_preprints, | ||
| desc='arr_post_submission_non_preprints' | ||
| ) | ||
|
|
||
| openreview.tools.concurrent_requests( | ||
| release_preprint_submission, | ||
| preprints, | ||
| desc='arr_post_submission_preprints' | ||
| ) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
what if you create the Post_Submission invitation here? or pass the process function path as a param?