Skip to content

release: name the mismatched fields in Ubuntu artifact manifest errors - #664

Open
Pedro Henrique Penna (ppenna) wants to merge 1 commit into
devfrom
ppenna/name-ubuntu-manifest-mismatches-20261020
Open

Pedro Henrique Penna (ppenna) wants to merge 1 commit into
devfrom
ppenna/name-ubuntu-manifest-mismatches-20261020

Conversation

@ppenna

Copy link
Copy Markdown
Contributor

Fixes #602.

Supersedes #604, which we could not accept because its Contributor License Agreement was not signed. This is a separate implementation of #602's requirements.

Summary

  • Before scripts/nvx.py package builds a release, _guest_release_inputs checks each Ubuntu guest artifact in build/ against its manifest. Its error named only the artifact, so a stale artifact and changed build inputs looked the same.

  • The check now compares each manifest with the expected format, guest, artifact, artifact_sha256, and input_sha256, hashing each artifact once. It names the manifest file and every mismatched field, with the value that the manifest records, or missing, and the expected value. Values are printed as JSON, so digests appear in full.

  • The message keeps its Ubuntu artifact manifest does not match <artifact> prefix. The failure that Order Ubuntu converter inputs alike on every OS #599 fixed would now read:

    error: Ubuntu artifact manifest does not match initramfs-ubuntu.cpio.gz: initramfs-ubuntu.cpio.gz.packages.json differs in input_sha256 (manifest "58aecdad0d5a74d18228d9cd6e495cd9844e8328b8f22c2c4178e699cbf1bb0e", expected "049bc163d732721ec20218cbfd5c524a07c226305bde3af126ad792826a60072")
    
  • What the check accepts is unchanged. The Azure Linux, OpenVMM, kernel, and initramfs checks are out of scope, as release: name the mismatched fields in Ubuntu artifact manifest errors #602 states.

Test

  • test_guest_release_inputs_reject_stale_ubuntu_artifacts asserts that a stale artifact names artifact_sha256 with both digests, and not input_sha256, for both artifacts.
  • test_guest_release_inputs_reject_stale_ubuntu_source_inputs now edits an Ubuntu build input and asserts that the message names input_sha256 with both digests, and not artifact_sha256.
  • test_guest_release_inputs_name_every_mismatched_ubuntu_manifest_field checks that valid manifests pass, that two wrong fields are both named, and that a missing field is named as missing.
  • These tests fail against dev, whose message names only the artifact.
  • python -m unittest -k guest_release_inputs scripts/test_nvx_tools.py: 7 tests, OK. scripts/test_nvx_tools.py: 480 tests, OK (28 skipped).
  • ruff check, ruff format --check, and pyright for Linux and Windows are clean.

Before release packaging, each Ubuntu guest artifact in build/ must
match its manifest, but the error named only the artifact. Telling a
stale artifact from changed build inputs took a local reproduction,
as for the Windows Package release failure that #599 fixed.

Compare each manifest with the expected values, hashing each artifact
once, and name the manifest and every mismatched field with the value
that the manifest records, or missing, and the expected one. Digests
appear in full, and the message keeps its prefix for log searches.

Test a stale artifact, changed build inputs, two wrong fields, and a
missing field, as #602 requires.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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 narrow changes satisfy the diagnostic requirements with regression coverage and no identified blocking issues.

No open issues 🎉

What changed in this PR

Improves Ubuntu artifact manifest errors during release packaging, addressing #602 without changing validation criteria.

Changes:

  • Reports every mismatched field, recorded and expected values, and the manifest filename.
  • Preserves the error prefix and prints full digests.
  • Adds regression coverage for stale artifacts, changed inputs, multiple mismatches, missing fields, and valid manifests.
File Description
scripts/​test_nvx_tools.py Verifies detailed mismatch messages and valid-manifest acceptance.
scripts/​nvx_tools/​release.py Collects and formats Ubuntu manifest field mismatches.

Review effort: Balanced

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.

release: name the mismatched fields in Ubuntu artifact manifest errors

2 participants