On the fast path (the pin files match /opt/ci-pins.sha256), Lint and Build write a network guard into $GITHUB_ENV: PIP_NO_INDEX=1, http_proxy, https_proxy, HTTP_PROXY and HTTPS_PROXY set to a dead local port (127.0.0.1:9), and no_proxy and NO_PROXY empty. Every later step inherits it, so a tool that downloads at run time fails the job instead of slowing it down silently. The bake-in rule (images/AGENTS.md) becomes a control. The slow path sets nothing and keeps network access.
Why not unshare: this is approach 2 of the issue comment. I tried approach 1 (unshare -rn) first, and the runner's job container refused it: unshare: unshare failed: Operation not permitted (Lint run 5880, Build run 5879, on commit 7c148e8). Commit 4d5042a replaces it.
What it catches: pip, curl, git over HTTPS, and Python's urllib or requests, meaning any client that honours PIP_NO_INDEX or the proxy variables.
What it does not catch: a raw socket, or a tool that ignores the proxy variables. Those stay held by review, as the rule in .gitea/workflows/AGENTS.md says.
"Test the repository scripts" unsets the guard.next_image_version.py uses urllib's default opener, so with no_proxy empty the tests' fake registry on 127.0.0.1 would be sent to the dead proxy. #187 moves these tests into a pre-commit hook, which runs under the guard, so that hook will need the same exception.
No changelog fragment: this is CI only.
Verified
CI on this PR, fast path: all green; the Lint log shows the guard notice after "The pin files match the ci image".
Acceptance 1, a runtime download fails the job.Lint 5888 was dispatched on a throwaway branch that added a fast-path step running pip download pyyaml. That step failed with No matching distribution found for pyyaml, and the job failed.
Acceptance 2, the slow path still installs and passes.Lint 5889 was dispatched on a throwaway branch that only added a comment to .pre-commit-config.yaml. It printed the pin-mismatch warning, set no guard, ran the pip and galaxy installs, and passed.
I deleted both throwaway branches afterwards, so their commits are not in this PR.
Locally, with the guard exported:
pre-commit run --all-files passed.
ansible-galaxy collection build passed.
check_tarball.py reported "344 entries, all allowed".
check_image_versions.py pins reported ok.
pip download, urllib and curl each failed with connection refused or no index.
Locally, script tests: 272 tests pass with the guard unset. With it exported, 6 fail with Connection refused, which is why that step unsets it.
Review: two reviews in separate subagents, one against the standards and one against the spec. Their finding was that the docs overclaimed the control; fixed and then reworded for the guard.
Not verified
I did not test git over HTTPS under the guard directly.
Slow-path run 5889 rebuilt no pre-commit hook environment, because a comment-only change leaves every hook's repo and rev unchanged. A slow path that does rebuild hooks was not exercised. It sets no guard, so it should behave as it does on main.
I confirm third-party material is recorded in NOTICE and REUSE.toml, or there is none.
Assisted-by: Claude Code
## What and why
Closes #168
On the fast path (the pin files match `/opt/ci-pins.sha256`), Lint and Build write a network guard into `$GITHUB_ENV`: `PIP_NO_INDEX=1`, `http_proxy`, `https_proxy`, `HTTP_PROXY` and `HTTPS_PROXY` set to a dead local port (`127.0.0.1:9`), and `no_proxy` and `NO_PROXY` empty. Every later step inherits it, so a tool that downloads at run time fails the job instead of slowing it down silently. The bake-in rule (`images/AGENTS.md`) becomes a control. The slow path sets nothing and keeps network access.
- **Why not `unshare`:** this is approach 2 of the issue comment. I tried approach 1 (`unshare -rn`) first, and the runner's job container refused it: `unshare: unshare failed: Operation not permitted` (Lint run 5880, Build run 5879, on commit 7c148e8). Commit 4d5042a replaces it.
- **What it catches:** pip, curl, git over HTTPS, and Python's urllib or requests, meaning any client that honours `PIP_NO_INDEX` or the proxy variables.
- **What it does not catch:** a raw socket, or a tool that ignores the proxy variables. Those stay held by review, as the rule in `.gitea/workflows/AGENTS.md` says.
- **"Test the repository scripts" unsets the guard.** `next_image_version.py` uses urllib's default opener, so with `no_proxy` empty the tests' fake registry on 127.0.0.1 would be sent to the dead proxy. #187 moves these tests into a pre-commit hook, which runs under the guard, so that hook will need the same exception.
- **No changelog fragment:** this is CI only.
## Verified
- **CI on this PR, fast path:** all green; the Lint log shows the guard notice after "The pin files match the ci image".
- [Lint 5886](https://git.rkdr.net/Mortis/Kamino/actions/runs/5886)
- [Build 5885](https://git.rkdr.net/Mortis/Kamino/actions/runs/5885)
- [Molecule 5887](https://git.rkdr.net/Mortis/Kamino/actions/runs/5887)
- **Acceptance 1, a runtime download fails the job.** [Lint 5888](https://git.rkdr.net/Mortis/Kamino/actions/runs/5888) was dispatched on a throwaway branch that added a fast-path step running `pip download pyyaml`. That step failed with `No matching distribution found for pyyaml`, and the job failed.
- **Acceptance 2, the slow path still installs and passes.** [Lint 5889](https://git.rkdr.net/Mortis/Kamino/actions/runs/5889) was dispatched on a throwaway branch that only added a comment to `.pre-commit-config.yaml`. It printed the pin-mismatch warning, set no guard, ran the pip and galaxy installs, and passed.
- I deleted both throwaway branches afterwards, so their commits are not in this PR.
- **Locally, with the guard exported:**
- `pre-commit run --all-files` passed.
- `ansible-galaxy collection build` passed.
- `check_tarball.py` reported "344 entries, all allowed".
- `check_image_versions.py pins` reported ok.
- `pip download`, `urllib` and `curl` each failed with connection refused or no index.
- **Locally, script tests:** 272 tests pass with the guard unset. With it exported, 6 fail with `Connection refused`, which is why that step unsets it.
- **Review:** two reviews in separate subagents, one against the standards and one against the spec. Their finding was that the docs overclaimed the control; fixed and then reworded for the guard.
## Not verified
- I did not test git over HTTPS under the guard directly.
- Slow-path run 5889 rebuilt no pre-commit hook environment, because a comment-only change leaves every hook's repo and rev unchanged. A slow path that does rebuild hooks was not exercised. It sets no guard, so it should behave as it does on `main`.
---
- [x] I confirm third-party material is recorded in `NOTICE` and `REUSE.toml`, or there is none.
Assisted-by: Claude Code
Claude
added this to the Continuous delivery milestone 2026-11-26 22:21:45 +00:00
Defame1297
was assigned by Claude2026-11-26 22:21:45 +00:00
When the pins match the ci image every tool is baked in, so a runtime
download is a bake-in defect; failing the job makes it visible.
Assisted-by: Claude Code
The runner's job container refuses unshare, even with a user namespace, so the
fast path sets PIP_NO_INDEX and a dead proxy instead; a raw socket is not caught.
Assisted-by: Claude Code
Claude
changed title from ci: run the Lint and Build fast path without network to ci: cut the Lint and Build fast-path network by environment2026-11-26 22:59:10 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What and why
Closes #168
On the fast path (the pin files match
/opt/ci-pins.sha256), Lint and Build write a network guard into$GITHUB_ENV:PIP_NO_INDEX=1,http_proxy,https_proxy,HTTP_PROXYandHTTPS_PROXYset to a dead local port (127.0.0.1:9), andno_proxyandNO_PROXYempty. Every later step inherits it, so a tool that downloads at run time fails the job instead of slowing it down silently. The bake-in rule (images/AGENTS.md) becomes a control. The slow path sets nothing and keeps network access.unshare: this is approach 2 of the issue comment. I tried approach 1 (unshare -rn) first, and the runner's job container refused it:unshare: unshare failed: Operation not permitted(Lint run 5880, Build run 5879, on commit7c148e8). Commit4d5042areplaces it.PIP_NO_INDEXor the proxy variables..gitea/workflows/AGENTS.mdsays.next_image_version.pyuses urllib's default opener, so withno_proxyempty the tests' fake registry on 127.0.0.1 would be sent to the dead proxy. #187 moves these tests into a pre-commit hook, which runs under the guard, so that hook will need the same exception.Verified
pip download pyyaml. That step failed withNo matching distribution found for pyyaml, and the job failed..pre-commit-config.yaml. It printed the pin-mismatch warning, set no guard, ran the pip and galaxy installs, and passed.pre-commit run --all-filespassed.ansible-galaxy collection buildpassed.check_tarball.pyreported "344 entries, all allowed".check_image_versions.py pinsreported ok.pip download,urllibandcurleach failed with connection refused or no index.Connection refused, which is why that step unsets it.Not verified
main.NOTICEandREUSE.toml, or there is none.Assisted-by: Claude Code
ci: run the Lint and Build fast path without networkto ci: cut the Lint and Build fast-path network by environment