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

136 persist winners for irv contests #101

Merged
merged 27 commits into from
Jul 22, 2024

Conversation

vteague
Copy link
Member

@vteague vteague commented Jul 19, 2024

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.

vteague added 24 commits July 12, 2024 18:05
…raceful failure if the database state is not what we expect.
@vteague vteague requested a review from michelleblom July 19, 2024 02:00
@@ -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);

Copy link
Member

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 = "";

/**
Copy link
Member

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?

Copy link
Member Author

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).
Copy link
Member

Choose a reason for hiding this comment

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

Typo: GenerateAssetionsSummary

@vteague vteague merged commit d13b93c into main Jul 22, 2024
1 check passed
@vteague vteague deleted the 136-persist-winners-for-irv-contests branch July 22, 2024 10:19
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.

2 participants