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

Add feature flag for excluding redundant metadata in individual CVR reports #4036

Merged
merged 3 commits into from
Oct 5, 2023

Conversation

arsalansufi
Copy link
Contributor

@arsalansufi arsalansufi commented Oct 4, 2023

Easiest reviewed by commit

Overview

Issue link: #3995

In order to meet the VVSG2 requirements around continuous export, while also staying true to CDF, our export format has ended up a little strange.

We export a top-level metadata.json file for the whole export, plus a cast-vote-record-report.json file for every individual CVR. But we also repeat the metadata in the metadata.json file in every cast-vote-record-report.json file, so that the latter remain CDF-compliant. This PR introduces a feature flag to exclude that redundant metadata in cast-vote-record-report.json files, significantly decreasing their size. This feature flag is similar in spirit to the existing feature flag for excluding original snapshots in CVRs.

With a feature flag, we can toggle between efficiency and true CDF-compliance, as needed. Hopefully, something will come out of usnistgov/CastVoteRecords#45 such that this feature flag becomes unnecessary 🤞.

I'm enabling both CVR optimization feature flags by default, since we'll want them enabled for real elections for the foreseeable future as far as I can tell. Faster performance on election day feels more important than hypothetical cross-system compatibility, for now.

Demo Screenshot

An individual cast-vote-record-report.json file, before on the left, after on the right. All the extra data that's on the left but not on the right (i.e. the redundant metadata) is never used on import.

before-after

Testing

  • Manually tested export and import with and without the feature flag

Automated tests are coming in their own PR

Checklist

  • I have added logging where appropriate to any new user actions, system updates such as file reads or storage writes, or errors introduced N/A

Also:
- Rename an existing feature flag for consistency with new flag
- Make order of feature flags across relevant files consistent
- Remove now unused REACT_APP_VX_SCREEN_ORIENTATION env var
@@ -11,8 +11,8 @@ REACT_APP_VX_SKIP_CVR_ELECTION_HASH_CHECK=FALSE
REACT_APP_VX_SKIP_SCAN_ELECTION_HASH_CHECK=FALSE
REACT_APP_VX_SKIP_BALLOT_PACKAGE_AUTHENTICATION=FALSE
REACT_APP_VX_SKIP_CAST_VOTE_RECORDS_AUTHENTICATION=FALSE
REACT_APP_VX_DISABLE_CVR_ORIGINAL_SNAPSHOTS=FALSE
REACT_APP_VX_CAST_VOTE_RECORD_OPTIMIZATION_EXCLUDE_ORIGINAL_SNAPSHOTS=TRUE
REACT_APP_VX_CAST_VOTE_RECORD_OPTIMIZATION_EXCLUDE_REDUNDANT_METADATA=TRUE
Copy link
Contributor Author

@arsalansufi arsalansufi Oct 4, 2023

Choose a reason for hiding this comment

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

As noted in the PR description:

I'm enabling both CVR optimization feature flags by default, since we'll want them enabled for real elections for the foreseeable future as far as I can tell. Faster performance on election day feels more important than hypothetical cross-system compatibility, for now

We'll of course want to revisit this come time for cert. Planning to make an issue so that we don't forget. But open to changing this now, too!

@arsalansufi arsalansufi requested a review from adghayes October 4, 2023 19:09
@arsalansufi arsalansufi marked this pull request as ready for review October 4, 2023 19:09
@arsalansufi arsalansufi requested a review from a team as a code owner October 4, 2023 19:09
@arsalansufi arsalansufi requested review from carolinemodic and removed request for a team and carolinemodic October 4, 2023 19:09
Copy link
Collaborator

@adghayes adghayes left a comment

Choose a reason for hiding this comment

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

lgtm, thanks for the consistency changes around env. vars

@arsalansufi arsalansufi merged commit 89625c1 into main Oct 5, 2023
@arsalansufi arsalansufi deleted the arsalan/condensed-format branch October 5, 2023 01:17
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