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

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

Copilot AI balanced review requested due to automatic review settings October 19, 2026 15:05
@jay23606
Jay (jay23606) force-pushed the fix/ubuntu-initramfs-input-snapshot branch from 1eaf367 to 461e242 Compare October 19, 2026 15:05

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 identified blocking issues.

No open issues 🎉

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 19, 2026 15:41
@jay23606
Jay (jay23606) force-pushed the fix/ubuntu-initramfs-input-snapshot branch from 461e242 to c6734e6 Compare October 19, 2026 15:41

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 mismatch with regression coverage and no identified blocking issues; tests were not run during review.

No open issues 🎉

Review effort: Balanced

@jay23606
Jay (jay23606) force-pushed the fix/ubuntu-initramfs-input-snapshot branch from c6734e6 to 59783fb Compare October 19, 2026 17:28
Copilot AI balanced review requested due to automatic review settings October 19, 2026 17: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 follows the existing mutation-check pattern and includes regression coverage, with no unresolved findings.

No open issues 🎉

Review effort: Balanced

@jay23606
Jay (jay23606) force-pushed the fix/ubuntu-initramfs-input-snapshot branch from 59783fb to fd12aef Compare October 19, 2026 17:46
Copilot AI balanced review requested due to automatic review settings October 19, 2026 17:46

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 bug with regression coverage and no identified blocking issues.

No open issues 🎉

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 19, 2026 17:51
@jay23606
Jay (jay23606) force-pushed the fix/ubuntu-initramfs-input-snapshot branch from fd12aef to a4a040d Compare October 19, 2026 17:51

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 mismatch with regression coverage and no identified blocking issues.

No open issues 🎉

Review effort: Balanced

@jay23606
Jay (jay23606) force-pushed the fix/ubuntu-initramfs-input-snapshot branch from a4a040d to 9adf4b2 Compare October 19, 2026 22:25
Copilot AI balanced review requested due to automatic review settings October 19, 2026 22:25

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 was unable to review this pull request because the user who requested the review has reached their quota limit.

@jay23606
Jay (jay23606) force-pushed the fix/ubuntu-initramfs-input-snapshot branch from 9adf4b2 to aa93bc4 Compare October 19, 2026 22:35
Copilot AI balanced review requested due to automatic review settings October 20, 2026 02:43
@jay23606
Jay (jay23606) force-pushed the fix/ubuntu-initramfs-input-snapshot branch from aa93bc4 to 26f6f04 Compare October 20, 2026 02:43

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 was unable to review this pull request because the user who requested the review has reached their quota limit.

@jay23606
Jay (jay23606) force-pushed the fix/ubuntu-initramfs-input-snapshot branch from 26f6f04 to 0f905ad Compare October 20, 2026 03:49
Copilot AI balanced review requested due to automatic review settings October 20, 2026 03:49

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 was unable to review this pull request because the user who requested the review has reached their quota limit.

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 20, 2026 04:22
@jay23606
Jay (jay23606) force-pushed the fix/ubuntu-initramfs-input-snapshot branch from 0f905ad to 6c623df Compare October 20, 2026 04:22

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 was unable to review this pull request because the user who requested the review has reached their quota limit.

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