Repository navigation
Conversation
- introduce PassRule enum with Percentage and VoteCount variants - update validation to reject conflicting or invalid pass rules - modify results calculation and helpers to support vote count rules - update documentation, templates and tests for new rules - preserve legacy pass threshold behavior when pass rule is absent Signed-off-by: mingcheng <mingcheng@apache.org>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Configuration presence validation is incomplete, and the unrelated broad lockfile upgrade substantially expands the change scope.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds configurable percentage- and vote-count-based pass rules while retaining legacy threshold compatibility.
Changes:
- Adds pass-rule parsing, validation, evaluation, and early-close logic.
- Updates vote and audit templates to display applicable requirements.
- Adds documentation, fixtures, and tests.
| File | Description |
|---|---|
templates/vote-status.md |
Displays configured pass requirements. |
templates/vote-created.md |
Describes vote-count rules. |
templates/vote-closed.md |
Shows closing thresholds. |
templates/audit-vote-details.html |
Shows pass rules in audits. |
src/tmpl/tests.rs |
Updates and extends template tests. |
src/tmpl.rs |
Supplies pass-rule template data. |
src/testutil.rs |
Updates result fixtures. |
src/testdata/config.yml |
Adds a vote-count profile. |
src/results/tests.rs |
Tests vote-count evaluation. |
src/results.rs |
Implements rule evaluation and early closing. |
src/cfg_repo/tests.rs |
Tests parsing and validation. |
src/cfg_repo.rs |
Defines and validates pass rules. |
docs/config/.gitvote.yml |
Documents pass-rule configuration. |
Cargo.lock |
Refreshes resolved dependencies. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if self.pass_rule.is_some() && self.pass_threshold != 0.0 { | ||
| bail!(ERR_PASS_RULES_MUTUALLY_EXCLUSIVE); |
|
Thanks @mingcheng, but we'd prefer to take care of this ourselves 🙂 Could you open a discussion under Ideas and explain your use case? Please note that we're trying to keep GitVote as simple as possible, so we don't necessarily add every requested feature. That said, if the community sees value in this voting mode, we'll definitely consider it. |
Okay, I'll close this pull request first, then create a discussion to explain my experience and thoughts. |

Hello, I am a maintainer from Dragonfly. Considering the diversity of community governance, I adjusted the voting rules of gitvote.
For the compatibility, I added a new passrule rule (see the documentation for details) to both support percentage and vote_count rule. Some code was assisted by Claude Code, and I have reviewed it.