Skip to content

test: PR gate rejects untimed urlretrieve/urlopen in workspace scripts - #327

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/no-untimed-network-downloads
Nov 8, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/no-untimed-network-downloads

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Closes #326.

What

New step Reject untimed network downloads in the reusable smoke-tests.yml PR gate, after the tracked-output guard and before the install. It AST-scans scripts/**/*.py of the calling workspace and fails with file:line (plus ::error annotations) on:

  • any urlretrieve( call — it takes no timeout at all;
  • any urlopen( without a timeout (keyword timeout=, third positional arg, or **kwargs all count as timed).

Comments and docstrings never trip it (AST, not grep). Self-contained (no ${{ }}), honours WORKSPACE_DIR.

Why here

Workspace tests/ are not run by any CI, so a workspace test_* 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 touches scripts/ (the relevance gate) and every push to main.

Witness

  • Current main of autolens/autogalaxy/autofit_workspace: passes (exit 0).
  • autolens_workspace at 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 without scripts/, 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

#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
@Jammy2211
Jammy2211 merged commit 0b49dd7 into main Nov 8, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the feature/no-untimed-network-downloads branch November 8, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: PR gate rejects untimed urlretrieve/urlopen in workspace scripts

2 participants