Files
computer-playbook/scripts/github/resolve/manual_distros.sh
T
kevinveenbirkenbachandClaude Opus 5 3883d73c43 feat(ci): retrigger reproduces the source run
The REST API answers inputs: null for a finished workflow_dispatch, so
the run name is the only record of what a manual run was dispatched
with. It carried one value, distros; everything else silently fell back
to the workflow defaults, and a failure that only reproduces on swarm
with btrfs came back green from a run that deployed all three modes on
whatever filesystem it drew.

Render every input as its own <emoji><value> segment instead, omitted
when it holds its default, so the title carries exactly what deviates
and an absent input means 'leave it on the default'. run_name derives
those segments from the workflow rather than knowing them, so the format
cannot drift away from the parser without a failing test.

distros no longer defaults to debian -- empty draws one at random, the
way untagged pushes already do. That leaves nothing in the title, so the
effective list is recovered from the discover job names, matched by
content against the meta/distros.yml SPOT rather than by job-name shape.

Priority roles that fell behind the budget cut in every mode hold no job
at all, so failed_roles cannot see them: they are neither green nor red,
they never ran. Carry them along or they never deploy.

--run now resolves before the selection, so it reproduces a run whatever
picks the roles, not only with --failed.

tests/utils/ci_*.py move into tests/utils/ci/ -- two files sharing a
delimiter-bounded prefix are a folder in disguise, and the structure
lint says so.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-06 10:47:40 +02:00

33 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
#
# Resolve the distro list a manual CI run sweeps and write it to GITHUB_OUTPUT.
# A caller-supplied list is used verbatim; an empty one picks a single distro
# at random, the same way scripts/github/resolve/pick_distro.sh does for
# untagged pushes. The distro set comes from INFINITO_DISTROS, which the env
# layer generates from the meta/distros.yml SPOT.
#
# Param:
# INPUT_DISTROS caller-supplied space-separated distro list; empty randomises
# GITHUB_OUTPUT file the resolved `distros=<value>` is appended to
set -euo pipefail
: "${GITHUB_OUTPUT:?Missing GITHUB_OUTPUT}"
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
# shellcheck source=scripts/meta/env/load.sh
source "${REPO_ROOT}/scripts/meta/env/load.sh"
: "${INFINITO_DISTROS:?INFINITO_DISTROS must be resolved by scripts/meta/env/load.sh}"
input="${INPUT_DISTROS:-}"
if [[ -n "${input//[[:space:]]/}" ]]; then
distros="${input}"
echo "🎯 Caller-supplied distros: ${distros}"
else
read -r -a all_distros <<<"${INFINITO_DISTROS}"
distros="$(printf '%s\n' "${all_distros[@]}" | shuf -n 1)"
echo "🎲 No distros requested → picked at random: ${distros}"
fi
printf 'distros=%s\n' "${distros}" >>"${GITHUB_OUTPUT}"