[code-improvement] reusability: reuse shared SHA-256 helper - #153
Merged
Pedro Henrique Penna (ppenna) merged 1 commit intoSep 21, 2026
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Pedro Henrique Penna (ppenna)
September 21, 2026 02:03
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The shared helper is behaviorally identical to the removed implementation, and all affected call sites were updated correctly.
Review effort: Balanced
Findings: None
What changed in this PR
Replaces benchmark-specific SHA-256 logic with the established shared helper without changing behavior.
Changes:
- Imports
common.sha256_file. - Removes the duplicate implementation and
hashlibimport. - Updates five provenance hash call sites.
| File | Description |
|---|---|
scripts/nvx_tools/benchmark.py |
Reuses the shared SHA-256 helper for benchmark provenance. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Pedro Henrique Penna (ppenna)
marked this pull request as ready for review
September 21, 2026 02:41
Pedro Henrique Penna (ppenna)
deleted the
code-improvement/reuse-benchmark-sha256-0fdd76ccfbc205c4
branch
September 21, 2026 03:07
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.
Scope
Category:
reusabilityEvidence and novelty
scripts/nvx_tools/benchmark.pycontained a private chunked SHA-256 implementation identical to the establishedscripts/nvx_tools/common.py::sha256_filehelper. Five benchmark provenance call sites already exercised the duplicate implementation, providing a proven second use for the shared helper.Recent code-improvement pull requests and their reviews were inspected. The prior reusability change in #144 concerned versioned JSON parsing, and open issues and pull requests do not track this hash-helper reuse, so this is neither a duplicate nor a cosmetic variant of rejected work.
Change
common.sha256_filefor benchmark artifact and helper provenance hashes.hashlibimport and local_sha256_fileimplementation.Changed files:
scripts/nvx_tools/benchmark.pyPatch size: 21 total added-plus-deleted lines (7 additions, 14 deletions).
Validation
All applicable repository-defined checks passed:
python -m unittest scripts.test_nvx_tools.BenchmarkTests -vpython -m unittest scripts/test_performance.py scripts/test_nvx_tools.py scripts/test_microvm_tests.py scripts/test_development_release.py -vpython -m compileall -q scriptspython -m ruff check scriptspython -m pyright --pythonplatform Linuxpython -m pyright --pythonplatform Windowspython -m ruff format --check scriptspython .github/skills/nvx-host-connect/scripts/test_hosts.py -vpython scripts/nvx.py --helppython scripts/nvx.py test-openvmm-unit --helppython scripts/nvx.py test-openvmm --helppython scripts/nvx.py test-microvm --helppython scripts/nvx.py benchmark --helpgit diff --checkpython scripts/nvx.py verifywas not run because this workflow is prohibited from initializing or inspecting the private OpenVMM submodule.No dependency, public API/CLI/ABI, gitlink, or OpenVMM change was made.