Skip to content

Issue #217: Autogenerate sample data from sample manifests#362

Open
Francis220 wants to merge 1 commit intoElection-Tech-Initiative:mainfrom
Francis220:issue-217-generate-sample-data
Open

Issue #217: Autogenerate sample data from sample manifests#362
Francis220 wants to merge 1 commit intoElection-Tech-Initiative:mainfrom
Francis220:issue-217-generate-sample-data

Conversation

@Francis220
Copy link
Copy Markdown

Issue

Fixes #217

Description

Adds the first slice of generated sample data support.

The repo stores generated sample election JSON files directly in data/. Those files can get stale when the Python SDK changes. The issue asks to keep the sample manifests as the source of truth, then generate sample data during release instead of manually storing/updating it all.

This PR:

  • Adds sample manifest source files under data/sample/manifests
  • Adds scripts/generate_sample_data.py to generate sample data using electionguard-python
  • Adds Makefile targets for generating and packaging sample data
  • Adds a dedicated sample data generation workflow
  • Uses Python 3.9 for the sample data generation workflow because electionguard==1.4.0 targets Python 3.9, while the existing docs workflow continues using its current Python version
  • Updates the release workflow to publish both sample-data.zip and sample-data.tar.gz
  • Updates sample data docs to point generated artifacts at releases
  • Ignores generated sample output and release archives

This intentionally does not remove the existing checked-in generated sample data yet. That cleanup would remove ~200 generated JSON files, so I kept it separate to make this generation path easier to review first. To be addressed in a separate PR :)

Testing

Validated locally with:

  • PYTHONPYCACHEPREFIX=/private/tmp/codex_pycache python3 -m py_compile scripts/generate_sample_data.py
  • git diff --check
  • YAML parse check for the updated workflows
  • End-to-end sample generation using electionguard==1.4.0 dacite==1.6.0 hypothesis
  • Generated all four default manifests: minimal, small, full, and hamilton-general
  • Ran the Makefile package flow with temp output and confirmed zip/tar generation
  • Ran /private/tmp/electionguard-docs-venv/bin/mkdocs build successfully

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.

🚀 Autogenerate Sample Data from Sample Manifests

1 participant