diff --git a/.github/workflows/workspace-validation.yml b/.github/workflows/workspace-validation.yml index c63a738c..d2e490c3 100644 --- a/.github/workflows/workspace-validation.yml +++ b/.github/workflows/workspace-validation.yml @@ -117,6 +117,7 @@ jobs: [autofit_test]=autofit_workspace_test [autogalaxy_test]=autogalaxy_workspace_test [autolens_test]=autolens_workspace_test [howtogalaxy]=HowToGalaxy [howtolens]=HowToLens [howtofit]=HowToFit + [euclid]=euclid_strong_lens_modeling_pipeline ) for proj in "${!WS[@]}"; do git clone --depth 1 "https://github.com/PyAutoLabs/${WS[$proj]}" "$proj" @@ -129,11 +130,11 @@ jobs: # mode=release scopes to workspace + workspace_test only (per the M3 # spec) — HowTo* are tutorial repos with no profile_release.yaml and # aren't part of the release-fidelity surface. mode=smoke keeps the - # full 9-project sweep, unchanged. + # full workspace/tutorial sweep plus the Euclid pipeline. if [ "$MODE" = "release" ]; then PROJECTS="autofit autogalaxy autolens autofit_test autogalaxy_test autolens_test" else - PROJECTS="autofit autogalaxy autolens autofit_test autogalaxy_test autolens_test howtogalaxy howtolens howtofit" + PROJECTS="autofit autogalaxy autolens autofit_test autogalaxy_test autolens_test howtogalaxy howtolens howtofit euclid" fi matrix="$(python3 PyAutoHands/autohands/script_matrix.py $PROJECTS)" echo "matrix=$matrix" >> "$GITHUB_OUTPUT" @@ -215,6 +216,7 @@ jobs: howtogalaxy) echo "repo=HowToGalaxy" >> "$GITHUB_OUTPUT" ;; howtolens) echo "repo=HowToLens" >> "$GITHUB_OUTPUT" ;; howtofit) echo "repo=HowToFit" >> "$GITHUB_OUTPUT" ;; + euclid) echo "repo=euclid_strong_lens_modeling_pipeline" >> "$GITHUB_OUTPUT" ;; *) echo "repo=autolens_workspace_test" >> "$GITHUB_OUTPUT" ;; esac - name: Checkout workspace @@ -473,10 +475,10 @@ jobs: python-version: ["3.12"] project: ${{ fromJSON(needs.find_scripts.outputs.matrix) }} steps: - - name: Gate (*_test workspaces have no notebooks) + - name: Gate (test workspaces and pipelines have no notebook sweep) id: gate run: | - if [[ "${{ matrix.project.name }}" == *_test ]]; then + if [[ "${{ matrix.project.name }}" == *_test || "${{ matrix.project.name }}" == euclid ]]; then echo "run=false" >> "$GITHUB_OUTPUT" else echo "run=true" >> "$GITHUB_OUTPUT" diff --git a/config/repos.yaml b/config/repos.yaml index 9f5e317f..85480127 100644 --- a/config/repos.yaml +++ b/config/repos.yaml @@ -103,6 +103,7 @@ repos: # finding never gates a release, so a green `url_check` cannot mask a red # `smoke_tests`. required_workflows: + pipelines: ["Smoke Tests"] # pipeline smoke gates libraries: ["Tests"] # main.yml (pytest, 3.12 + 3.13) workspaces: ["Smoke Tests", "Navigator Check"] # smoke_tests.yml + navigator_check.yml workspaces_test: ["Smoke Tests"] # smoke_tests.yml diff --git a/heart/readiness.py b/heart/readiness.py index 2c304c49..30bf266a 100644 --- a/heart/readiness.py +++ b/heart/readiness.py @@ -109,7 +109,7 @@ # (see config/repos.yaml `required_workflows`). A red `smoke_tests` on a # workspace's main is a real release blocker — a green `url_check` cannot mask # it because url is not a required workflow. -GATED_WORKSPACE_GROUPS = frozenset({"workspaces", "workspaces_test", "howto"}) +GATED_WORKSPACE_GROUPS = frozenset({"workspaces", "workspaces_test", "howto", "pipelines"}) # gate key -> (penalty per occurrence, cap). Score = 100 - sum(min(n*w, cap)). # Advisory only; colour is decided by reason presence, not by score. diff --git a/tests/test_readiness.py b/tests/test_readiness.py index 07fc3b4c..0c39ac14 100644 --- a/tests/test_readiness.py +++ b/tests/test_readiness.py @@ -1174,3 +1174,15 @@ def test_release_ci_profile_files_no_details_for_out_of_scope_evidence(): assert not any(d["key"] == "test_unknown" for d in v["stale_details"]) assert any("test run status unknown" in r for r in v["na_reasons"]) + + +@pytest.mark.parametrize("conclusion, expected", [("success", "green"), ("failure", "red")]) +def test_pipeline_required_smoke_gates_release(conclusion, expected): + snap = make_snapshot() + snap["repos"]["PipelineA"] = { + "ci_status": _ws_ci("pipelines", **{"Smoke Tests": conclusion}) + } + verdict = compute(snap) + assert verdict["verdict"] == expected + if expected == "red": + assert "PipelineA: Smoke Tests failure on main" in verdict["red_reasons"] diff --git a/tests/test_workflow_wiring.py b/tests/test_workflow_wiring.py index f05673b1..7e0bc5e8 100644 --- a/tests/test_workflow_wiring.py +++ b/tests/test_workflow_wiring.py @@ -370,3 +370,28 @@ def test_release_fft_workaround_preserves_flags_and_is_scoped_to_release(tmp_pat cwd=tmp_path, env=env, capture_output=True, text=True, check=True, ) assert result.stdout == ((existing + " ") if existing else "") + "--xla_cpu_multi_thread_eigen=false" + + +def test_pipeline_is_selected_for_smoke_and_routes_to_its_checkout(tmp_path): + import os + import subprocess + + data = _load("workspace-validation.yml") + steps = data["jobs"]["find_scripts"]["steps"] + command = next(s["run"] for s in steps if s.get("id") == "script_matrix") + stub = tmp_path / "PyAutoHands/autohands/script_matrix.py" + stub.parent.mkdir(parents=True) + stub.write_text("import sys; print(' '.join(sys.argv[1:]))") + output = tmp_path / "output" + for mode, expected in [("smoke", True), ("release", False)]: + output.write_text("") + subprocess.run(["bash", "-ec", command], cwd=tmp_path, + env={**os.environ, "MODE": mode, "GITHUB_OUTPUT": str(output)}, check=True) + assert ("euclid" in output.read_text().split()) is expected + route = next(s["run"] for s in data["jobs"]["run_scripts"]["steps"] if s.get("id") == "ws") + route = route.replace("${{ matrix.project.name }}", "euclid") + output.write_text("") + subprocess.run(["bash", "-ec", route], env={**os.environ, "GITHUB_OUTPUT": str(output)}, check=True) + registry = yaml.safe_load((WORKFLOWS.parents[1] / "config/repos.yaml").read_text()) + pipeline = registry["repos"]["pipelines"][0]["name"] + assert output.read_text().strip() == f"repo={pipeline}"