Skip to content

Generate election definition - #1015

Draft
michielp1807 wants to merge 2 commits into
mainfrom
eml110a
Draft

Generate election definition#1015
michielp1807 wants to merge 2 commits into
mainfrom
eml110a

Conversation

@michielp1807

@michielp1807 michielp1807 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

DOD checklist

TODO:

  • Add diff tests to prevent unexpected changes, like we did for the 210s
  • Is it correct that max_votes is always an empty tag? Seems to be the case in the files I checked.
  • Do we need to specify a proper managing authority? Seems like the election definitions don't include this for the 110a.
  • Registered party names should not come from the loaded streams, but from the known registered parties that previously registered at the Kiesraad, right? -> part of Implement a standard list of appellations (aanduidingen) to select #1016
  • Including (the relevant part of) the election tree in the definition is still w.i.p. for rust-eml-nl

Converting MasterElectionTree.xml (MET) => ElectionTree

  • Get top level Region for election ("STAAT" for EK/TK)
  • Get all sub regions (but skip e.g. "PROVINCIAAL_KIESKRING" because we don't use that one?) -> how do we know which regions we want to include? maybe only top, bottom, and those with a relevant committee?
  • Get Committees for the current ElectionCategory

See kiesraad/rust-eml-nl#41 (comment):

  • TK25: STAAT, KIESKRING, GEMEENTE
  • EK23: STAAT, PROVINCIE, STEMBUREAU (in MET: PROVINCIAAL_STEMBUREAU)
  • PS23: PROVINCIE, KIESKRING, GEMEENTE (in MET: PROVINCIAAL_KIESKRING)
  • AB23: WATERSCHAP, KIESKRING, GEMEENTE (in MET: WATERSCHAP_KIESKRING, WATERSCHAP_GEMEENTE)

(MET parsing still needs to be build)

The MET also includes two new region types:

For PR maintainer

Perform these checks before marking the PR as ready:

  • I have linked the PR to at least one issue.
  • I assigned the PR to myself.
  • I have added a description how to test this PR (see "Review Instructions").
  • I have added documentation where necessary.

For reviewer

  • I have read all code changes.
  • I have audited the code quality.
  • I have tested the changes either or both:
    • locally
    • on the test environment (preferred)
  • I have validated that the PR is functionally correct (use-cases, figma designs, etc.)

Review instructions

image

@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown

Sigrid maintainability feedback


🔒Enable security insights in your CI pipeline to detect vulnerabilities early.
Start using Sigrid CI for Security today. Learn more.


⏸️️ You are still below your objective of 3.5 stars.

Show details

Sigrid compared your code against the baseline of 2026-07-27.

👍 What went well?

You fixed or improved 1 refactoring candidates.

Risk System property Location
🔴 Duplication
(Fixed)
src/core/election/configs.rs line 62-75
src/core/election/configs.rs line 110-123

👎 What could be better?

Unfortunately, 10 refactoring candidates were introduced or got worse.

Risk System property Location
🔴 Duplication
(Introduced)
src/core/election/configs.rs line 75-88
src/core/election/configs.rs line 145-158
🔴 Unit Size
(Introduced)
src/models/eml/eml210.rs
eml210(PgStore,ElectionConfig,PoliticalGroup,CandidateListId,ModelLocale)
🟠 Unit Size
(Introduced)
src/models/eml/mod.rs
ElectionSubcategory.from(ElectionConfig)
🟠 Unit Size
(Introduced)
src/models/eml/eml110a.rs
eml110a(ElectionConfig,Vec<String>)
🟠 Unit Size
(Introduced)
src/models/eml/eml210.rs
try_into()
🟠 Unit Interfacing
(Introduced)
src/models/eml/eml210.rs
eml210(PgStore,ElectionConfig,PoliticalGroup,CandidateListId,ModelLocale)
🟠 Module Coupling
(Worsened)
src/core/election/configs.rs
🟡 Unit Size
(Introduced)
src/models/eml/mod.rs
ElectionIdentifierBuilder.try_from(ElectionConfig)
⚪️ + 2 more

📚 Remaining technical debt

1 refactoring candidates didn't get better or worse, but are still present in the code you touched.

View this system in Sigrid to explore your technical debt

⭐️ Sigrid ratings

System property System on 2026-07-27 Before changes New/changed code
Volume N/A N/A N/A
Duplication 5.3 3.3 4.4
Unit Size 3.1 2.3 1.9
Unit Complexity 4.5 5.5 5.5
Unit Interfacing 2.4 5.5 1.6
Module Coupling 3.0 0.5 0.9
Component Independence 1.9 N/A N/A
Component Entanglement 1.6 N/A N/A
Maintainability 3.1 2.2 2.4

💬 Did you find this feedback helpful?

We would like to know your thoughts to make Sigrid better.
Your username will remain confidential throughout the process.


View this system in Sigrid

@github-actions

Copy link
Copy Markdown

PDF diff summary

Template Input Status
model-h1 model-h1-example-1.pdf 🔵 identical
model-h1 model-h1-example-2.pdf 🔵 identical
model-h1 model-h1-example-3.pdf 🔵 identical
model-h3-1 model-h3-1-example-1.pdf 🔵 identical
model-h3-1 model-h3-1-example-2.pdf 🔵 identical
model-h3-1 model-h3-1-example-3.pdf 🔵 identical
model-h3-2 model-h3-2-example-1.pdf 🔵 identical
model-h3-2 model-h3-2-example-2.pdf 🔵 identical
model-h3-2 model-h3-2-example-3.pdf 🔵 identical
model-h4 model-h4-example-1.pdf 🔵 identical
model-h4 model-h4-example-2.pdf 🔵 identical
model-h4 model-h4-example-3.pdf 🔵 identical
model-h9 model-h9-example-1.pdf 🔵 identical
model-h9 model-h9-example-2.pdf 🔵 identical
model-h9 model-h9-example-3.pdf 🔵 identical
model-i4 model-i4-example-1.pdf 🔵 identical
model-i4 model-i4-example-2.pdf 🔵 identical

@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant