Repository navigation
test: PR gate rejects untimed urlretrieve/urlopen in workspace scripts - #327
Merged
Merged
Conversation
#326) An untimed urlretrieve stalled in ssl.read and hit the 300 s smoke cap (run 34099198772); fixed in autolens_workspace#293, back in four scripts within three weeks (#537). The reusable smoke gate now AST-scans every caller workspace's scripts/ and fails with file:line on urlretrieve() or urlopen() without a timeout, before the install. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016nhQ8R8X3Q6VTwSEWWWMwh
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.
Closes #326.
What
New step Reject untimed network downloads in the reusable
smoke-tests.ymlPR gate, after the tracked-output guard and before the install. It AST-scansscripts/**/*.pyof the calling workspace and fails withfile:line(plus::errorannotations) on:urlretrieve(call — it takes no timeout at all;urlopen(without a timeout (keywordtimeout=, third positional arg, or**kwargsall count as timed).Comments and docstrings never trip it (AST, not grep). Self-contained (no
${{ }}), honoursWORKSPACE_DIR.Why here
Workspace
tests/are not run by any CI, so a workspacetest_*would not have been a gate. autolens_workspace, autogalaxy_workspace and autofit_workspace all call this reusable workflow, so one step covers all of them with no per-workspace mirror. It runs on every PR that touchesscripts/(the relevance gate) and every push tomain.Witness
mainof autolens/autogalaxy/autofit_workspace: passes (exit 0).1069bce~1(just before #537): fails with exactly the four regressed scripts —multi_dataset/.../modeling.py:80,weak/features/strong_lensing/a2744.py:95,weak/real_data/a2744.py:79,weak/start_here.py:121.tests/test_workflow_wiring.py: 4 new tests run the step verbatim (flags + line order, timed/mention pass, no-op withoutscripts/,WORKSPACE_DIR), and pin its position before the install. The full suite's 43 pre-existing failures are the same set with and without this change (environment-related, unrelated).No retry logic, per the prompt.
Generated by Claude Code