Skip to content

refactor(image): extract reusable image builder - #415

Merged
reuben olinsky (reubeno) merged 1 commit into
microsoft:mainfrom
reubeno:refactor/extract-image-builder
Oct 29, 2026
Merged

reuben olinsky (reubeno) merged 1 commit into
microsoft:mainfrom
reubeno:refactor/extract-image-builder

Conversation

@reubeno

Copy link
Copy Markdown
Member

Move image building and its tests into core/imagebuilder without changing CLI behavior or any meaningful code changes.

Call owning helpers directly from image commands and move unchanged generic file validation into fileutils, preserving diagnostics and existing test coverage.

This is part of a sequence of work to enable better code reuse within image and component commands, specifically for building and testing.

Copilot AI balanced review requested due to automatic review settings October 28, 2026 17:19

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 image-building helper extraction has no active review issues.

No open issues 🎉

What changed in this PR

Extracts image-building logic into reusable core helpers, preparing for reuse across image and component commands while preserving CLI behavior and diagnostics.

Changes:

  • Moves image building, architecture types, image lookup, and associated tests into core/imagebuilder.
  • Updates image commands to call the extracted helpers directly.
  • Moves file-existence validation into fileutils with focused diagnostic tests.
File Description
internal/​utils/​fileutils/​file.go Exposes shared file-existence validation.
internal/​utils/​fileutils/​file_test.go Tests validation outcomes and access-error diagnostics.
internal/​app/​azldev/​core/​imagebuilder/​lookup_test.go Relocates image-lookup tests to the core package.
internal/​app/​azldev/​core/​imagebuilder/​build.go Houses reusable build logic, architecture types, and image lookup.
internal/​app/​azldev/​core/​imagebuilder/​build_internal_test.go Moves existing build tests into the new package.
internal/​app/​azldev/​cmds/​image/​test.go Uses shared lookup and file-validation helpers.
internal/​app/​azldev/​cmds/​image/​build.go Retains CLI wiring and delegates building to the core package.
internal/​app/​azldev/​cmds/​image/​boot.go Uses core image lookup while preserving diagnostics.
internal/​app/​azldev/​cmds/​image/​boot_test.go Removes lookup tests relocated to the core package.

Review effort: Balanced

Move image building and its tests into core/imagebuilder without changing CLI behavior. Call owning helpers directly from image commands and move unchanged generic file validation into fileutils, preserving diagnostics and existing test coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@reubeno
reuben olinsky (reubeno) force-pushed the refactor/extract-image-builder branch from 616e6d7 to dbfcbc6 Compare October 28, 2026 23:55
Copilot AI balanced review requested due to automatic review settings October 28, 2026 23:56

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

No active review issues were identified for the extraction of reusable image-building helpers.

No open issues 🎉

Review effort: Balanced

@liunan-ms Nan Liu (liunan-ms) 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.

LGTM

@reubeno
reuben olinsky (reubeno) merged commit 9211751 into microsoft:main Oct 29, 2026
21 checks passed
@reubeno
reuben olinsky (reubeno) deleted the refactor/extract-image-builder branch October 29, 2026 00:55
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.

3 participants