-
Notifications
You must be signed in to change notification settings - Fork 172
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
Enforce checking results before submission #3127
Conversation
It turns out I need it for thewca#3127
a5ea8e1
to
288436b
Compare
f262537
to
925828e
Compare
I believe I've taken care of all the WRT feedback. |
5d58400
to
c4ad699
Compare
4f59bfc
to
2928615
Compare
2928615
to
1cffabe
Compare
Ping @thewca/software-team, it would be awesome if I could get (part of) a review on this! |
1cffabe
to
18b1f7a
Compare
ad7e069
to
43a764f
Compare
Hey @thewca/software-team, anyone willing to review this? |
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.
First part of the review, gonna continue later.
43a764f
to
941856e
Compare
As per WRT feedback: - check for missing space before '(' in person's name. - check for mismatching country (error), dob (warning), gender (warning) - adjust the suspicious DNF detection for cumulative time limits rounds
Make the CompetitionResultsValidator work both on InboxResult+InboxPerson, and on Result+Person.
911d09c
to
9085a5c
Compare
9085a5c
to
0264dda
Compare
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.
This is really awesome work, @viroulep!
Sorry for the massively delayed (and superficial) review, but I definitely think this is ready to go live. Super excited to hear how it goes.
WcaOnRails/app/views/results_submission/_results_submission_panel.html.erb
Outdated
Show resolved
Hide resolved
b749ff4
to
6d149eb
Compare
6d149eb
to
0da8c7a
Compare
Fixes #2984, fixes #977, fixes #3222, fixes #69, fixes #80, fixes #3822.
TODOs:
check scrambles validity: Investigate possible occurrence of invalid scramble moves tnoodle#366see Check scramble validity when posting results. #3436This PR enables Delegates/WRT to upload a valid results JSON directly to
InboxResult
,InboxPerson
, andScramble
.When uploaded, the
CompetitionResultsValidator
inspect the data present in these tables, and check them according to the declared events, rounds, and formats for the given competition.It reports warnings and errors found to the user, and enables the Delegate to submit the results to the WRT if no error is found.
It also gives the WRT a preview of the results when the rounds match the expected rounds for the competition.
This is actually a first step towards #297, as I introduced a per-competition navigation entry listing the various actions possible (right now only "upload and check results").
It is currently live on staging, so definitely feel free to play around it by deleting some existing competition results (and clearing both
results_posted_at
andresults_submitted_at
for the competition!), then uploading the corresponding results JSON (remember to set the DOB in the JSON to1954-12-4
, as all the data there are public!).I've already done this for French nats this year, it's error-free but has some warnings you can check there.
Playing around in the manage events page should make it easy to raise error on this page, for example by changing cutoff and time limits.
See below for a detailed list of the checks done on data present in inboxes.
What is checked and where?
Unless stated otherwise, any failed check results in an error.
I think all these checks are more than what existed in the "check results" script, and it's kind of a "all-in-one" script for the competition.
Quite a number of checks are done before the results even land in the inboxes:
JSON format
This is done before anything lands in the inboxes, through a JSON schema here.
Importing the data to inboxes is wrapped in a transaction where:
If any validation fails during this, nothing is imported and existing data are kept.
This allows the Delegates/WRT to upload multiple versions of the results (eg: to fix them) without having duplicate data for the competition.
Individual
InboxPerson
checksChecks:
Individual
InboxResult
checksResult
andInboxResult
share the same checks through theResultable
concern:Individual
Scramble
checksChecks:
After all these checks, we're guaranteed that the data present in the inboxes make sense, and we can start checking them according to what has been declared for the competition:
InboxPersons
Checks:
InboxResults
Scrambles
Checks:
Rounds