diff --git a/.github/workflows/README.md b/.github/workflows/README.md index e83afebb90..85e739661c 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -53,10 +53,10 @@ flowchart TB instmake --> instgate["test-install-gate"] instpkgmgr --> instgate - qualitygate --> devenv["test-development: test-environment.yml"] + qualitygate --> devenv["test-workspace: test-workspace.yml"] mirror --> devenv - buildci --> testguide["test-guide.yml"] + buildci --> testguide["test-instructions.yml"] mirror --> testguide snprio --> donegate["done"] @@ -109,10 +109,10 @@ flowchart TB relhighest -.->|"gh workflow run"| relver["release-version.yml"] relver --> imgbuildci["images-build-ci.yml"] manual["workflow_dispatch"] --> mirrorcleanup["images-mirror-cleanup.yml"] - manual --> deploywf["test-guide.yml: run a role README Production command"] + manual --> deploywf["test-instructions.yml: run a role README Production command"] ``` Also manually dispatchable: `images-mirror-all.yml`, `images-cleanup-ci.yml`, `cleanup-stale.yml`, `update.yml`, `release-highest.yml`, `release-version.yml`, `lint.yml`, `test.yml`, `test-deploy-swarm.yml`, `test-dns.yml`, -`test-environment.yml`, `test-runner-smoke.yml`. +`test-workspace.yml`, `test-runner-smoke.yml`. diff --git a/.github/workflows/ci-orchestrator.yml b/.github/workflows/ci-orchestrator.yml index bf41921f10..aac6af39a1 100644 --- a/.github/workflows/ci-orchestrator.yml +++ b/.github/workflows/ci-orchestrator.yml @@ -37,11 +37,16 @@ on: required: false type: string default: "10" - roles_only: - description: "When 'true', skip the env-matrix test-development job." + workspace: + description: "Run the workspace test (dev-runtime image matrix). 'auto' runs it on a global scope only, 'true'/'false' force it." required: false type: string - default: "false" + default: "auto" + instructions: + description: "Run the instructions test (role README Production command). 'auto' runs it on a global scope only, 'true'/'false' force it." + required: false + type: string + default: "auto" trusted_pr: description: "True when the PR carries the maintainer '๐Ÿ›ก๏ธ Trusted' label; skips the fork-prereq wait." required: false @@ -249,15 +254,16 @@ jobs: test-install-pkgmgr: uses: ./.github/workflows/test-install-pkgmgr.yml - test-development: - if: ${{ inputs.roles_only != 'true' }} - uses: ./.github/workflows/test-environment.yml + test-workspace: + if: ${{ inputs.workspace == 'true' || (inputs.workspace == 'auto' && (inputs.whitelist == '' || inputs.whitelist == '__ALL__')) }} + uses: ./.github/workflows/test-workspace.yml needs: - images-mirror-missing secrets: inherit - test-guide: - uses: ./.github/workflows/test-guide.yml + test-instructions: + if: ${{ inputs.instructions == 'true' || (inputs.instructions == 'auto' && (inputs.whitelist == '' || inputs.whitelist == '__ALL__')) }} + uses: ./.github/workflows/test-instructions.yml needs: - images-mirror-missing - build-ci-images @@ -295,8 +301,8 @@ jobs: - test-deploy-single-node - test-deploy-swarm - test-runner-smoke - - test-development - - test-guide + - test-workspace + - test-instructions - test - lint - security-codeql diff --git a/.github/workflows/entry-manual.yml b/.github/workflows/entry-manual.yml index 661a4f2c14..f2c27f9de9 100644 --- a/.github/workflows/entry-manual.yml +++ b/.github/workflows/entry-manual.yml @@ -33,6 +33,24 @@ on: required: false default: "" type: string + workspace: + description: "Run the workspace test (dev-runtime image matrix). 'auto' runs it on a global scope only." + required: false + default: "false" + type: choice + options: + - "false" + - "true" + - "auto" + instructions: + description: "Run the instructions test (role README Production command). 'auto' runs it on a global scope only." + required: false + default: "false" + type: choice + options: + - "false" + - "true" + - "auto" permissions: contents: read @@ -51,6 +69,7 @@ jobs: lifecycles: ${{ inputs.lifecycles }} modes: ${{ inputs.modes }} priority: ${{ inputs.priority }} - roles_only: ${{ (inputs.priority != '' || (inputs.whitelist != '' && inputs.whitelist != '__ALL__')) && 'true' || 'false' }} + workspace: ${{ inputs.workspace }} + instructions: ${{ inputs.instructions }} force_cancel_in_progress: true secrets: inherit diff --git a/.github/workflows/entry-pull-request-change.yml b/.github/workflows/entry-pull-request-change.yml index 06165ea32c..fdca969346 100644 --- a/.github/workflows/entry-pull-request-change.yml +++ b/.github/workflows/entry-pull-request-change.yml @@ -102,7 +102,6 @@ jobs: runs-on: ubuntu-latest outputs: whitelist: ${{ steps.resolve.outputs.whitelist }} - roles_only: ${{ steps.resolve.outputs.roles_only }} steps: - name: โฌ‡๏ธ Checkout uses: actions/checkout@v7.0.0 @@ -138,7 +137,6 @@ jobs: with: distros: "arch debian ubuntu fedora centos" whitelist: ${{ needs.detect-affected-roles.outputs.whitelist }} - roles_only: ${{ needs.detect-affected-roles.outputs.roles_only }} trusted_pr: ${{ contains(github.event.pull_request.labels.*.name, '๐Ÿ›ก๏ธ Trusted') }} prepare-fork-merge-ref: diff --git a/.github/workflows/test-guide.yml b/.github/workflows/test-instructions.yml similarity index 91% rename from .github/workflows/test-guide.yml rename to .github/workflows/test-instructions.yml index 2437f60180..8ab0492749 100644 --- a/.github/workflows/test-guide.yml +++ b/.github/workflows/test-instructions.yml @@ -1,4 +1,4 @@ -name: "๐Ÿ“– Test: Guide" +name: "๐Ÿ“– Test: Instructions" on: workflow_call: @@ -50,7 +50,7 @@ permissions: jobs: deploy: - name: ๐Ÿ“– Guide + name: ๐Ÿ“– Instructions runs-on: ubuntu-latest timeout-minutes: 345 env: @@ -64,7 +64,7 @@ jobs: shell: bash run: grep '^INFINITO_RESCUE_DIAGNOSTICS_BASE=' default.env >> "$GITHUB_ENV" - - name: ๐Ÿ Install guide + compose deps (Act runner only) + - name: ๐Ÿ Install instructions + compose deps (Act runner only) if: ${{ env.ACT }} shell: bash run: | @@ -88,7 +88,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: ๐Ÿ“– Replay the guide across ${{ inputs.distros }} + - name: ๐Ÿ“– Replay the instructions across ${{ inputs.distros }} shell: bash run: ./scripts/tests/deploy/distros.sh scripts/github/guide/one.sh @@ -96,6 +96,6 @@ jobs: if: ${{ always() && !env.ACT }} uses: actions/upload-artifact@v7 with: - name: rescue-diagnostics-guide-${{ env.GUIDE_ROLE }} + name: rescue-diagnostics-instructions-${{ env.GUIDE_ROLE }} path: ${{ env.INFINITO_RESCUE_DIAGNOSTICS_BASE }}/ if-no-files-found: ignore diff --git a/.github/workflows/test-environment.yml b/.github/workflows/test-workspace.yml similarity index 85% rename from .github/workflows/test-environment.yml rename to .github/workflows/test-workspace.yml index 53ff3e61ed..d36ae56e5a 100644 --- a/.github/workflows/test-environment.yml +++ b/.github/workflows/test-workspace.yml @@ -1,4 +1,4 @@ -name: "๐Ÿ’ป Test: Development Environment" +name: "๐Ÿ’ป Test: Workspace" on: workflow_dispatch: @@ -11,7 +11,7 @@ permissions: jobs: prepare: - name: ๐Ÿ“‹ Environment Matrix + name: ๐Ÿ“‹ Workspace Matrix runs-on: ubuntu-latest timeout-minutes: 5 outputs: @@ -25,10 +25,10 @@ jobs: id: matrix shell: bash run: | - python3 -c 'import json, sys; from utils.distros import dev_runtime_images; images = list(dev_runtime_images()); images or sys.exit("meta/distros.yml declares no dev runtime image; an empty matrix would skip every environment job silently"); print("images=" + json.dumps(images))' | tee -a "$GITHUB_OUTPUT" + python3 -c 'import json, sys; from utils.distros import dev_runtime_images; images = list(dev_runtime_images()); images or sys.exit("meta/distros.yml declares no dev runtime image; an empty matrix would skip every workspace job silently"); print("images=" + json.dumps(images))' | tee -a "$GITHUB_OUTPUT" - test-environment: - name: ๐Ÿง‘โ€๐Ÿ’ป Environment (${{ matrix.dev_runtime_image }}) + test-workspace: + name: ๐Ÿง‘โ€๐Ÿ’ป Workspace (${{ matrix.dev_runtime_image }}) runs-on: ubuntu-latest timeout-minutes: 345 needs: prepare @@ -70,9 +70,9 @@ jobs: run: | set -euo pipefail grep '^INFINITO_RESCUE_DIAGNOSTICS_BASE=' default.env >> "$GITHUB_ENV" - echo "INFINITO_ENV_SLUG=$(printf '%s' "${DEV_RUNTIME_IMAGE}" | tr '/:' '--')" >> "$GITHUB_ENV" + echo "INFINITO_WORKSPACE_SLUG=$(printf '%s' "${DEV_RUNTIME_IMAGE}" | tr '/:' '--')" >> "$GITHUB_ENV" - - name: โ–ถ๏ธ Run dev environment routine + - name: โ–ถ๏ธ Run workspace routine shell: bash run: | set -euo pipefail @@ -111,15 +111,15 @@ jobs: timeout-minutes: 15 shell: bash env: - INFINITO_RESCUE_DIAGNOSTICS_DIR: ${{ env.INFINITO_RESCUE_DIAGNOSTICS_BASE }}/${{ env.INFINITO_ENV_SLUG }} + INFINITO_RESCUE_DIAGNOSTICS_DIR: ${{ env.INFINITO_RESCUE_DIAGNOSTICS_BASE }}/${{ env.INFINITO_WORKSPACE_SLUG }} run: | python3 utils/diagnostics/container.py \ - "${INFINITO_ENV_SLUG}" "environment suite failure" || true + "${INFINITO_WORKSPACE_SLUG}" "workspace suite failure" || true - name: โฌ†๏ธ Upload rescue diagnostics if: always() uses: actions/upload-artifact@v7 with: - name: rescue-diagnostics-environment-${{ env.INFINITO_ENV_SLUG }} + name: rescue-diagnostics-workspace-${{ env.INFINITO_WORKSPACE_SLUG }} path: ${{ env.INFINITO_RESCUE_DIAGNOSTICS_BASE }}/ if-no-files-found: ignore diff --git a/cli/meta/ci/subset_roles.py b/cli/meta/ci/subset_roles.py index 86a494cd9c..eee5571b13 100644 --- a/cli/meta/ci/subset_roles.py +++ b/cli/meta/ci/subset_roles.py @@ -8,8 +8,8 @@ grants maintainers, which forks cannot trigger. It reads the PR body from ``$PR_BODY``, extracts the first fenced code block whose YAML defines a ``roles:`` list, validates that every listed id is an existing ``roles/`` directory, and writes ``whitelist`` (space-separated) -and ``roles_only=true`` to ``$GITHUB_OUTPUT`` -- the same outputs the -diff-derived resolver produces. +to ``$GITHUB_OUTPUT`` -- the same output the diff-derived resolver +produces. Unlike the fail-safe diff resolver (which widens to ``__ALL__`` on any problem), the subset path is strict: invalid YAML, a missing/empty ``roles:`` @@ -95,7 +95,6 @@ def main() -> None: if github_output: with Path(github_output).open("a", encoding="utf-8") as handle: handle.write(f"whitelist={whitelist}\n") - handle.write("roles_only=true\n") if __name__ == "__main__": diff --git a/docs/agents/action/iteration/workflow.md b/docs/agents/action/iteration/workflow.md index b1aace61b9..f7c19f041c 100644 --- a/docs/agents/action/iteration/workflow.md +++ b/docs/agents/action/iteration/workflow.md @@ -17,7 +17,7 @@ For the swarm deploy loop, see [Swarm Loop](swarm.md). - If the workflow uses a distro matrix, you MUST iterate on one distro at a time instead of rerunning the whole matrix during the default debug loop. - Debian SHOULD be the preferred distro for that focused workflow iteration unless the failure is clearly distro-specific or the user asked for a different distro. - When you constrain an Act matrix run through `ACT_MATRIX`, you MUST use Act's `key:value` syntax instead of `key=value`. Otherwise Act may ignore the filter and rerun the whole matrix. -- For `.github/workflows/test-environment.yml`, the preferred focused Debian example is `make act-workflow ACT_WORKFLOW=.github/workflows/test-environment.yml ACT_JOB=test-environment ACT_MATRIX="dev_runtime_image:$(python3 -c 'from utils.distros import dev_runtime_image; print(dev_runtime_image("debian"))')"`. +- For `.github/workflows/test-workspace.yml`, the preferred focused Debian example is `make act-workflow ACT_WORKFLOW=.github/workflows/test-workspace.yml ACT_JOB=test-workspace ACT_MATRIX="dev_runtime_image:$(python3 -c 'from utils.distros import dev_runtime_image; print(dev_runtime_image("debian"))')"`. - You SHOULD avoid jumping straight to repeated remote CI reruns when `make act-workflow` can validate the workflow locally and the user agreed to use it. ## Recovery & gotchas diff --git a/docs/contributing/artefact/git/pipeline.md b/docs/contributing/artefact/git/pipeline.md index f2acfa64e1..78c4fdd5e2 100644 --- a/docs/contributing/artefact/git/pipeline.md +++ b/docs/contributing/artefact/git/pipeline.md @@ -101,7 +101,7 @@ roles: ``` ```` -With the label set, the `detect-affected-roles` job in [entry-pull-request-change.yml](../../../../.github/workflows/entry-pull-request-change.yml) calls [pr_affected_roles.sh](../../../../scripts/github/resolve/pr_affected_roles.sh), which runs the [cli.meta.ci.subset_roles](../../../../cli/meta/ci/subset_roles.py) module. The module reads the first fenced block whose YAML carries a `roles:` key (the heading text is not matched) and emits that list as the `whitelist` output with `roles_only=true`, which flows into the deploy tests as precedence rung 2 above. Without the label, the diff-driven precedence applies. +With the label set, the `detect-affected-roles` job in [entry-pull-request-change.yml](../../../../.github/workflows/entry-pull-request-change.yml) calls [pr_affected_roles.sh](../../../../scripts/github/resolve/pr_affected_roles.sh), which runs the [cli.meta.ci.subset_roles](../../../../cli/meta/ci/subset_roles.py) module. The module reads the first fenced block whose YAML carries a `roles:` key (the heading text is not matched) and emits that list as the `whitelist` output, which flows into the deploy tests as precedence rung 2 above. Without the label, the diff-driven precedence applies. The subset path fails the run when: @@ -118,7 +118,7 @@ The install-test workflows listed in the `Infrastructure tests` table of [workfl ### 11. Development Environment ๐Ÿ› ๏ธ -The `test-development` stage runs the development-environment workflow listed in the `Infrastructure tests` table of [workflows.md](../../tools/github/actions/workflows.md). +The `test-workspace` stage runs the workspace workflow listed in the `Infrastructure tests` table of [workflows.md](../../tools/github/actions/workflows.md). ### 12. Done ๐Ÿ diff --git a/docs/contributing/tools/github/actions/workflows.md b/docs/contributing/tools/github/actions/workflows.md index 268ad66180..d773101ccd 100644 --- a/docs/contributing/tools/github/actions/workflows.md +++ b/docs/contributing/tools/github/actions/workflows.md @@ -35,7 +35,7 @@ Trigger column legend: **auto** = fires automatically (push, pull_request, sched | Workflow | Description | Trigger | Inputs | |---|---|---|---| -| [ci-orchestrator.yml](../../../../../.github/workflows/ci-orchestrator.yml): `๐ŸŽต CI: Orchestrator` | Central coordinator. Runs fork-prereq wait, security, linting, CI image build, code tests, code-quality gate, DNS tests, mirror, deploy tests (optionally split into a priority line and a regular line via `priority`; each mode's discover job renders its own plan table via `cli.meta.ci.plan` into the run summary), install tests, development-environment test, `test-guide`, final `done` gate. | reusable | `distros` (default `arch debian ubuntu fedora centos`), `whitelist` (optional), `priority` (optional; app ids deployed first per mode, then excluded from the regular line, which only starts after every priority job succeeded), `image_wait_attempts` (default `1980`), `image_wait_sleep_seconds` (default `10`) | +| [ci-orchestrator.yml](../../../../../.github/workflows/ci-orchestrator.yml): `๐ŸŽต CI: Orchestrator` | Central coordinator. Runs fork-prereq wait, security, linting, CI image build, code tests, code-quality gate, DNS tests, mirror, deploy tests (optionally split into a priority line and a regular line via `priority`; each mode's discover job renders its own plan table via `cli.meta.ci.plan` into the run summary), install tests, `test-workspace`, `test-instructions`, final `done` gate. | reusable | `distros` (default `arch debian ubuntu fedora centos`), `whitelist` (optional), `priority` (optional; app ids deployed first per mode, then excluded from the regular line, which only starts after every priority job succeeded), `image_wait_attempts` (default `1980`), `image_wait_sleep_seconds` (default `10`), `workspace` (default `auto`), `instructions` (default `auto`) | ### Security and linting ๐Ÿ›ก๏ธ๐Ÿ” @@ -74,10 +74,10 @@ Trigger column legend: **auto** = fires automatically (push, pull_request, sched | [test-deploy-compose.yml](../../../../../.github/workflows/test-deploy-compose.yml): `๐Ÿ“ฆ Test: Deploy (compose)` | Deploy test (compose mode) across all deployment types (`INFINITO_DISCOVER_ALL`; lifecycle-filtered to the `INFINITO_LIFECYCLES` envelope, so `server`/`universal`/`workstation` scopes but not just `web-*`). When `whitelist` is empty, the discover job derives one from the branch's diff vs `origin/main`; see the "Diff-driven app selection" subsection in [pipeline.md](../../../artefact/git/pipeline.md). | reusable | `distros` (required), `whitelist` (optional; explicit value wins over diff), `lifecycles`, `blacklist` (optional) | | [test-deploy-host.yml](../../../../../.github/workflows/test-deploy-host.yml): `๐Ÿ–ฅ๏ธ Test: Deploy (host)` | Deploy test (host mode) for invokable non-stack roles that configure the host instead of shipping a container stack. Same diff-driven whitelist resolution as `test-deploy-compose.yml`; no Playwright stage (host roles have no web UI). | reusable | `distros` (required), `whitelist` (optional; explicit value wins over diff), `lifecycles`, `blacklist` (optional) | | [test-deploy-swarm.yml](../../../../../.github/workflows/test-deploy-swarm.yml): `๐Ÿ Test: Deploy (swarm)` | Deploy test (swarm mode) across the full application matrix; each app gets a simulated 3-node DinD cluster with an NFS server, then a drain/reschedule state-survival assertion. Same diff-driven whitelist resolution as `test-deploy-compose.yml`. | reusable, manual | `whitelist` (optional; explicit value wins over diff), `lifecycles`, `blacklist` (optional; reusable trigger only) | -| [test-guide.yml](../../../../../.github/workflows/test-guide.yml): `๐Ÿ“– Test: Guide` | Extracts the `### Production` command from a role README (default `svc-db-postgres`) and executes it against the runner: `` becomes `localhost` (ansible_connection local) and the Docker socket replaces the TTY flag. Verifies the documented one-command deploy actually works, seeding the runยดs freshly built CI image (needs `images-build-ci.yml`) instead of the published default. Gates the final `done` job. | reusable, manual | `role` (default `svc-db-postgres`) | +| [test-instructions.yml](../../../../../.github/workflows/test-instructions.yml): `๐Ÿ“– Test: Instructions` | Extracts the `### Production` command from a role README (default `svc-db-postgres`) and executes it against the runner: `` becomes `localhost` (ansible_connection local) and the Docker socket replaces the TTY flag. Verifies the documented one-command deploy actually works, seeding the runยดs freshly built CI image (needs `images-build-ci.yml`) instead of the published default. Gates the final `done` job. | reusable, manual | `role` (default `svc-db-postgres`) | | [test-install-make.yml](../../../../../.github/workflows/test-install-make.yml): `๐Ÿ“ฅ Test: Install Make` | Validates the `make install` entry points. | reusable | none | | [test-install-pkgmgr.yml](../../../../../.github/workflows/test-install-pkgmgr.yml): `๐Ÿ“ฅ Test: Install Package Manager` | Validates installation via the upstream package manager. | reusable | none | -| [test-environment.yml](../../../../../.github/workflows/test-environment.yml): `๐Ÿ’ป Test: Development Environment` | Builds and exercises the dev-runtime image matrix. | reusable, manual | none | +| [test-workspace.yml](../../../../../.github/workflows/test-workspace.yml): `๐Ÿ’ป Test: Workspace` | Builds and exercises the dev-runtime image matrix. | reusable, manual | none | ### Release and maintenance ๐Ÿš€๐Ÿ”„ diff --git a/scripts/github/resolve/pr_affected_roles.sh b/scripts/github/resolve/pr_affected_roles.sh index 41f40a197f..d485039691 100755 --- a/scripts/github/resolve/pr_affected_roles.sh +++ b/scripts/github/resolve/pr_affected_roles.sh @@ -1,9 +1,9 @@ #!/usr/bin/env bash # # Resolve the role whitelist for a pull-request CI run and write -# `whitelist` + `roles_only` to GITHUB_OUTPUT. This is the single -# entry point the `detect-affected-roles` job calls; it keeps the -# subset-vs-diff selection logic out of the workflow YAML. +# `whitelist` to GITHUB_OUTPUT. This is the single entry point the +# `detect-affected-roles` job calls; it keeps the subset-vs-diff +# selection logic out of the workflow YAML. # # Inputs via env: # SUBSET_LABELED "true" when the PR carries the '๐Ÿงฉ Subset' label. @@ -16,7 +16,6 @@ # # Outputs (GITHUB_OUTPUT): # whitelist= -# roles_only= set -euo pipefail @@ -31,8 +30,4 @@ fi resolved="$(./scripts/meta/resolve/diff/affected_roles.sh)" echo "Resolver output: ${resolved}" -if [[ "${resolved}" == "__ALL__" ]]; then - printf 'whitelist=__ALL__\nroles_only=false\n' >>"${GITHUB_OUTPUT}" -else - printf 'whitelist=%s\nroles_only=true\n' "${resolved}" >>"${GITHUB_OUTPUT}" -fi +printf 'whitelist=%s\n' "${resolved}" >>"${GITHUB_OUTPUT}" diff --git a/scripts/tests/deploy/act/workflow.sh b/scripts/tests/deploy/act/workflow.sh index 867213fd6c..1e15e4fb69 100755 --- a/scripts/tests/deploy/act/workflow.sh +++ b/scripts/tests/deploy/act/workflow.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -: "${ACT_WORKFLOW:?ACT_WORKFLOW is not set (e.g. .github/workflows/test-environment.yml)}" +: "${ACT_WORKFLOW:?ACT_WORKFLOW is not set (e.g. .github/workflows/test-workspace.yml)}" : "${ACT_EVENT:=workflow_dispatch}" : "${ACT_JOB:=}" : "${ACT_MATRIX:=}" diff --git a/tests/integration/meta/workflows/test_subset_roles.py b/tests/integration/meta/workflows/test_subset_roles.py index a6eb36a682..e2090f4eed 100644 --- a/tests/integration/meta/workflows/test_subset_roles.py +++ b/tests/integration/meta/workflows/test_subset_roles.py @@ -52,7 +52,6 @@ class TestSubsetRoles(unittest.TestCase): result, outputs = self._run(body) self.assertEqual(result.returncode, 0, result.stderr) self.assertEqual(outputs["whitelist"], " ".join(REAL_ROLES)) - self.assertEqual(outputs["roles_only"], "true") def test_invalid_yaml_fails(self): body = "```yaml\nroles:\n - web-app-nextcloud\n bad: : :\n```\n" diff --git a/tests/lint/repository/test_distros_spot.py b/tests/lint/repository/test_distros_spot.py index 60a62d75ed..6617a9e037 100644 --- a/tests/lint/repository/test_distros_spot.py +++ b/tests/lint/repository/test_distros_spot.py @@ -37,7 +37,7 @@ from utils.env.parser import parse_static_env from . import PROJECT_ROOT WORKFLOWS_DIR = PROJECT_ROOT / ".github" / "workflows" -ENVIRONMENT_WORKFLOW = WORKFLOWS_DIR / "test-environment.yml" +WORKSPACE_WORKFLOW = WORKFLOWS_DIR / "test-workspace.yml" _MATRIX_REF_RE = re.compile( r"^\$\{\{\s*fromJson\(\s*needs\.([\w-]+)\.outputs\.([\w-]+)\s*\)\s*\}\}$", re.IGNORECASE, @@ -101,24 +101,24 @@ class TestDistrosSpot(unittest.TestCase): f"(expected {self.expected!r}):\n{body}" ) - def test_environment_matrix_matches_spot(self) -> None: + def test_workspace_matrix_matches_spot(self) -> None: """The matrix is an expression, so the pin walks the wiring from the axis to the resolver step, runs that step the way the runner does and compares what it writes to ``GITHUB_OUTPUT`` against the SPOT.""" - jobs = load_yaml_any(str(ENVIRONMENT_WORKFLOW), default_if_missing={})["jobs"] - consumer = jobs["test-environment"] + jobs = load_yaml_any(str(WORKSPACE_WORKFLOW), default_if_missing={})["jobs"] + consumer = jobs["test-workspace"] axis = consumer["strategy"]["matrix"]["dev_runtime_image"] ref = _MATRIX_REF_RE.match(str(axis)) self.assertIsNotNone( ref, - f"test-environment.yml must derive its matrix from {FILE_META_DISTROS} " + f"test-workspace.yml must derive its matrix from {FILE_META_DISTROS} " f"via fromJson(needs..outputs.), got {axis!r}.", ) resolver_id, output_name = ref.groups() self.assertIn( resolver_id, consumer.get("needs", ()), - f"job 'test-environment' consumes {resolver_id!r} without needing it.", + f"job 'test-workspace' consumes {resolver_id!r} without needing it.", ) resolver = jobs[resolver_id] published = resolver.get("outputs", {}).get(output_name)