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

Input verification #48

Merged
merged 37 commits into from
Mar 28, 2024
Merged

Input verification #48

merged 37 commits into from
Mar 28, 2024

Conversation

vteague
Copy link
Member

@vteague vteague commented Mar 24, 2024

  • Implements classes for GenerateAssertionsRequest and GetAssertionsRequest
  • Implements Contest, with database retrieval and tests
  • Validates GenerateAssertionsRequests and GetAssertionsRequests, based on database retrieval, with tests.
  • Implements various other utils such as checking that a contest is all IRV.
  • Logs all exceptions.

Completes #38 and #34.
Partially completes #39.

Copy link
Member

@michelleblom michelleblom left a comment

Choose a reason for hiding this comment

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

Comments/requests for changes are all around commenting.

Added note: for Contest entity, should attributes be private with appropriate getters added?

We will need to remember to remove the TODO's/any code that will become redundant (if any) when we make requests based on contest name.

Tests seem very thorough!

public long countyID;

/**
* Version. Currently not used.
Copy link
Member

Choose a reason for hiding this comment

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

This will be used for optimistic locking. Consider adding comment "Version, for optimistic locking."

Copy link
Member

Choose a reason for hiding this comment

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

Should it also be nullable=false and updatable=false?

Copy link
Member

Choose a reason for hiding this comment

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

Also note, for county_id attribute, comment refers to "this Assertion".

Copy link
Member

Choose a reason for hiding this comment

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

Also, should all attributes be nullable=false and updatable=false?

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree that in Contest all attributes other than version should be nullable=false and updatable=false, which I've now done.

Need to think more about versions for Contest. We certainly won't update it, but perhaps someone else (i.e. colorado-rla) might, so I'm not sure what the updatable=false annotation implies about that case.

Actually on that point, if name is updated by canonicalization, is that consistent with the updatable=false annotation?

@vteague
Copy link
Member Author

vteague commented Mar 27, 2024

Thanks for that really careful review - I've marked as 'resolved' all the things I've just immediately changed. See above discussion for the slightly more complicated ones.

import java.math.BigDecimal;
import java.util.List;
import org.springframework.data.annotation.ReadOnlyProperty;

Copy link
Member

Choose a reason for hiding this comment

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

Same comment on describing contests from other files, also what is a GetAssertionsRequest?

Copy link
Member Author

Choose a reason for hiding this comment

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

I cleaned this up a bit, but lmk if it still doesn't make sense.

*/

package au.org.democracydevelopers.raireservice.request;

Copy link
Member

Choose a reason for hiding this comment

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

Worth adding a class description to indicate what this kind of exception means.

@@ -1,3 +1,4 @@
spring.datasource.driver-class-name=org.testcontainers.jdbc.ContainerDatabaseDriver
spring.jpa.hibernate.ddl-auto=create
Copy link
Member

Choose a reason for hiding this comment

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

Have a look at what I have done for this file in the CVR retrieval branch.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes that's a huge improvement, thanks. I won't pull it into this branch, but definitely main should be that.

@@ -0,0 +1,16 @@
-- Contest
Copy link
Member

Choose a reason for hiding this comment

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

Have a look at what I have done for this file in the CVR retrieval branch (as well as the added corla.sql schema).

@michelleblom michelleblom merged commit 266f6e7 into main Mar 28, 2024
1 check passed
@vteague vteague deleted the InputVerification branch April 23, 2024 06:05
@vteague vteague added this to the RAIRE Assertion Generator milestone May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants