Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements “STV KV v2” candidate metadata to carry ASF IDs alongside display names, and updates the voting UI to show ASF IDs on STV ballots.
Changes:
- Add
version: 2STV KV support wherelabelmapvalues are[asfid, name]pairs, with normalization viaget_candidates(). - Render ASF IDs in the STV ballot UI and embed
{label, asfid, name}candidate objects into the page. - Update tests/coverage scaffolding and sample election YAML to exercise and document the v2 format.
Reviewed changes
Copilot reviewed 5 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| v3/tests/test_stv.py | Adds unit tests for get_candidates() and verifies tally behavior across kv versions. |
| v3/tests/check_coverage.py | Updates coverage test election to use STV kv v2 labelmap pairs. |
| v3/steve/vtypes/stv.py | Introduces get_candidates() and updates STV tally logic to consume versioned candidate metadata. |
| v3/steve/election.py | Comment formatting only (no behavior change). |
| v3/server/templates/vote-on.ezt | Embeds ASF IDs into client-side STV candidate data and displays them in the ballot UI. |
| v3/server/pages.py | Uses get_candidates() to populate normalized STV candidates for the vote-on page. |
| v3/server/bin/tally.py | Formatting-only changes. |
| v3/server/bin/election.yaml.sample | Updates sample STV configuration to kv v2 [ASF ID, name] pairs. |
| v3/server/bin/create-election.py | Validates STV candidate kv structure via get_candidates(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+87
to
+89
| candidates = get_candidates(kv) | ||
| labelmap = {label: candidate['name'] for label, candidate in candidates.items()} | ||
| revmap = {name: label for label, name in labelmap.items()} |
Member
Author
There was a problem hiding this comment.
This seems a new feature that we may handle in a follow-up PR.
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This resolves #93.
This patch is driven by Codex while I do an overall review that it generally looks good.