Skip to content

refactor: build the boot test's project with the menu's local-build method - #771

Merged
danathar-atomic-hive[bot] merged 1 commit into
mainfrom
arch/refactor-build-context
Oct 19, 2026
Merged

danathar-atomic-hive[bot] merged 1 commit into
mainfrom
arch/refactor-build-context

Conversation

@danathar-atomic-hive

Copy link
Copy Markdown
Contributor

The nightly boot test is meant to build the same project a user gets from the menu's "Test build locally", then boot it. Until now it repeated that menu item's three setup steps by hand rather than calling them. This PR moves the steps into one method that both use. The test can no longer drift away from what users actually build. Nothing changes for users.

What changed

  • atomic_image_builder.py: new App.write_local_build_context(context, repo_dir) -> bool. It seeds the template, writes the project files without the workflow, and for BlueBuild renders the recipe into a Containerfile. It returns False when that render fails, which render_bluebuild_containerfile() has already reported. App.test_build_locally() now calls it in place of the three inline steps.
  • variant_boot_test.py: generate() calls the same method. Its error handling is unchanged: a CommandError and a failed render both still become a generate-stage StageFailure with the same messages. The module docstring names the method.
  • tests/test_variant_boot_test.py: test_the_project_is_written_by_the_same_method_as_the_menus_local_build pins generate() to App.write_local_build_context() and checks the arguments it passes.

Why

Closes #770

The boot test (#759) exists so a broken generated project is found by CI, not by a user (#756). That only holds while it builds what the menu builds. With two hand copies of the sequence, a change on the menu's side would leave the nightly test passing against a project the tool no longer writes, and no test compared the copies.

Same calls, same order, same arguments. The only condition that moved is the BlueBuild check: generate() tested slot.method, the method tests self.config.method, and test_config() sets the one from the other.

Tier 2 under docs/risk-tiers.md (atomic_image_builder.py).

How it was checked

  • python3 -m unittest discover -s tests: 2606 tests, OK (50 skipped)
  • python3 -m coverage run -m unittest discover -s tests && python3 -m coverage report --fail-under=90: total 99%. The new method's lines are covered. variant_boot_test.py lines 288-289 (the CommandError branch) were already uncovered on main.
  • ruff check (0.17.0): all checks passed
  • shellcheck, the two shell harnesses, actionlint, hadolint: skipped, no shell, workflow or Containerfile changed
  • Mutation: with variant_boot_test.py reverted to main (the hand copy) and the rest of this PR kept, the new test fails.

Anything a reviewer should look at first

The method name. write_local_build_context says what the menu's local build and the boot test share: the directory podman builds from. The menu-only parts (the podman check, AIB_DISABLE_LOCAL_BUILD, the pauses) stay in test_build_locally().


Filed by architect agent (ACMM L6 — full mode)

🤖 Generated with Claude Code

— hive: agent=architect backend=claude model=claude-opus-5-5 effort=high claude=2.1.303

…ethod

variant_boot_test.generate() repeated App.test_build_locally()'s three
steps by hand: seed the template, write the project files without the
workflow, and render a BlueBuild recipe into a Containerfile. The boot
test is only meaningful while it builds what the menu builds, and the
two copies were compared by nothing.

Move the three steps into App.write_local_build_context() and call it
from both places. Same calls, same order, same error handling at each
caller. A new test pins generate() to that method.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: architect <320561496+danathar-atomic-hive[bot]@users.noreply.github.com>
@danathar-atomic-hive danathar-atomic-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 19, 2026
@danathar-atomic-hive
danathar-atomic-hive Bot merged commit dd80dc6 into main Oct 19, 2026
6 checks passed
@danathar-atomic-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#77139020b7` sha256:e1891448fe7a8d74954bfd07a44321a31f3402d0d92b8ecc41c9d0d7430615ef — download from the dashboard or `hivectl review evidence #771`.

@danathar-atomic-hive danathar-atomic-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[architect] Nightly boot test hand-copies the "Test build locally" build-context steps instead of calling them

0 participants