mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-09 12:17:13 +00:00
The replay of a role's "### Production" block moves out of the CI guide
scripts and into the documentation role itself. The block is read off the
rendered page over HTTP, so what runs is what a reader copies, and the role
that publishes the page is also the role that proves it.
scripts/github/guide/{one,compose_deploy,host_deploy}.sh and
cli/build/docs/readme/production.py are gone with the workflow step that
called them. The instructions marker now only adds web-app-docs to the row's
apps; test-e2e-cli discovers the role through its new templates/test.env.j2
and runs files/test/test.sh.
The block runs in a throwaway machine, never on the stack host. compose.yml
starts one service built from files/test/Dockerfile, whose base is
INFINITO_PARENT_IMAGE out of the mounted checkout's .env, so the machine is
the stack host's own distribution and the replay exercises the installation
instead of a prebuilt image. files/test/init.sh adds an init when the base
carries none and keeps the full -Syu that ef0f03ea98 established for arch.
scripts/tests/workspace/base/01_install.sh then prepares the machine before
the block runs.
Nothing is skipped any more. The previous host-install branch exited 0 and
passed silently over 65 of the 178 invokable roles; a block without a
"docker run" is now replayed against systemd in that same machine, with the
git clone dropped in favour of the mounted tree under test.
The target role comes from the new guide_role lookup, which reads
list_invokable_app_ids() rather than matching role-name prefixes, and falls
back to the asking role when the round deploys nothing else. deployment.py
grows running_apps() so both lookups share one definition of what the round
deploys. required_by_coverage.role_is_invokable drops its own walk over
categories.yml and delegates to the same SPOT; measured equal across all 280
roles.
Carried in the same index, because the refactor pass ran over this change
set: library.py splits into sites.py and build_queue.py mixins, builder.py
hands translated_languages to catalogs.py and folds three repeated log-tail
and state writes, and placeholders.py becomes a facade over spans.py,
repairs.py and damage.py. No test changed for those splits, and the two
ref-resolution dicts builder.py carried are replaced by _wanted_ref, which
also stops hashing the deployed tree on every tag build.
Verified: 7132 unit and lint tests pass over the whole tree, the guide_role
lookup renders through a real Templar, the base image resolves from .env,
and compose config validates the service. The replay itself has never been
executed; that needs a deploy of web-app-docs.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
63 lines
2.6 KiB
Python
63 lines
2.6 KiB
Python
"""SPOT for development inventory creation.
|
|
|
|
Anything that wants to materialise the development inventory MUST go
|
|
through :func:`build_dev_inventory` (single folder) or
|
|
:func:`build_dev_inventory_matrix` (one folder per matrix-deploy round).
|
|
Both flow through :class:`~.spec.DevInventorySpec` and own:
|
|
|
|
* the SPOT vars-file (``DEV_INVENTORY_VARS_FILE``),
|
|
* per-app variant baking (each role's ``meta/variants.yml`` is resolved
|
|
at build time and emitted as ``applications.<app>`` overrides into
|
|
the inventory's ``host_vars``, with variant 0 as the fallback for
|
|
every role that is not a primary in the current matrix round),
|
|
* the vault password file.
|
|
|
|
The deploy wrapper consumes :func:`plan_dev_inventory_matrix` to know
|
|
which folder to deploy against in each round; the planner is a pure
|
|
function so wrapper and init step compute the same plan independently.
|
|
|
|
Internal layout (one module per responsibility):
|
|
|
|
* :mod:`.spec` — :class:`~.spec.DevInventorySpec` + ``PlanEntry`` type
|
|
* :mod:`.payload` — variant payload pick + ``--vars`` bake
|
|
* :mod:`.legacy_resolver` — ``CombinedResolver``-driven include resolution
|
|
* :mod:`.planner` — :func:`plan_dev_inventory_matrix`
|
|
* :mod:`.builder` — :func:`build_dev_inventory` + matrix orchestrator
|
|
|
|
The private helpers (``_resolve_round_include`` and friends) are
|
|
re-exported below because unit tests historically patch them under this
|
|
package path. New tests SHOULD patch the submodule path directly
|
|
(e.g. ``inventory.legacy_resolver._resolve_round_include``).
|
|
|
|
``DevInventorySpec`` is imported but deliberately absent from ``__all__``:
|
|
listing a re-exported class makes autodoc document it here as well as in
|
|
:mod:`.spec`, and sphinx then finds two targets for every annotation. Importing
|
|
it from this package keeps working either way.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from .builder import build_dev_inventory, build_dev_inventory_matrix
|
|
from .legacy_resolver import (
|
|
_build_services_overrides_for_round,
|
|
_resolve_round_include,
|
|
prune_orphans_after_disable,
|
|
)
|
|
from .payload import _bake_overrides, _resolve_variant_payloads
|
|
from .planner import filter_plan_to_variants, plan_dev_inventory_matrix
|
|
from .spec import DevInventorySpec as DevInventorySpec
|
|
from .spec import PlanEntry
|
|
|
|
__all__ = [
|
|
"PlanEntry",
|
|
"_bake_overrides",
|
|
"_build_services_overrides_for_round",
|
|
"_resolve_round_include",
|
|
"_resolve_variant_payloads",
|
|
"build_dev_inventory",
|
|
"build_dev_inventory_matrix",
|
|
"filter_plan_to_variants",
|
|
"plan_dev_inventory_matrix",
|
|
"prune_orphans_after_disable",
|
|
]
|