From 8fcf013768902432cf6116b92646aa99caf31728 Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Thu, 23 Jul 2026 17:22:41 +0100 Subject: [PATCH] feat: accept both profile names in workflows (#161 step 6, stage 1) workspace-validation.yml release step prefers profile_release.yaml and falls back to legacy env_vars_release.yaml; the reusable smoke workflow's strict validate step fires on either name. Docs/skills text updated to the canonical names with a single legacy note each. Merge before the stage-2 workspace rename PRs. Co-Authored-By: Claude Fable 5 --- .github/workflows/smoke-tests.yml | 7 +++++-- .github/workflows/workspace-validation.yml | 23 +++++++++++++++------- docs/release_validation.md | 9 +++++---- skills/smoke_test/SKILL.md | 5 +++-- skills/smoke_test/reference.md | 3 ++- 5 files changed, 31 insertions(+), 16 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index cae376e..ec37cea 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -91,11 +91,14 @@ jobs: # in seconds instead of in the next nightly. Workspaces without a # release profile (user workspaces, HowTo*) are skipped. run: | - if [ -f workspace/config/build/env_vars_release.yaml ]; then + # Fire if the workspace carries a release profile under either name: + # canonical profile_release.yaml (PyAutoHands#161/#181 step 6 rename) + # or legacy env_vars_release.yaml. The validator resolves both names. + if [ -f workspace/config/build/profile_release.yaml ] || [ -f workspace/config/build/env_vars_release.yaml ]; then python PyAutoHands/autohands/validate_env_profiles.py workspace \ --strict-derivation --strict-markers else - echo "No config/build/env_vars_release.yaml — profile validation skipped." + echo "No config/build/profile_release.yaml — profile validation skipped." fi - name: Run smoke tests diff --git a/.github/workflows/workspace-validation.yml b/.github/workflows/workspace-validation.yml index 021b9f7..8b15d67 100644 --- a/.github/workflows/workspace-validation.yml +++ b/.github/workflows/workspace-validation.yml @@ -6,7 +6,8 @@ name: Workspace Validation # mode=smoke (default — schedule / bare workflow_dispatch / workflow_call) # Runs every workspace's scripts AND generated notebooks against the # CURRENT source `main` of the 5 libraries (source-shadowed via PYTHONPATH, -# under the `smoke` env profile — config/build/env_vars.yaml). Unchanged by +# under the `smoke` env profile — config/build/profile_smoke.yaml, legacy +# env_vars.yaml accepted during migration). Unchanged by # M3 — this remains the continuous readiness signal / weekly sweep, and # `test_run`/`readiness` keep reading its conclusion the same way. # @@ -19,7 +20,8 @@ name: Workspace Validation # still run FROM WITHIN each workspace checkout so autonerves resolves the # workspace's own config/ + dataset/, not the wheel's packaged defaults # (closes Gap 4). Uses the `release` env profile — each workspace/ -# workspace_test repo's config/build/env_vars_release.yaml — which is +# workspace_test repo's config/build/profile_release.yaml (legacy +# env_vars_release.yaml accepted during migration) — which is # PYAUTO_TEST_MODE=1 (reduced, real sampler) + SMALL_DATASETS=1 + # FAST_PLOTS=1 for user workspaces, PYAUTO_TEST_MODE=0 (real searches, # each script's own n_like_max caps) + full-res + real plots for @@ -80,7 +82,8 @@ env: # Workspace pins lag the libraries' source __version__ between releases; # without this every script fails fast with WorkspaceVersionMismatchError. # Same bypass run_scripts uses in release.yml. mode=release also carries this - # in env_vars_release.yaml (the TestPyPI dev version never matches the + # in profile_release.yaml (legacy env_vars_release.yaml accepted during + # migration; the TestPyPI dev version never matches the # workspace pin either) — belt and braces. PYAUTO_SKIP_WORKSPACE_VERSION_CHECK: "1" @@ -124,7 +127,7 @@ jobs: MODE: ${{ steps.mode.outputs.mode }} run: | # mode=release scopes to workspace + workspace_test only (per the M3 - # spec) — HowTo* are tutorial repos with no env_vars_release.yaml and + # 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. if [ "$MODE" = "release" ]; then @@ -314,9 +317,15 @@ jobs: # the wheel's packaged defaults (closes Gap 4). set -e pushd workspace - ENV_CONFIG="config/build/env_vars_release.yaml" - if [ ! -f "$ENV_CONFIG" ]; then - echo "::error::$ENV_CONFIG missing — no release profile defined for this workspace" + # Prefer the canonical profile_release.yaml (PyAutoHands#161/#181 step + # 6 rename); fall back to the legacy env_vars_release.yaml so this + # workflow accepts both names during the migration window. + if [ -f "config/build/profile_release.yaml" ]; then + ENV_CONFIG="config/build/profile_release.yaml" + elif [ -f "config/build/env_vars_release.yaml" ]; then + ENV_CONFIG="config/build/env_vars_release.yaml" + else + echo "::error::config/build/profile_release.yaml missing (legacy env_vars_release.yaml also accepted) — no release profile defined for this workspace" exit 1 fi python3 "$(pwd)/../PyAutoHands/autohands/run_python.py" \ diff --git a/docs/release_validation.md b/docs/release_validation.md index 63d0793..ea15107 100644 --- a/docs/release_validation.md +++ b/docs/release_validation.md @@ -11,8 +11,9 @@ readiness hard gate. **M3 wires the acceptance criteria below into untouched, default `mode: smoke` per-PR path): - The `release` env profile lives in each workspace/`*_workspace_test` repo as - `config/build/env_vars_release.yaml` — a self-contained sibling of - `env_vars.yaml` (the `smoke` profile), passed to Build's `run_python.py` + `config/build/profile_release.yaml` (legacy `env_vars_release.yaml` is still + accepted during the migration window) — a self-contained sibling of + `profile_smoke.yaml` (the `smoke` profile), passed to Build's `run_python.py` unmodified via its existing `--env-config` flag. No changes were needed in PyAutoHands's executor primitives to support this — `--env-config` already accepted an arbitrary path. @@ -39,7 +40,7 @@ untouched, default `mode: smoke` per-PR path): `mode: release` is scoped to the `autofit`/`autogalaxy`/`autolens` workspaces and their `*_workspace_test` siblings only — the HowTo* tutorial repos have no -`env_vars_release.yaml` and stay out of the release-fidelity script matrix +`profile_release.yaml` and stay out of the release-fidelity script matrix (they are still exercised under `mode: smoke`, unchanged). ## Why a distinct profile @@ -51,7 +52,7 @@ The per-PR smoke gate and the release gate are different jobs: - **release** — *does the exact source about to ship, installed from the built wheel, pass at release fidelity?* Slow, runs only for a release rehearsal. -Both tiers' `config/build/env_vars.yaml` today default to smoke values +Both tiers' `config/build/profile_smoke.yaml` today default to smoke values (`PYAUTO_TEST_MODE=2`, `PYAUTO_SMALL_DATASETS=1`, `PYAUTO_DISABLE_JAX=1`, `PYAUTO_FAST_PLOTS=1`). That is correct for a per-PR smoke and wrong for a release gate. The two must be **named, distinct profiles** so a release run diff --git a/skills/smoke_test/SKILL.md b/skills/smoke_test/SKILL.md index ba92622..a6ba6e1 100644 --- a/skills/smoke_test/SKILL.md +++ b/skills/smoke_test/SKILL.md @@ -49,7 +49,8 @@ the user explicitly passes workspace names. ### 2. Load env config + wipe stale output -For each workspace, read `config/build/env_vars.yaml` to build the per-script env +For each workspace, read `config/build/profile_smoke.yaml` (legacy +`env_vars.yaml` is still accepted during the migration window) to build the per-script env prefix (`defaults` minus matching `overrides` `unset`s, plus optional `args_default`). Before launching, wipe `/output/*` (glob — keep the tracked `output/` dir). Detail: [`reference.md`](reference.md) → @@ -85,7 +86,7 @@ cache dir can't be created. ## Notes - Env vars, their exceptions, and `args_default` live in each workspace's - `config/build/env_vars.yaml`; the skip list in `config/build/no_run.yaml`. Edit + `config/build/profile_smoke.yaml`; the skip list in `config/build/no_run.yaml`. Edit those files — don't hardcode env vars here. - `smoke_tests.txt` files live in each workspace root. - Toggling `PYAUTO_SMALL_DATASETS` requires deleting `/dataset/` (auto- diff --git a/skills/smoke_test/reference.md b/skills/smoke_test/reference.md index 51f30b4..b91cb85 100644 --- a/skills/smoke_test/reference.md +++ b/skills/smoke_test/reference.md @@ -16,7 +16,8 @@ notebook. ## Environment config -Each workspace's `config/build/env_vars.yaml` has: +Each workspace's `config/build/profile_smoke.yaml` (legacy `env_vars.yaml` is +still accepted during the migration window) has: - `defaults` — env vars applied to every script (`PYAUTO_TEST_MODE`, `PYAUTO_SMALL_DATASETS`, …).