Skip to content

[code-quality] Normalize Ubuntu source manifest errors - #291

Merged
Pedro Henrique Penna (ppenna) merged 1 commit into
devfrom
code-quality/ubuntu-manifest-errors-3f62244662a1c8d1
Oct 1, 2026
Merged

Pedro Henrique Penna (ppenna) merged 1 commit into
devfrom
code-quality/ubuntu-manifest-errors-3f62244662a1c8d1

Conversation

@ppenna

Copy link
Copy Markdown
Contributor

Category-specific improvement

The Ubuntu source collector read package manifests with json.loads() and allowed malformed JSON, unreadable files, or invalid UTF-8 to escape as raw Python tracebacks. _source_requirements() now converts those reachable input failures into the repository-standard ScriptError, while preserving the existing validation for valid manifests. A focused regression test covers malformed JSON.

This is distinct from recent code-quality PRs: the merged package-lock fix covers ubuntu.py, while this change covers collect_ubuntu_sources.py; no open PR touches this function or concern. The active Alpine source-collector work was inspected and excluded because it overlaps a different file and candidate.

Scope and validation

  • Changed files: scripts/nvx_tools/collect_ubuntu_sources.py, scripts/test_nvx_tools.py
  • Total changed lines: 17 (16 additions, 1 deletion)
  • No dependency, public API/CLI/ABI, gitlink, or OpenVMM change was made.

Validation passed:

  • python -m unittest scripts.test_nvx_tools.UbuntuSourceCollectionTests -v
  • python -m compileall -q scripts
  • python -m ruff check scripts
  • python -m pyright --pythonplatform Linux
  • python -m pyright --pythonplatform Windows
  • python -m ruff format --check scripts
  • python -m unittest scripts/test_performance.py scripts/test_nvx_tools.py scripts/test_microvm_tests.py scripts/test_development_release.py -v
  • git diff --check

Generated by code-quality · copilot · gpt56 · 4.48 AIC · ⌖ 0.737 AIC · ⊞ 16.3K · ◷

  • expires on Oct 15, 2026, 1:23 AM UTC

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 1, 2026 01:23

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.

Copilot review overview

🟢 Approval recommended

The focused implementation correctly normalizes the targeted failures without altering valid-manifest validation.

Review effort: Balanced
Findings: None

What changed in this PR

Normalizes Ubuntu source-manifest read and decoding failures as repository-standard ScriptError exceptions.

Changes:

  • Wraps file, UTF-8, and JSON parsing failures.
  • Adds malformed-JSON regression coverage.
File Description
scripts/​nvx_tools/​collect_ubuntu_sources.py Normalizes manifest-loading errors.
scripts/​test_nvx_tools.py Tests malformed manifest handling.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ppenna
Pedro Henrique Penna (ppenna) marked this pull request as ready for review October 1, 2026 18:14
@ppenna
Pedro Henrique Penna (ppenna) merged commit df4df29 into dev Oct 1, 2026
62 of 64 checks passed
@ppenna
Pedro Henrique Penna (ppenna) deleted the code-quality/ubuntu-manifest-errors-3f62244662a1c8d1 branch October 1, 2026 23:40
Pedro Henrique Penna (ppenna) added a commit that referenced this pull request Oct 2, 2026
dev moved from ae123d1 to 20353f8: bounded egress (#289), the shared
git output runner (#287), Ubuntu manifest errors (#291), the perf gate
history reset (#293), sandbox teardown through the init agent (#294),
virtiofs symlinks with openvmm 2728f33ea (#302), the required CI result
check (#305), and new performance baselines.

- .github/actions/validate-nvx/action.yml: run dev's
  test_egress_policy.py and the time ABI's test_guest_time.py and
  test_time_abi.py.
- scripts/nvx.py: keep the doctor parser import and dev's
  compile_policy_file import.
- scripts/test_nvx_tools.py: keep both the re and select imports.
- scripts/test_microvm_tests.py (no textual conflict): dev's L3/L4
  egress dispatch test expects the Ubuntu guest's default memory, which
  25bac37 raised from 256 to 512 MiB on this branch.

The openvmm gitlink takes dev's 2728f33ea (microvm/v2.1); lockstep
moves it to the time ABI head rebased onto it.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

2 participants