ci(renovate): validate the config in Lint, bump Renovate's own image weekly, run on push to main #525

Merged
Defame1297 merged 6 commits from ci/188-172-renovate-self-bump into main 2026-12-06 17:56:38 +00:00
3 changed files with 71 additions and 38 deletions
Showing only changes of commit 936e253af0 - Show all commits

No files matched your search

+7
View File
@@ -79,6 +79,13 @@ issue.
`test_the_renovate_image_pins_are_the_same` in `tests/scripts/test_check_bot_pr_diff.py` for
the equal pins; review for the job.
## Renovate
- **Triggers:** a push to `main`, the daily schedule and a successful Images run are live; a
manual dispatch is a dry run unless its input says otherwise. Runs share the `renovate`
group without cancelling. *Why:* a run after each merge rebases the next bot pull request,
and an Images run's pin pull request opens within minutes. *Held:* review.
## Molecule
- **Molecule runs on every same-repository pull request, Renovate's included, with no path
+30 -21
View File
@@ -5,18 +5,21 @@ name: Renovate
# The credential is the token of a Kamino-only bot user, held as
# the repository secret RENOVATE_BOT_TOKEN (not an org secret: only image.yml may reference those).
# The job token cannot be used: Renovate filters every pull request lookup by its own username,
# which is the virtual user gitea-actions with the job token, and Gitea answers 400 "user does not
# exist" (dry run 2445). No GitHub token exists (no RENOVATE_GITHUB_COM_TOKEN): the github-tags
# datasource then skips every pre-commit hook (skipReason github-token-required, dry run 3880), and
# unauthenticated GitHub API lookups are refused at once (403 rate limit). The hooks are looked up
# with git ls-remote instead (renovate.json, packageRule overrideDatasource git-tags), which needs
# RENOVATE_GITHUB_TOKEN_WARN=false below: the token check runs before package rules apply.
# which is the virtual user gitea-actions with the job token, and Gitea refuses that user.
# No GitHub token exists, so the pre-commit hooks are looked up with git ls-remote instead
# (renovate.json, git-tags), which needs RENOVATE_GITHUB_TOKEN_WARN=false below.
#
# Dry run: Actions > Renovate > Run workflow, dry_run=true (the default for a manual run), then
# read the debug log. The schedule runs live, and so does a successful Images run's completion, so
# the pin pull request for a new image version opens within minutes of its push. Gitea starts a
# workflow_run only for a run a person triggered, and its event carries no input or credential.
# read the debug log. Every other trigger runs live: a push to main rebases the next bot pull
# request, and an Images run's completion opens the pin pull request for a new image version.
# Gitea starts a workflow_run only for a run a person triggered, and its event carries no input
# or credential.
on: # yamllint disable-line rule:truthy
# Only one bot pull request merges per run when main must be up to date; a run after each merge
# rebases the next one.
push:
branches:
- main
# Images runs only on main (push, dispatch), and this job reads nothing from its run but the conclusion.
workflow_run: # zizmor: ignore[dangerous-triggers]
workflows: [Images]
@@ -38,7 +41,8 @@ on: # yamllint disable-line rule:truthy
permissions:
contents: read
# Never two runs at once; a running one is not cancelled (it may be mid-push).
# Never two runs at once; a running one is not cancelled (it may be mid-push), and a burst of
# pushes leaves at most one run waiting.
concurrency:
group: renovate
cancel-in-progress: false
@@ -50,15 +54,17 @@ jobs:
(github.repository == 'mortis/kamino' || github.repository == 'Mortis/Kamino') &&
(github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success')
runs-on: kamino-docker
timeout-minutes: 30
# A run takes seconds to about two minutes.
timeout-minutes: 10
# Docker Hub image, pinned by digest. The -full flavour ships python3 for the report check
# below and pip-compile for lock refreshes. Hand-bumped: renovate.json
# disables updates for this file. The image sets RENOVATE_BINARY_SOURCE=global, so pip-compile
# runs on the image's own python (3.14.8 in 44.161.0) and ignores the Python that Renovate
# reads from the lock header: that python's minor version must equal .python-version, or a lock
# refresh rewrites the header (check_image_versions.py pins then fails the pull request). When
# bumping this image, check its python first; RENOVATE_BINARY_SOURCE=install would make Renovate
# install the header's python, but it also downloads tools at run time (pip-tools included).
# below and pip-compile for lock refreshes. Renovate proposes its own bump weekly, never
# automerged (renovate.json), and moves lint.yml's copy of this pin in the same pull request.
# The image sets RENOVATE_BINARY_SOURCE=global, so pip-compile runs on the image's own python
# and ignores the Python that Renovate reads from the lock header: that python's minor version
# must equal .python-version, or a lock refresh rewrites the header (check_image_versions.py
# pins then fails the pull request). Check the image's python before merging a bump;
# RENOVATE_BINARY_SOURCE=install would make Renovate install the header's python, but it also
# downloads tools at run time (pip-tools included).
container:
image: renovate/renovate:44.161.0-full@sha256:ddbf02e44b542343c9df696b88fd953f04cc3ee5f771221805ff8efb26595416
steps:
@@ -74,14 +80,17 @@ jobs:
# No GitHub token exists, and the hooks go through git-tags (see the header). Without this
# Renovate marks every github-tags dependency as skipped before the package rule applies.
RENOVATE_GITHUB_TOKEN_WARN: "false"
# Docker Hub refuses anonymous paging past page 10; at more pages renovate/renovate gets
# no release timestamps, so its minimumReleaseAge would not apply.
RENOVATE_DOCKER_MAX_PAGES: "10"
# Renovate exits 0 when a repository run fails (e.g. the clone): with this it exits with
# an error-specific code instead (7 for an external host error such as a failed clone).
RENOVATE_EXIT_CODE_FOR_ERRORS: "true"
# The JSON report is checked after the run (see below).
RENOVATE_REPORT_TYPE: file
LOG_LEVEL: ${{ github.event_name == 'workflow_dispatch' && 'debug' || 'info' }}
# Fail safe: only the schedule and workflow_run are live. A manual dispatch is a dry run unless
# the input is exactly the string "false" (an empty input from an API or CLI dispatch stays one).
# Fail safe: a manual dispatch is a dry run unless the input is exactly the string "false"
# (an empty input from an API or CLI dispatch stays one); every other trigger is live.
DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run != 'false' && 'true' || 'false' }}
run: |
if [ -z "$RENOVATE_TOKEN" ]; then
@@ -90,7 +99,7 @@ jobs:
fi
# Git over HTTPS with the bot token. Renovate's own rewrite puts the token in the URL
# (https://<token>@host/...), which git drops when the server redirects, and Gitea
# redirected the clone (dry run 2439). The header is sent on every request to the host,
# redirects the clone. The header is sent on every request to the host,
# as lint.yml does with its token. Renovate does not pass GIT_CONFIG_* from its environment to git
# (only an allowlist, util/exec/env.js), but it does pass HOME, so a global git config
# is the path that reaches its git children. The token is read from the environment.
+34 -17
View File
@@ -1,6 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"description": "Run by .gitea/workflows/renovate.yml on this repository's own runner. Policy: automerge minor and patch, majors by hand. Every bot pull request must pass scripts/check_bot_pr_diff.py (lint workflow), which allows only version, tag, digest and pin lines, and in uv.lock only the apm-cli bump to the pin in pyproject.toml (scripts/check_uv_lock.py). Image versions are assigned by the Images workflow when an image's inputs change, so a bot pull request needs no version edit. Updates open on Mondays (UTC), so any Monday run can act; the own image pins and vulnerability fixes found on osv.dev open at any time. The weekly window and the groups bound the volume, so there is no hourly pull request limit. Vulnerability fixes skip the release-age wait, so they are never automerged: a person checks a fix that had no time to be pulled as a compromised release. Base-image bumps are manual: every Dockerfile is FROM ubuntu, grouped with the job containers.",
"description": "Run by .gitea/workflows/renovate.yml: minor and patch updates automerge once scripts/check_bot_pr_diff.py and CI pass, while majors, vulnerability fixes (which skip the release-age wait) and the exceptions below stay manual. Updates open on Mondays (UTC) after a 3-day release age, and an update with no release timestamp gets no wait.",
"extends": [
"config:recommended",
":enablePreCommit"
@@ -60,7 +60,7 @@
"customManagers": [
{
"customType": "regex",
"description": "The uv pin that installs the build-stage Python interpreters of the ci and molecule-controller images (their Dockerfiles). It is an image input: the merge publishes a new version of each.",
"description": "The uv pin that installs the build-stage Python of the ci and molecule-controller images. It is an image input: the merge publishes a new version of each.",
"managerFilePatterns": [
"/^images/ci/Dockerfile$/",
"/^images/molecule-controller/Dockerfile$/"
@@ -73,7 +73,7 @@
},
{
"customType": "regex",
"description": "The job container of each image of image.yml (matrix job_image, ubuntu by digest). kaniko unpacks the image over the job container, so its release must equal the Dockerfile's (check_image_versions.py pins). Tag and digest updates within a release arrive here; a new release is a deliberate edit of both (rule below disables major ubuntu updates). Never automerged: the job holds the registry push credential (image.yml rule below).",
"description": "The ubuntu job container of each image in image.yml, whose release must equal its Dockerfile's because kaniko unpacks the image over it. Never automerged: the job holds the registry push credential (image.yml rule below).",
"managerFilePatterns": [
"/^\\.gitea/workflows/image\\.yml$/"
],
@@ -85,7 +85,7 @@
},
{
"customType": "regex",
"description": "The CONTROLLER_IMAGE (molecule-controller), MOLECULE_IMAGE and MOLECULE_IMAGE_<release> values of molecule.yml are a multi-line `>-` scalar, which the github-actions manager does not read; matched here by its exact shape. Used by the pin-follow rule below.",
"description": "The image pins of molecule.yml are multi-line `>-` scalars, which the github-actions manager does not read. Used by the pin-follow rule below.",
"managerFilePatterns": [
"/^\\.gitea/workflows/molecule\\.yml$/"
],
@@ -98,21 +98,28 @@
],
"packageRules": [
{
"description": "Dockerfile base-image tag and digest bumps (images/*/Dockerfile) MAY automerge. Kamino is the untrusted side and the bump pull request's own CI exercises the new image before the merge. Placed first so the major-version rule below still turns automerge off. The merge publishes a new image version. Today every Dockerfile is FROM ubuntu, whose bumps join the manual ubuntu base images group below; this rule is the safety net for a future base image of another kind.",
"description": "Dockerfile base-image bumps automerge once a code owner approves (images/** is in CODEOWNERS), after their own CI has built and run the new image. Placed first so the majors rule below still turns automerge off.",
"matchManagers": [
"dockerfile"
],
"automerge": true
},
{
"description": "The Renovate job container of renovate.yml runs with the job token: hand-bumped, never by the bot (the bot-diff check would refuse a change to that file anyway).",
"matchFileNames": [
".gitea/workflows/renovate.yml"
"description": "Renovate's own image never automerges: its job runs with the write-capable bot token. One weekly pull request moves the pin in renovate.yml and lint.yml's copy together.",
"matchDatasources": [
"docker"
],
"enabled": false
"matchPackageNames": [
"renovate/renovate"
],
"schedule": [
"on monday"
],
"minimumReleaseAge": "3 days",
"automerge": false
},
{
"description": "A new Ubuntu release is a deliberate edit, never a bump. The molecule-ubuntu<NNNN> images are one release by name and by contract (extensions/molecule/image-smoke* assert it), and every image's job container must run the same release as its Dockerfile (check_image_versions.py pins), so a base-image major in one file alone would fail the check or the build. Tag and digest updates within a release still arrive.",
"description": "A new Ubuntu release is a deliberate edit, never a bump: each molecule-ubuntu<NNNN> image is one release by contract, and each job container must run its Dockerfile's release. Tag and digest updates within a release still arrive.",
"matchPackageNames": [
"ubuntu"
],
@@ -132,7 +139,7 @@
]
},
{
"description": "ansible-core and ansible-lint move together (the lint rules follow the core version). Minor and patch bumps automerge like the rest, majors are manual. A new ansible-core minor can bring new sanity findings: the shared tests/sanity/ignore-common.txt covers the known ones, and the Build check (ansible-test sanity) is the gate, so a bump that shows new findings stays red and is not merged. The group spans requirements-dev.lock and requirements-molecule.lock, so one pull request moves both ansible-core pins, which check_image_versions.py pins holds equal.",
"description": "ansible-core and ansible-lint move together, because the lint rules follow the core version. One pull request moves the ansible-core pins of both locks, which check_image_versions.py pins holds equal.",
"groupName": "ansible tooling",
"matchDatasources": [
"pypi"
@@ -143,7 +150,7 @@
]
},
{
"description": "Hold ansible-lint at the newest version galaxy-importer allows. galaxy-importer 0.4.44 (the newest release, used by the Build job) declares ansible-lint<=26.10.1, so a pin above that makes pip fail with ResolutionImpossible and Lint and Build go red (seen on the 26.11.0 bump). Remove this rule, and raise the cap, once a galaxy-importer release lifts its ansible-lint limit.",
"description": "Hold ansible-lint at the newest version galaxy-importer allows, or pip cannot install Lint's and Build's tools. Raise or remove the cap once galaxy-importer lifts its ansible-lint limit.",
"matchDatasources": [
"pypi"
],
@@ -153,28 +160,38 @@
"allowedVersions": "<=26.10.1"
},
{
"description": "The job containers of image.yml (matrix job_image, ubuntu by digest) hold the org registry push credential while the image job runs: never automerged. Their ubuntu bumps share one branch with the Dockerfile FROM bumps (ubuntu base images rule below), so that pull request is manual too: a group automerges only if every update in it does.",
"description": "The job containers of image.yml hold the registry push credential while the image job runs, so their bumps never automerge. Their ubuntu bumps share a branch with the Dockerfile FROM bumps, so that group is manual too.",
"matchFileNames": [
".gitea/workflows/image.yml"
],
"automerge": false
},
{
"description": "The Dockerfile FROM digests and the image.yml job_image digests of one Ubuntu update move in one pull request, so the release pair stays in step and one Images run covers both.",
"description": "The Dockerfile FROM and image.yml job_image digests of one Ubuntu update move in one pull request, so each release pair stays in step and one Images run covers both.",
"matchPackageNames": [
"ubuntu"
],
"groupName": "ubuntu base images"
},
{
"description": "Safety net only: kaniko is pinned by layer digests in image.yml and no Renovate manager reads them, so it is updated by hand. If a manager ever starts to read it, its bumps are not automerged.",
"description": "Safety net: kaniko is pinned by layer digests that no manager reads, so it is updated by hand. If a manager ever reads it, its bumps do not automerge.",
"matchPackageNames": [
"/kaniko/"
],
"automerge": false
},
{
"description": "Pin follow-up for our own images (git.rkdr.net/mortis/*): moves the image:<version>@sha256:<digest> pins of lint.yml, build.yml, molecule.yml and gitea-release-key.yml to the newest published version and its digest, and automerges. The Images workflow's completion starts a Renovate run, so this pull request opens minutes after a new version is pushed. The pull request's own Lint and Build run in the new image before the merge, and scripts/check_bot_pr_diff.py allows only these pin lines. The registry lists tags and digests anonymously, so no hostRules are needed. A major version stays manual (rule above). One pull request moves every image an Images run published (ci, molecule-controller and both molecule target images), so one Molecule run tests them together. Exempt from the weekly schedule, so the pins on main catch up with a new image within minutes.",
"description": "Our own images are built from main by the Images workflow, so there is no third-party release to wait for. Docker only, so another kind of dependency from this organisation keeps the wait.",
"matchDatasources": [
"docker"
],
"matchPackageNames": [
"git.rkdr.net/mortis/**"
],
"minimumReleaseAge": "0 days"
},
{
"description": "Moves the pins of our own images in the workflows to the newest published version in one pull request at any time, so main catches up minutes after an Images run. It automerges once a code owner approves (CODEOWNERS), after its own Lint, Build and Molecule run on the new images.",
"matchPackageNames": [
"git.rkdr.net/mortis/**"
],
@@ -185,7 +202,7 @@
]
},
{
"description": "Look the pre-commit hook repositories up with git ls-remote (git-tags) instead of the GitHub API. This run has no GitHub token, and the github-tags datasource then either skips every hook (skipReason github-token-required, dry run 3880) or is refused at once with 403 rate limit (githubTokenWarn off, local run). git-tags needs no API and no credential, and it uses the dereferenced hash of an annotated tag, so the new rev is the commit, as pre-commit needs. The `# frozen:` form is kept by the manager's own replace template. It works only together with RENOVATE_GITHUB_TOKEN_WARN=false in renovate.yml: the token check runs after extraction and skips every github-tags dependency before a package rule can change its datasource (local run, Renovate 44.161.0). git-tags has no release timestamps, so minimumReleaseAge cannot delay a hook bump: hook bumps are never automerged, a person reviews each one.",
"description": "Look the pre-commit hooks up with git ls-remote (git-tags), because this run has no GitHub token; it needs RENOVATE_GITHUB_TOKEN_WARN=false in renovate.yml. git-tags has no release timestamps, so no wait applies and a person reviews every hook bump.",
"matchManagers": [
"pre-commit"
],