Repository navigation
Cover governance resource validation with compact e2e cases - #8592
Merged
Merged
Conversation
Exercise malformed resource IDs and signed proposal/member mismatches while reusing the existing proposal and valid ballot controls. Check exact rejection errors and unchanged proposal state. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused test-only changes preserve positive controls and have no identified blocking issues.
0 open findings
What changed in this PR
Extends existing governance end-to-end tests without changing production behavior.
Changes:
- Adds 36 rejection cases for malformed resource IDs and signed-request identity mismatches.
- Checks
400 InvalidResourceNameresponses and unchanged proposal state while retaining positive ballot controls.
Custom instructions used
.github/skills/testing/SKILL.md
| File | Description |
|---|---|
| tests/governance_js.py | Extends ballot-storage tests with governance resource validation cases. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Max (maxtropets)
approved these changes
Oct 16, 2026
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.
Motivation
Exercise meaningful governance validation paths missed by coverage run 38866673904: malformed resource IDs and requests whose signed identity does not match the URL.
Implementation summary
Extend the existing
test_ballot_storagewith 36 rejection cases in 50 added test lines, reusing its network, authenticated client, proposal, and valid-ballot controls.Cover too-short, too-long, and non-hex IDs across governance read/write endpoints, plus well-formed proposal/member identity mismatches on signed requests.
Explicit COSE headers ensure non-hex URLs reach resource validation rather than failing client-side header inference.
Assert HTTP 400 with
InvalidResourceName, then verify the proposal state is unchanged.Local coverage exercises 95 governance lines that were uncovered in the original consolidated report: 62 in
helpers.h, 21 inproposals.h, 9 inservice_state.h, and 3 inrecovery.h.This corresponds to +0.16 percentage points against the original 58,906-line denominator; it is a source-line comparison, not a fresh full Virtual/SNP consolidated run.
Validation completed:
governance_testtarget.cd build && CR_FILTER=js ./tests.sh --timeout 360 --output-on-failure -R '^governance_test$' --no-tests=error.scripts/ci-checks.shwithout auto-fixes andgit diff --check.Safety and compatibility
Test-only change in
tests/governance_js.py; no production code, API, data-format, consensus/KV, recovery, or mixed-version behavior changes.Existing successful ballot submissions remain as positive controls.