Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/workspace-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions config/repos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion heart/readiness.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 12 additions & 0 deletions tests/test_readiness.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
25 changes: 25 additions & 0 deletions tests/test_workflow_wiring.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Loading