run_smoke: delegate env resolution to autobuild/env_config (step 2)#52
Merged
Conversation
The local copy of the resolver had already drifted: its load_env_config() hardcoded config/build/env_vars.yaml, so the PR gate was structurally unable to read the release profile (failure mode 4/7 of the seed incident). Delegate to PyAutoBuild's env_config — the same resolver the release runner uses — so the two gates cannot disagree about a script's environment. CI already clones PyAutoBuild and puts autobuild/ on PYTHONPATH; a sibling-checkout fallback keeps local runs working. Verified: all smoke scripts resolve byte-identical environments before and after. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migration step 2 of
PyAutoBuild/docs/env_profile_redesign.md(PyAutoBuild#161; campaign #155 Phase 3): one resolver.run_smoke.pyno longer carries its own copy of the env-resolution logic — it imports PyAutoBuild'sautobuild/env_config.py, the same resolver the release runner uses.Why it matters: the fork had already drifted. Its
load_env_config()took no arguments and hardcodedconfig/build/env_vars.yaml, which is failure mode 4 made structural — the PR gate was incapable of ever reading the release profile, so a release-profile error could only surface in the next nightly. Thebuild_envcores were still line-identical, i.e. this is a fork caught mid-divergence, which is exactly when it is cheap to kill.No infrastructure was needed: PyAutoHeart's reusable
smoke-tests.ymlalready clones PyAutoBuild and putsPyAutoBuild/autobuildonPYTHONPATH(lines 54/90). A sibling-checkout fallback keeps the documented local invocation (python .github/scripts/run_smoke.py, AGENTS.md) working with noPYTHONPATH— verified.Note on the hardcode:
ENV_VARS_FILEremains as an explicit argument to the canonical loader — the smoke runner legitimately runs the smoke profile. What died is the resolver's inability to be pointed at any other profile; reading BOTH profiles at PR time isvalidate_env_profiles' job (step 1, merged in PyAutoBuild#163).API Changes
None — CI/runner internals.
load_env_config()→load_cfg()locally; resolution now delegated.Test Plan
git show HEAD:) vs new delegation — against the real workspaces, not a synthetic model. 61/61 scripts → byte-identical environments, 0 mismatches (autofit 11, autogalaxy 34, autolens 16).PYTHONPATHimports via the fallback and parses the profile.python run_smoke.pyinvocations).release.yml, this path is exercised pre-merge.Generated by the PyAutoLabs agent workflow.