Skip to content

build: reject Ubuntu initramfs source edits made during packing - #584

Open
Jay (jay23606) wants to merge 1 commit into
microsoft:devfrom
jay23606:fix/ubuntu-initramfs-input-snapshot
Open

Jay (jay23606) wants to merge 1 commit into
microsoft:devfrom
jay23606:fix/ubuntu-initramfs-input-snapshot

Conversation

@jay23606

Copy link
Copy Markdown
Contributor

Fixes #506.

Summary

  • The Ubuntu manifest recorded the customization digest computed after the archive was packed. An edit to a customization source during the build therefore produced an artifact whose helpers came from the old source while the manifest advertised the new digest, and the release guest-input gate accepted it.
  • The digest is now captured before the root is prepared and compared again after packing. On a mismatch the artifact and manifest are removed and the build fails with initramfs source inputs changed during the build, matching the Alpine and kernel paths.

Test

  • test_ubuntu_initramfs_rejects_source_mutation_during_pack: the mutation case fails before this change (no ScriptError) and passes after; the unchanged-source control passes before and after.
  • Full test_nvx_tools.py: 485 pass, 54 skipped, 0 failures. ruff check and ruff format are clean.
  • Not run: a real Ubuntu native build or guest boot.

🤖 Generated with Claude Code

Copilot AI balanced review requested due to automatic review settings October 16, 2026 17:24

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 guard addresses the provenance mismatch with regression coverage for both outcomes and no identified blocking issues.

0 open findings

What changed in this PR

Fixes #506 by preventing native Ubuntu initramfs builds from recording provenance that does not match their source inputs.

Changes:

  • Captures the customization digest before root preparation and checks it again after packing.
  • Removes the artifact and manifest and fails if inputs changed.
  • Adds regression coverage for changed and unchanged sources.
File Description
scripts/​test_nvx_tools.py Tests source-mutation rejection, cleanup, and unchanged-source success.
scripts/​nvx_tools/​build.py Adds the Ubuntu input digest snapshot and post-pack validation.

🧠 Review effort: Balanced


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

Copilot AI balanced review requested due to automatic review settings October 16, 2026 18:28

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 fix addresses the reported provenance bug with regression coverage and no unresolved findings.

0 open findings

🧠 Review effort: Balanced

@jay23606
Jay (jay23606) force-pushed the fix/ubuntu-initramfs-input-snapshot branch from 14dd272 to a0907fc Compare October 16, 2026 20:44
Copilot AI balanced review requested due to automatic review settings October 16, 2026 20:44

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 fix follows the existing provenance-checking pattern and includes regression coverage; tests were not rerun during review.

0 open findings

🧠 Review effort: Balanced

The Ubuntu manifest recorded the customization digest computed after the
archive was packed, so an edit to a customization source during the build
produced an artifact whose helpers came from the old source while the
manifest advertised the new digest. The release guest-input gate accepted it.

Snapshot the digest before the root is prepared and compare it again after
packing. On a mismatch, remove the artifact and its manifest and fail, as the
Alpine and kernel builds already do.

Fixes microsoft#506

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Signed-off-by: jay23606 <4602056+jay23606@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 17, 2026 00:45
@jay23606
Jay (jay23606) force-pushed the fix/ubuntu-initramfs-input-snapshot branch from a0907fc to 1eaf367 Compare October 17, 2026 00:45

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 fix addresses the provenance defect with regression coverage and no unresolved findings.

No open issues 🎉

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.

Track Ubuntu native build bugs: source changes mislabel stale initramfs

2 participants