-
Notifications
You must be signed in to change notification settings - Fork 1
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
136 persist winners for irv contests #101
Conversation
… of failure to generate assertions.
… for user-facing reporting.
…ry failure record.
…raceful failure if the database state is not what we expect.
@@ -99,12 +99,13 @@ public ResponseEntity<GenerateAssertionsResponse> serve(@RequestBody GenerateAss | |||
logger.debug(String.format("%s Calling raire-java with assertion generation request.",prefix)); | |||
RaireResultOrError solution = generateAssertionsService.generateAssertions(request); | |||
|
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.
If the persisting is done on line 102, then I think we need to change the comment on 105 as we have already saved them to the database.
@Column(name = "contest_name", unique = true, updatable = false, nullable = false) | ||
private String contestName = ""; | ||
|
||
/** |
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.
Do we mean to make the following attributes public given there are methods for updating them?
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.
They have to be read by the getAssertions services - it's really another example of where 'public final' is the right thing, but I don't think final is compatible with the database. You're right, though, they shouldn't be publicly writeable - I've now changed them to private with getters.
/** | ||
* Retrieve the GenerateAssertionsSummary record for this contest, and either return the winner's | ||
* index in the candidate list (if it is present and valid) or throw an error with the appropriate | ||
* error message (if either there is no record, or the record contains an error rather than a winner). |
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.
Typo: GenerateAssetionsSummary
This adds a new database table for storing the assertion generation summary - basically a winner (if it succeeded) and an error message (if it failed). The database table is stored, and then used subsequently when generating reports.
As a nice bonus, this allows us to remove the winner from the get assertions request.