-
Notifications
You must be signed in to change notification settings - Fork 36
ARR: Remove all but latest 2 cycles #3025
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
7
commits into
master
Choose a base branch
from
fix/arr-limit-cycles
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 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
967b02d
Remove all but latest 2 cycles
haroldrubio 6518ab5
Merge branch 'master' into fix/arr-limit-cycles
haroldrubio 108ddab
Add guard on None return
haroldrubio fd13082
Merge branch 'master' into fix/arr-limit-cycles
haroldrubio 14415fb
Merge branch 'master' into fix/arr-limit-cycles
haroldrubio eeba18e
Add explicit filter
haroldrubio dcf422c
Merge branch 'fix/arr-limit-cycles' of https://github.com/openreview/…
haroldrubio 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -735,8 +735,31 @@ def get_submissions(self, venueid=None, accepted=False, sort=None, details=None) | |
| def expire_invitation(self, invitation_id): | ||
| return self.venue.expire_invitation(invitation_id) | ||
|
|
||
| def prune_active_arr_venues(self, keep_count=2): | ||
| active_venues = self.client.get_group('active_venues') | ||
| arr_venues = [] | ||
|
|
||
| for venue_id in active_venues.members or []: | ||
| if not venue_id.startswith('aclweb.org/ACL/ARR'): | ||
| continue | ||
|
|
||
| venue_group = tools.get_group(self.client, venue_id) | ||
| if venue_group is None: | ||
| continue | ||
| venue_cdate = venue_group.cdate | ||
| arr_venues.append((venue_cdate, venue_id == self.venue_id, venue_id)) | ||
|
|
||
| if len(arr_venues) <= keep_count: | ||
| return | ||
|
|
||
| arr_venues.sort(reverse=True) | ||
| stale_venue_ids = [venue_id for _, _, venue_id in arr_venues[keep_count:]] | ||
|
haroldrubio marked this conversation as resolved.
Outdated
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. @celestemartinez here we should filter out the current cycle.
Member
Author
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. I can make the change to do it more explicitly |
||
| if stale_venue_ids: | ||
| self.client.remove_members_from_group(active_venues.id, stale_venue_ids) | ||
|
|
||
| def setup(self, program_chair_ids=[], publication_chairs_ids=[]): | ||
| setup_value = self.venue.setup(program_chair_ids, publication_chairs_ids) | ||
| self.prune_active_arr_venues() | ||
|
|
||
| setup_arr_invitations(self.invitation_builder) | ||
|
|
||
|
|
||
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
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 is the purpose of saving
venue_id == self.venue_id?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.
to know if that venue is the current cycle?
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.
yes, I thought so, but I guess I don't see it being used anywhere. Maybe I am missing something