-
Notifications
You must be signed in to change notification settings - Fork 4
✨ Build an importable election event from a workbook, in the shared core #2982
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
Open
edulix
wants to merge
44
commits into
main
Choose a base branch
from
feat/meta-12769-build-bundle/main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
59f9a25
♻️ Move the report types into sequent-core::election_config
edulix 9c2a236
♻️ Move the import bundle schema into sequent-core::election_config
edulix c92499c
✨ Add shared election config validation to sequent-core
edulix e7b6b68
✨ Validate an import bundle with the shared rules before importing it
edulix 408c709
✨ Share the writers for the bundle's own file formats
edulix 6e5df25
✨ Share how a spreadsheet cell becomes JSON
edulix 26a7dea
✨ Read an authoring workbook in the shared core
edulix 7fdfba9
✨ Share the deterministic ids a generated bundle uses
edulix e832712
✨ Share the base entity templates and how they render
edulix c23d234
✨ Build the bundle's JSON document in the shared core
edulix 12af03f
✨ Build the bundle's CSV members in the shared core
edulix b1126d7
✨ Configure the login page from the event, in the shared core
edulix bade833
✨ Turn a bundle into the files it ships as
edulix d12052f
🔥 Delete windmill's copy of the CSV shapes
edulix b98b204
✨ Share the fixtures the two callers must agree on
edulix d670be4
✨ Compile an Election Architect plan into the same rows a workbook pr…
edulix 49325e7
✨ Let the wizard district
edulix 6f822d0
🐞 Gate the builder's re-export like the module it names
edulix ee3d5f6
📄 License the fixture bundles
edulix c408948
✅ Check sequent-core at every feature gate
edulix a85255f
🐞 Emit an instant, so the voting period actually opens
edulix 7eecb3d
Merge branch 'main' into feat/meta-12769-shared-core/main
edulix 26a1064
Merge branch 'feat/meta-12769-shared-core/main' into feat/meta-12769-…
edulix 532acda
Merge remote-tracking branch 'origin/main' into stack/shared-core
edulix bbda53f
Merge branch 'stack/shared-core' into stack/build-bundle
edulix 30799d6
Address the review: one list of algorithms, and a floor under the counts
edulix 19711bc
Merge branch 'stack/shared-core' into stack/build-bundle
edulix 89eac0b
Cover the two boundaries the review found untested
edulix 24e399d
Merge branch 'stack/shared-core' into stack/build-bundle
edulix eaf7a30
Cut the commentary the last two commits carried
edulix 4e16f3c
Merge branch 'stack/shared-core' into stack/build-bundle
edulix f248f42
An event with no areas is a warning, not a refusal
edulix f72da8e
Merge remote-tracking branch 'origin/feat/meta-12769-shared-core/main…
edulix 1319677
Pin that empty areas is not a missing field either
edulix 82062f9
Merge remote-tracking branch 'origin/feat/meta-12769-shared-core/main…
edulix ab5a5c8
Three defects the review found: a panic, an overflow, a lost schedule…
edulix 96964d9
Three more from the review: blank cells, numeric ids, longer area loops
edulix 3ba7736
Four more from the review, and a test that proves the numeric-id fix
edulix 8452d2a
The processors and the task name come from the platform, not from a copy
edulix d398529
A typed requirement kind, and least privilege on the gate job
edulix 2d5e16d
The plan validator's last duplicate: an identifier reused
edulix 75b7f11
Say which ballot values the workbook did not give
edulix 01cbc08
Name the value the bundle carries, not a copy of it
edulix d9c06a2
Pin that the wizard is not one of those workbooks
edulix File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| // SPDX-FileCopyrightText: 2026 Sequent Tech Inc <legal@sequentech.io> | ||
| // | ||
| // SPDX-License-Identifier: AGPL-3.0-only | ||
|
|
||
| //! Validate an election event bundle from a file. | ||
| //! | ||
| //! `cargo run -p sequent-core --features default_features --example validate_bundle -- <path>` | ||
| //! | ||
| //! A thin harness for checking a real export against the shared rules; the same | ||
| //! call step-cli and the browser make. | ||
|
|
||
| use sequent_core::election_config::{validate, ImportElectionEventSchema}; | ||
|
|
||
| fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
| let path = std::env::args() | ||
| .nth(1) | ||
| .ok_or("usage: validate_bundle <path>")?; | ||
| let text = std::fs::read_to_string(&path)?; | ||
| let bundle: ImportElectionEventSchema = serde_json::from_str(&text)?; | ||
|
|
||
| let report = validate(&bundle); | ||
| print!("{report}"); | ||
| println!( | ||
| "{} error(s), {} warning(s)", | ||
| report.errors().count(), | ||
| report.warnings().count() | ||
| ); | ||
| if report.has_errors() { | ||
| std::process::exit(1); | ||
| } | ||
| Ok(()) | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.