Skip to content

Cover governance resource validation with compact e2e cases - #8592

Merged
Amaury Chamayou (achamayou) merged 3 commits into
mainfrom
achamayou-ubiquitous-giggle
Oct 16, 2026
Merged

Amaury Chamayou (achamayou) merged 3 commits into
mainfrom
achamayou-ubiquitous-giggle

Conversation

@achamayou

Copy link
Copy Markdown
Member

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_storage with 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 in proposals.h, 9 in service_state.h, and 3 in recovery.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:

  • Built the instrumented Debug governance_test target.
  • Passed the existing governance JS runner: cd build && CR_FILTER=js ./tests.sh --timeout 360 --output-on-failure -R '^governance_test$' --no-tests=error.
  • Passed scripts/ci-checks.sh without auto-fixes and git 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.

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]>
@achamayou
Amaury Chamayou (achamayou) requested a review from a team as a code owner October 16, 2026 10:47
Copilot AI balanced review requested due to automatic review settings October 16, 2026 10:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 InvalidResourceName responses 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.

@achamayou
Amaury Chamayou (achamayou) merged commit 6c3b72c into main Oct 16, 2026
12 checks passed
@achamayou
Amaury Chamayou (achamayou) deleted the achamayou-ubiquitous-giggle branch October 16, 2026 12:41
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.

3 participants