Merge pull request 'ci: cut the Lint and Build fast-path network by environment' (#408) from ci/168-offline-fast-path into main
Images / image (0.1, Dockerfile, ubuntu:24.04@sha256:9c7f200c07e3d4a03e7249d2c16bf66a51120fb876aa2242cf31451412543289, molecule-ubuntu2404, images/molecule-ubuntu2404) (push) Successful in 15s
Images / image (0.1, Dockerfile, ubuntu:26.04@sha256:d66b366dac61b575bee2aef07e9c26e8070096fbe84a3d4d3eb0da069b5d76db, molecule-ubuntu2604, images/molecule-ubuntu2604) (push) Successful in 38s
Images / image (0.2, images/ci/Dockerfile, ubuntu:26.04@sha256:d66b366dac61b575bee2aef07e9c26e8070096fbe84a3d4d3eb0da069b5d76db, ci, ) (push) Successful in 13s

Reviewed-on: #408
This commit was merged in pull request #408.
This commit is contained in:
Defame1297 committed 2026-11-27 07:38:18 +00:00
commit 3bf9ae0efe
5 files changed
+26 -3

No files matched your search

+8
View File
@@ -57,6 +57,14 @@ issue.
`.pre-commit-config.yaml` takes the slow path, which installs the pinned tools and collections. `.pre-commit-config.yaml` takes the slow path, which installs the pinned tools and collections.
*Why:* a pull request is tested on its own pins, and an unchanged one starts in seconds. *Why:* a pull request is tested on its own pins, and an unchanged one starts in seconds.
*Held:* control: the "Check the baked tooling against the pins" step. *Held:* control: the "Check the baked tooling against the pins" step.
- **On the fast path the network is cut by environment**: `PIP_NO_INDEX=1`, the proxy variables
set to a dead local port and `no_proxy` empty, for every later step except "Test the repository
scripts", which unsets them for its fake registry on loopback; the slow path keeps network.
*Why:* a runtime download is a bake-in defect and must fail the job, not silently slow it.
*Held:* control, set by the "Check the baked tooling against the pins" step, for pip, curl, git
over HTTPS and Python's urllib or requests (anything honouring `PIP_NO_INDEX` or the proxy
variables); review for a raw socket or a tool that ignores the proxy variables, and for the
script tests.
- **Triggers:** both run on pull requests to `main` and on manual dispatch; Build also runs on - **Triggers:** both run on pull requests to `main` and on manual dispatch; Build also runs on
`v*` tags, where it checks the tag against `galaxy.yml`. *Why:* the tag is what consumers `v*` tags, where it checks the tag against `galaxy.yml`. *Why:* the tag is what consumers
install. *Held:* review. install. *Held:* review.
+5
View File
@@ -60,6 +60,11 @@ jobs:
run: | run: |
if sha256sum --quiet -c /opt/ci-pins.sha256; then if sha256sum --quiet -c /opt/ci-pins.sha256; then
echo "The pin files match the ci image; using the baked tools." echo "The pin files match the ci image; using the baked tools."
# A job container may not unshare, so the network is cut by environment: pip, curl,
# git over HTTPS and Python's urllib fail; a raw socket is not caught.
printf '%s\n' PIP_NO_INDEX=1 http_proxy=http://127.0.0.1:9 https_proxy=http://127.0.0.1:9 \
HTTP_PROXY=http://127.0.0.1:9 HTTPS_PROXY=http://127.0.0.1:9 no_proxy= NO_PROXY= >> "$GITHUB_ENV"
echo "::notice::Later steps run with a dead proxy; a download fails the job (bake it into images/ci)."
else else
echo "::warning::requirements-dev.txt, requirements-dev.lock, requirements.yml," \ echo "::warning::requirements-dev.txt, requirements-dev.lock, requirements.yml," \
"extensions/molecule/requirements.yml or .pre-commit-config.yaml differ from the ci image;" \ "extensions/molecule/requirements.yml or .pre-commit-config.yaml differ from the ci image;" \
+7
View File
@@ -59,6 +59,11 @@ jobs:
run: | run: |
if sha256sum --quiet -c /opt/ci-pins.sha256; then if sha256sum --quiet -c /opt/ci-pins.sha256; then
echo "The pin files match the ci image; using the baked tools." echo "The pin files match the ci image; using the baked tools."
# A job container may not unshare, so the network is cut by environment: pip, curl,
# git over HTTPS and Python's urllib fail; a raw socket is not caught.
printf '%s\n' PIP_NO_INDEX=1 http_proxy=http://127.0.0.1:9 https_proxy=http://127.0.0.1:9 \
HTTP_PROXY=http://127.0.0.1:9 HTTPS_PROXY=http://127.0.0.1:9 no_proxy= NO_PROXY= >> "$GITHUB_ENV"
echo "::notice::Later steps run with a dead proxy; a download fails the job (bake it into images/ci)."
else else
echo "::warning::requirements-dev.txt, requirements-dev.lock, requirements.yml," \ echo "::warning::requirements-dev.txt, requirements-dev.lock, requirements.yml," \
"extensions/molecule/requirements.yml or .pre-commit-config.yaml differ from the ci image;" \ "extensions/molecule/requirements.yml or .pre-commit-config.yaml differ from the ci image;" \
@@ -108,8 +113,10 @@ jobs:
fi fi
python3 -E -s "$guard" "$HEAD_REF" "$BASE_REF" python3 -E -s "$guard" "$HEAD_REF" "$BASE_REF"
# Without the guard: an empty no_proxy would send the fake registry on 127.0.0.1 to the dead proxy.
- name: Test the repository scripts - name: Test the repository scripts
run: | run: |
unset PIP_NO_INDEX http_proxy https_proxy HTTP_PROXY HTTPS_PROXY
export PATH="/opt/venv/bin:$PATH" export PATH="/opt/venv/bin:$PATH"
python3 -m unittest discover -s tests/scripts python3 -m unittest discover -s tests/scripts
+2 -1
View File
@@ -66,7 +66,8 @@ Read `.gitea/workflows/molecule.yml` for the full command.
`/opt/ci-pins.sha256` lists the five pin files by their checkout-relative path, so `sha256sum -c` runs in the checkout root. When `/opt/ci-pins.sha256` lists the five pin files by their checkout-relative path, so `sha256sum -c` runs in the checkout root. When
the checkout's `requirements-dev.txt`, `requirements-dev.lock`, `requirements.yml`, `extensions/molecule/requirements.yml` and `.pre-commit-config.yaml` match, the baked tools and the checkout's `requirements-dev.txt`, `requirements-dev.lock`, `requirements.yml`, `extensions/molecule/requirements.yml` and `.pre-commit-config.yaml` match, the baked tools and
collections are used as they are. When a pull request changes a pin the check fails and the job installs the pinned collections are used as they are, and Lint and Build cut the network by environment (proxy variables and
`PIP_NO_INDEX`) for all but the script tests, so a tool that downloads at run time fails the job. When a pull request changes a pin the check fails and the job installs the pinned
tools and collections itself for that run tools and collections itself for that run
(slower, same result), until the image is rebuilt from `main`. `lint.yml`, `build.yml`, `molecule.yml` and `gitea-release-key.yml` (slower, same result), until the image is rebuilt from `main`. `lint.yml`, `build.yml`, `molecule.yml` and `gitea-release-key.yml`
are the real consumers. are the real consumers.
+4 -2
View File
@@ -61,8 +61,10 @@ it to this repository's organisation in the Gitea registry as `<version>` and `l
- **Bake in:** every tool, collection, hook environment and package a CI job uses is in its - **Bake in:** every tool, collection, hook environment and package a CI job uses is in its
image; a job downloads at run time only on the slow path (a pull request that changes a pin image; a job downloads at run time only on the slow path (a pull request that changes a pin
file). *Why:* a run that downloads is slower and depends on the network. *Held:* review until file). *Why:* a run that downloads is slower and depends on the network. *Held:* control: on
the network-off check (#168) lands. the fast path Lint and Build cut the network by environment, so a download through pip or a
proxy-honouring client fails the job; review for a raw socket, for the script tests, which keep
network, and for Molecule.
- **Recorded speed:** a speed optimisation that adds machinery states its measured saving where - **Recorded speed:** a speed optimisation that adds machinery states its measured saving where
it lives (a comment next to it). *Why:* machinery is kept only for a saving someone can check. it lives (a comment next to it). *Why:* machinery is kept only for a saving someone can check.
*Held:* review. *Held:* review.