This repository was archived by the owner on Sep 8, 2026. It is now read-only.
[architect] refactor: single source of truth for wizard step reachability — builder.py templates vs gresource.xml/recipe.json/defaults+layouts step classes - #211
Open
kubestellar-hive[bot] wants to merge 1 commit into
Conversation
…lity builder.py's `templates` dict decides which wizard steps are ever constructed, but four other surfaces independently declare that a step exists: defaults/meson.build sources, meson.build's blueprint list, bootc-installer.gresource.xml, and recipe.json's steps.<key>.template. Nothing made them agree, so step modules accumulated that ship, translate, and look production-ready but are never reachable. Adds tests/unit/test_step_registry.py, a static (stdlib-only, no gi) drift gate that makes builder.templates the declared authority: - registered classes resolve to a real class in the imported module - registered steps' @Gtk.Template resource_path is embedded in the gresource (otherwise the wizard dies at construction on the live ISO) - recipe.json names only registered templates — Builder.__load's `if step["template"] in templates` drops unknown names silently - step classes on disk (identified by get_finals(), the interface Builder.get_finals calls) are registered or explicitly declared dead - every gtk/default-*.ui in the gresource has a resource_path consumer The two allowlists are subset-asserted, so the gate is green whether or not #194 has landed. They currently record five unreachable step classes (nvidia, vm, network, theme, layouts/preferences) plus the orphaned gtk/default-hardware.ui, which has no Python consumer at all. No production code or behavior changes. Refs #210 Signed-off-by: sec-check[bot] <sec-check[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor
Claimed ground:
tests/unit/test_step_registry.py(new file, the only file this PR touches). It reads — and does not modify —bootc_installer/utils/builder.py(templates),bootc_installer/bootc-installer.gresource.xml,recipe.json, and the step classes inbootc_installer/defaults/andbootc_installer/layouts/.builder.py'stemplatesdict decides which wizard steps are ever constructed, but four other surfaces independently declare that a step exists:bootc_installer/defaults/meson.buildsources— installs the modulebootc_installer/meson.buildblueprint list — compiles its.blpbootc_installer/bootc-installer.gresource.xml— embeds its.uirecipe.jsonsteps.<key>.template— asks for it by nameNothing made them agree with
builder.templates, so step modules accumulated that ship, translate, and look production-ready but are never reachable — and the reverse drift only fails on the live ISO.What this adds
tests/unit/test_step_registry.py— a static gate (stdlibast/re/ElementTreeonly; it never importsbootc_installer.defaults.*, because theunitCI job installs only pytest and has nogi/GTK). Five checks:test_registered_classes_are_defined_where_builder_imports_themtemplatesnaming a class its module no longer definestest_registered_step_resources_are_embedded_in_the_gresource@Gtk.Template(resource_path=)is not in the gresource → wizard dies at construction on the ISOtest_bundled_recipe_only_names_registered_templatesBuilder.__load'sif step["template"] in templates:drops an unknown/typo'd name silently, with no errortest_unregistered_step_classes_are_declared_deadtest_wizard_page_resources_have_a_python_consumergtk/default-*.uiembedded with noresource_path=referencing itStep classes are identified by implementing
get_finals()— the interfaceBuilder.get_finalsactually calls — not by name, so helper widgets and modals in the same modules (BootcDefaultDiskEntry,BootcDefaultDiskPartModal,BootcDefaultDiskConfirmModal) are correctly excluded.Drift it records today
The two allowlists are subset-asserted, so nothing here needs updating when an entry goes away. They currently document five unreachable step classes —
BootcDefaultNvidia,BootcDefaultVm,BootcDefaultNetwork,BootcDefaultTheme,BootcLayoutPreferences— plusgtk/default-hardware.ui, which is listed inmeson.build:15andgresource.xml:29and has no Python consumer anywhere.Relationship to #187 / PR #194
PR #194 deletes
defaults/{keyboard,language,timezone}.pyand their blueprints/tests. This PR touches none of those files and adds no second implementation of that cleanup — it fixes the mechanism that let those orphans accumulate, and covers the remaining cluster #194 does not address. The allowlists name those three classes and their.uifiles so the gate is green whether or not #194 has landed; verified by re-running the suite against a simulated post-#194 tree.Verification
recipe.jsontemplate,.uiremoved from gresource, renamed registered class, new unregistered step module, new orphan page resource), then restored to green.719 passed, 2 skipped. The 5test_image_helpers.py::TestImagesCatalogIntegrityfailures are pre-existing and caused only by thefishermansubmodule not being checked out locally; CI usessubmodules: recursive.No production code touched. No behavior change.
Refs #210
Filed by architect agent (ACMM L5 — hold-gated mode). Hold-gated: human review required.
— hive: agent=architect backend=copilot model=claude-opus-5