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

✨ Misc issues with manifest.py classes #523

Closed
1 task done
JohnLCaron opened this issue Jan 21, 2022 · 4 comments
Closed
1 task done

✨ Misc issues with manifest.py classes #523

JohnLCaron opened this issue Jan 21, 2022 · 4 comments
Assignees
Labels
triage Waiting to be triaged

Comments

@JohnLCaron
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Suggestion

  1. Manifest
    does not use candidates in its crypto_hash(). Seems like it should.
    def crypto_hash(self) -> ElementModQ:
        """
        Returns a hash of the metadata components of the election
        """
        hash = hash_elems(
            self.election_scope_id,
            str(self.type.name),
            to_iso_date_string(self.start_date),
            to_iso_date_string(self.end_date),
            self.name,
            self.contact_information,
            self.geopolitical_units,
            self.parties,
            self.contests,
            self.ballot_styles,
        )
        log_debug(f"{self.__class__} : crypto_hash: {hash.to_hex()}")
        return hash
  1. ContestDescription has votes_allowed as Optional. if thats needed, would be good to document what that means. Otherwise, recommend to make it non-optional.

  2. Candidate has is_write_in as Optional. Recommend having a non-optional bool for clarity.

  3. CandidateContestDescription, ReferendumContestDescription seem unclear as when and why to use. Perhaps withdraw these from the reference library for now, until they are ready to be developed further?

  4. ContestDescriptionWithPlaceholders and InternalManifest: not clear if this is really used, or needed, or what its status is. Perhaps its a start of an n-of-m implementation extension? Is it tested? It should probably be split into its own file, so that the Manifest classes can just be the election description, that election officials would understand, and not implementation details.

Possible Implementation

No response

Anything else?

No response

@JohnLCaron JohnLCaron added enhancement New feature or request triage Waiting to be triaged labels Jan 21, 2022
@JohnLCaron
Copy link
Contributor Author

Ok, I see that ContestDescriptionWithPlaceholders and InternalManifest are needed. Still, pulling them out of manifest.py seems like a good way to separate concerns.

@keithrfung
Copy link
Collaborator

keithrfung commented Jan 24, 2022

@rc These issues should definitely be isolated into their own issues. Reference this issue from within them. Will answer here but this should stay in triage until addressed.

  1. Valid point. Remember this trickles into electionguard-cpp as well. Has to be fixed in both places. These type of issues are a strong example of why electionguard should dictate how things are serialized, so that these issues can exist in a common place.
  2. Agreed.
  3. Agreed. I don't believe this field is in the Google Civic spec so this is something that should be shiftable. It would also impact cpp though.
  4. I agree. These types add little value but make the code more complicated.
  5. I'm in agreement with the file/folder restructure as a whole. I think this is ElectionGuard 2.0 material personally. There are some overall architecture and organization restructuring needed.

@keithrfung
Copy link
Collaborator

Took a bit but I have all these referenced in new issues.

@rc-ms
Copy link
Contributor

rc-ms commented Mar 15, 2022

thanks Keith I agree generally and will weigh in on each issue. thanks for suggesting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Waiting to be triaged
Projects
None yet
Development

No branches or pull requests

3 participants