Add feature flag for excluding redundant metadata in individual CVR reports #4036
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 acast-vote-record-report.json
file for every individual CVR. But we also repeat the metadata in themetadata.json
file in everycast-vote-record-report.json
file, so that the latter remain CDF-compliant. This PR introduces a feature flag to exclude that redundant metadata incast-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.Testing
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 introducedN/A