The first Images run after #340 (run 5229) failed before building anything. The first registry request from scripts/next_image_version.py (GET /v2/mortis/molecule-ubuntu2404/tags/list) got HTTP 403 and ended in a bare traceback. Nothing was pushed and no tag moved.
The same request works from a developer machine, and curl in the same job reaches the same host. The suspected cause is a bot filter refusing Python's default Python-urllib User-Agent. This is not confirmed: the old script did not print the response body.
Changes to scripts/next_image_version.py:
User-Agent: every registry request, the token request included, sends User-Agent: kamino-next-image-version.
Readable errors: every HTTP error becomes a RegistryError naming the status and the visible text of the response body. Script and style blocks and tags are stripped, and the text is cut to 300 characters. main prints it as one ::error:: line and exits 1. A block page is then recognisable in the job log.
One login at most: a 401 after the login is final, so an empty token cannot loop.
Registry URL argument: the CLI takes the registry URL instead of the host, so the tests can drive it against a local fake registry. image.yml now passes $SERVER_URL.
New tests run against a local fake registry (http.server) and cover:
every request sending the client's User-Agent;
a 403 block page with a large <style> block (status and text);
a refused token (401 with body);
a 401 without a realm;
one login only with an empty token;
the CLI printing one ::error:: line and exiting 1 with empty stdout.
Each new test was seen failing first, except the missing-realm test, which covers a branch that already existed.
pre-commit run --all-files and ansible-test sanity (pylint) pass.
A live read-only run of the client against the registry from a developer machine still reads tags and labels.
Subagent review ran to clean: four rounds (standards and spec, then combined), with every finding fixed until the last round reported none. A reviewer confirmed that the empty-token test fails without its fix.
Not verified
Whether the User-Agent is the cause of the 403. If it is not, the next run still fails, but the log now shows the status and the page text. The fallback is to read the tags with curl, which already reaches the host from the runner.
The Images run itself. After the merge I'll start Images by manual dispatch from main and watch it through the version step, the push, the Renovate workflow_run and the pin PR.
The rest of #340's not-verified list still stands: the pristine-filesystem check with python3, kaniko writing the label, and Renovate starting after Images.
I confirm third-party material is recorded in NOTICE and REUSE.toml, or there is none.
Assisted-by: Claude Code:claude-opus-5-5
## What and why
Refs #165 (follow-up to #340)
The first Images run after #340 ([run 5229](https://git.rkdr.net/Mortis/Kamino/actions/runs/5229)) failed before building anything. The first registry request from `scripts/next_image_version.py` (`GET /v2/mortis/molecule-ubuntu2404/tags/list`) got **HTTP 403** and ended in a bare traceback. Nothing was pushed and no tag moved.
The same request works from a developer machine, and `curl` in the same job reaches the same host. The suspected cause is a bot filter refusing Python's default `Python-urllib` User-Agent. **This is not confirmed:** the old script did not print the response body.
Changes to `scripts/next_image_version.py`:
- **User-Agent:** every registry request, the token request included, sends `User-Agent: kamino-next-image-version`.
- **Readable errors:** every HTTP error becomes a `RegistryError` naming the status and the visible text of the response body. Script and style blocks and tags are stripped, and the text is cut to 300 characters. `main` prints it as one `::error::` line and exits 1. A block page is then recognisable in the job log.
- **One login at most:** a 401 after the login is final, so an empty token cannot loop.
- **Registry URL argument:** the CLI takes the registry URL instead of the host, so the tests can drive it against a local fake registry. `image.yml` now passes `$SERVER_URL`.
No changelog fragment: this is CI-internal.
## Verified
- `python3 -m unittest discover -s tests/scripts`: 227 tests pass, repeated 3 times.
- New tests run against a local fake registry (`http.server`) and cover:
- every request sending the client's User-Agent;
- a 403 block page with a large `<style>` block (status and text);
- a refused token (401 with body);
- a 401 without a realm;
- one login only with an empty token;
- the CLI printing one `::error::` line and exiting 1 with empty stdout.
- Each new test was seen failing first, except the missing-realm test, which covers a branch that already existed.
- `pre-commit run --all-files` and `ansible-test sanity` (pylint) pass.
- A live read-only run of the client against the registry from a developer machine still reads tags and labels.
- Subagent review ran to clean: four rounds (standards and spec, then combined), with every finding fixed until the last round reported none. A reviewer confirmed that the empty-token test fails without its fix.
## Not verified
- **Whether the User-Agent is the cause of the 403.** If it is not, the next run still fails, but the log now shows the status and the page text. The fallback is to read the tags with `curl`, which already reaches the host from the runner.
- The Images run itself. After the merge I'll start Images by manual dispatch from `main` and watch it through the version step, the push, the Renovate `workflow_run` and the pin PR.
- The rest of #340's not-verified list still stands: the pristine-filesystem check with `python3`, kaniko writing the label, and Renovate starting after Images.
---
- [x] I confirm third-party material is recorded in `NOTICE` and `REUSE.toml`, or there is none.
Assisted-by: Claude Code:claude-opus-5-5
Claude
added this to the CI velocity (emergency) milestone 2026-11-23 22:13:52 +00:00
Defame1297
was assigned by Claude2026-11-23 22:13:52 +00:00
The first Images run after #165 failed: the runner's first registry request
from next_image_version.py got HTTP 403, as a bare traceback, while the same
request works from elsewhere and curl reaches the host in the same job. The
suspected cause, a bot filter refusing Python's default User-Agent, is not
confirmed.
Every registry request, the token request included, now sends its own
User-Agent. Every HTTP error becomes a RegistryError that names the status and
the visible text of the response body, and main prints it as one ::error::
line and exits 1. The client logs in at most once, so an empty token cannot
loop. The script takes the registry URL, so the tests drive it against a local
fake registry.
Refs #165
Assisted-by: Claude Code:claude-opus-5-5
CODEOWNERS rules
requested review from Defame1297 2026-11-23 22:13:52 +00:00
Defame1297
scheduled this pull request to auto merge when all checks succeed 2026-11-23 22:15:04 +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
Refs #165 (follow-up to #340)
The first Images run after #340 (run 5229) failed before building anything. The first registry request from
scripts/next_image_version.py(GET /v2/mortis/molecule-ubuntu2404/tags/list) got HTTP 403 and ended in a bare traceback. Nothing was pushed and no tag moved.The same request works from a developer machine, and
curlin the same job reaches the same host. The suspected cause is a bot filter refusing Python's defaultPython-urllibUser-Agent. This is not confirmed: the old script did not print the response body.Changes to
scripts/next_image_version.py:User-Agent: kamino-next-image-version.RegistryErrornaming the status and the visible text of the response body. Script and style blocks and tags are stripped, and the text is cut to 300 characters.mainprints it as one::error::line and exits 1. A block page is then recognisable in the job log.image.ymlnow passes$SERVER_URL.No changelog fragment: this is CI-internal.
Verified
python3 -m unittest discover -s tests/scripts: 227 tests pass, repeated 3 times.http.server) and cover:<style>block (status and text);::error::line and exiting 1 with empty stdout.pre-commit run --all-filesandansible-test sanity(pylint) pass.Not verified
curl, which already reaches the host from the runner.mainand watch it through the version step, the push, the Renovateworkflow_runand the pin PR.python3, kaniko writing the label, and Renovate starting after Images.NOTICEandREUSE.toml, or there is none.Assisted-by: Claude Code:claude-opus-5-5