Files
computer-playbook/cli/administration/deploy/development/common.py
T
kevinveenbirkenbachandClaude Opus 4.8 2f9a54cea7 fix(deploy): honor variants in include resolution
Inventory include sets ignored the active variant: swarm
derive_includes walked the variant-free base config (dynamic service
flags count as enabled) and the compose CombinedResolver followed
run_after as an include edge. Providers a variant pins to false
(e.g. mobilizon variant 1 sso) were still deployed.

- derive_includes: swap every app listed in INFINITO_APP_VARIANTS to
  its variant config, index 0 included (nextcloud variant 0 disables
  11 partner services)
- CombinedResolver: follow_run_after flag; include resolution passes
  False so run_after stays a pure ordering hint
- drop dead deps.py chain (resolve_deploy_ids_for_*) and unused
  resolve_with_edges; rewiring them would resurrect variant-blind
  run_after-following includes
- inventory.md: document the real include pipeline and
  is_explicit_truth semantics

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-04 03:21:56 +02:00

42 lines
1.1 KiB
Python

"""Shared helpers for the development deploy CLI.
``DEV_INVENTORY_VARS_FILE`` mirrors ``INFINITO_INVENTORY_VARS_FILE``
from ``default.env``; the pairing is drift-guarded.
"""
from __future__ import annotations
import os
from typing import TYPE_CHECKING
from . import PROJECT_ROOT
from .env import resolve_distro
if TYPE_CHECKING:
from .compose import Compose
DEV_INVENTORY_VARS_FILE: str = (
os.environ.get("INFINITO_INVENTORY_VARS_FILE")
or "inventories/development/default.yml"
)
def resolve_container() -> str:
"""Return INFINITO_CONTAINER; raise SystemExit if unset."""
container = os.environ["INFINITO_CONTAINER"].strip()
if not container:
raise SystemExit(
"INFINITO_CONTAINER is not set. Run 'make dotenv' (or source scripts/meta/env/load.sh) "
"before invoking cli.administration.deploy.development."
)
return container
def make_compose() -> Compose:
from .compose import Compose
distro = resolve_distro()
resolve_container()
return Compose(repo_root=PROJECT_ROOT, distro=distro)