Skip to content
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

Fix: Commitments: improve regex and preprocess #2138

Merged
merged 16 commits into from
Jun 6, 2024

Conversation

celestemartinez
Copy link
Member

Fixes #2136

I tried multiple regexes to make sure authors don't add &noteId=xxx after the forum id, but none seemed to work. Instead, I take care of this in the preprocess.

@@ -119,7 +119,7 @@ def test_create_conference(self, client, openreview_client, helpers):
'value': {
'param': {
'type': 'string',
'regex': '(http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\\(\\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+)',
'regex': 'https:\/\/openreview\.net\/forum\?id=.*',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add a test trying to post a note using the urls:

https://openreview.net/pdf?id=1234
https://openreview.net/forum?id=1234&referrer=[Author Console](/group?id=ICML.cc/2024/Conference/Authors)
https://openreview.net/forum?id=1234&replyto=4567

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@celestemartinez could you add these tests cases?

@melisabok
Copy link
Member

@celestemartinez what is the status of this PR?

@melisabok
Copy link
Member

@celestemartinez could you also fix this issue that is related to this one?

#2104

@celestemartinez
Copy link
Member Author

@melisabok This should be ready for review. I added another check if submission.id != submission.forum

@melisabok
Copy link
Member

Thanks Celeste, can you add the same validation to the ARR venues? or it is the same code?

@melisabok
Copy link
Member

@celestemartinez please try to update this PR so we can merge it soon, thanks.

@celestemartinez
Copy link
Member Author

Thanks Celeste, can you add the same validation to the ARR venues? or it is the same code?

What do you mean enable it for ARR venues?

@melisabok
Copy link
Member

What do you mean enable it for ARR venues?

The ARR cycles have a field called "previous_url" where the validation is the same for ARR commitment venues. There is an open issue here: #2104

Could you make the same fix you are doing here for the ARR commitment venues for ARR class too?

Also please add these test cases: #2138 (comment)

@celestemartinez
Copy link
Member Author

@melisabok @haroldrubio sorry! I didn't realize this was also an ARR-specific issue.

I have made the fix for ARR and added the tests. Let me know if I missed something!

@melisabok
Copy link
Member

Thanks for the changes Celeste, there is one more case that I would like to test:

https://openreview.net/forum?id=1234&referrer=[Author%20Console](/group?id=aclweb.org/ACL/ARR/2023/June

when 1234 is a valid ARR note, I think in this case the validation will pass but it will be very difficult to parse this value when migrating data so I would like the users to enter the url like https://openreview.net/forum?id=1234 with no other parameters. Is it possible to describe this in the regex? I think instead of using .* we can see any character with the exception of the &, could you try that?

@celestemartinez
Copy link
Member Author

Thanks for the changes Celeste, there is one more case that I would like to test:

https://openreview.net/forum?id=1234&referrer=[Author%20Console](/group?id=aclweb.org/ACL/ARR/2023/June

when 1234 is a valid ARR note, I think in this case the validation will pass but it will be very difficult to parse this value when migrating data so I would like the users to enter the url like https://openreview.net/forum?id=1234 with no other parameters. Is it possible to describe this in the regex? I think instead of using .* we can see any character with the exception of the &, could you try that?

If they enter this URL, the preprocess should fail with Provided paper link does not correspond to a submission in OpenReview (this is in the tests, doesn't matter if the note is valid or not because we take everything after the ?id= as the note id. )

I had previously tried having a more specific regex but I couldn't get it to work. I can try again.

@melisabok
Copy link
Member

ohhh I see, because you are splitting by paper_forum = paper_link.split('?id=')[-1] so the last element contains the forum id plus all the parameters and the note is not found.

Got it, I wonder if we should say in the message the url must not have extra parameters

@celestemartinez
Copy link
Member Author

I added another check, if the paper link contains '&' then we show a more descriptive error.


if arr_submission_v1 and 'aclweb.org/ACL/ARR' in arr_submission_v1.invitation and not arr_submission_v1.invitation.endswith('Blind_Submission'):
raise openreview.OpenReviewException('Provided paper link does not point to a blind submission')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think the authors will know what a blind submission is, do you think we should add instructions on how to get the right link?

But it might be too much for an error message

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@melisabok melisabok merged commit aaa6609 into master Jun 6, 2024
1 check passed
@melisabok melisabok deleted the fix/paper-link-validation branch June 6, 2024 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ARR commitment: fix paper_link validation
3 participants