Merge pull request 'ci(deps): make Renovate read the lock and look the hooks up without a token' (#132) from fix/renovate-lock-and-hooks into main
Build / build (push) Successful in 11s
Images / image (Dockerfile, ubuntu:24.04@sha256:fe81560990fae86dc4743202b2cb4d3df98d0bcf949173cecef15ce1127ef852, molecule-ubuntu2404, images/molecule-ubuntu2404, 0.1.6) (push) Successful in 11s
Lint / lint (push) Successful in 34s
Images / image (Dockerfile, ubuntu:26.04@sha256:6a06111c3b0a8600feadb270aec771dc239bf407b25625f93f44ab00e11f4d3c, molecule-ubuntu2604, images/molecule-ubuntu2604, 0.1.3) (push) Successful in 8s
Images / image (images/ci/Dockerfile, ubuntu:26.04@sha256:6a06111c3b0a8600feadb270aec771dc239bf407b25625f93f44ab00e11f4d3c, ci, , 0.2.20) (push) Successful in 3m24s
Build / build (push) Successful in 11s
Images / image (Dockerfile, ubuntu:24.04@sha256:fe81560990fae86dc4743202b2cb4d3df98d0bcf949173cecef15ce1127ef852, molecule-ubuntu2404, images/molecule-ubuntu2404, 0.1.6) (push) Successful in 11s
Lint / lint (push) Successful in 34s
Images / image (Dockerfile, ubuntu:26.04@sha256:6a06111c3b0a8600feadb270aec771dc239bf407b25625f93f44ab00e11f4d3c, molecule-ubuntu2604, images/molecule-ubuntu2604, 0.1.3) (push) Successful in 8s
Images / image (images/ci/Dockerfile, ubuntu:26.04@sha256:6a06111c3b0a8600feadb270aec771dc239bf407b25625f93f44ab00e11f4d3c, ci, , 0.2.20) (push) Successful in 3m24s
Reviewed-on: #132
This commit was merged in pull request #132.
This commit is contained in:
commit
8a3c7d0fc2
6 files changed
+34
-5
No files matched your search
@@ -88,7 +88,7 @@ jobs:
|
|||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
job_image: ubuntu:26.04@sha256:6a06111c3b0a8600feadb270aec771dc239bf407b25625f93f44ab00e11f4d3c
|
job_image: ubuntu:26.04@sha256:6a06111c3b0a8600feadb270aec771dc239bf407b25625f93f44ab00e11f4d3c
|
||||||
- name: ci
|
- name: ci
|
||||||
version: 0.2.19
|
version: 0.2.20
|
||||||
subpath: ""
|
subpath: ""
|
||||||
dockerfile: images/ci/Dockerfile
|
dockerfile: images/ci/Dockerfile
|
||||||
job_image: ubuntu:26.04@sha256:6a06111c3b0a8600feadb270aec771dc239bf407b25625f93f44ab00e11f4d3c
|
job_image: ubuntu:26.04@sha256:6a06111c3b0a8600feadb270aec771dc239bf407b25625f93f44ab00e11f4d3c
|
||||||
|
|||||||
@@ -6,8 +6,11 @@ name: Renovate
|
|||||||
# the repository secret RENOVATE_BOT_TOKEN (not an org secret: only image.yml may reference those).
|
# 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,
|
# 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
|
# which is the virtual user gitea-actions with the job token, and Gitea answers 400 "user does not
|
||||||
# exist" (dry run 2445). Unauthenticated GitHub lookups for the github.com pre-commit hooks may
|
# exist" (dry run 2445). No GitHub token exists (no RENOVATE_GITHUB_COM_TOKEN): the github-tags
|
||||||
# hit rate limits: best effort, no RENOVATE_GITHUB_COM_TOKEN exists.
|
# 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.
|
||||||
#
|
#
|
||||||
# Dry run: Actions > Renovate > Run workflow, dry_run=true (the default for a manual run), then
|
# Dry run: Actions > Renovate > Run workflow, dry_run=true (the default for a manual run), then
|
||||||
# read the debug log. The schedule runs live.
|
# read the debug log. The schedule runs live.
|
||||||
@@ -55,6 +58,9 @@ jobs:
|
|||||||
# Git auth: see the run block. The host the header is scoped to.
|
# Git auth: see the run block. The host the header is scoped to.
|
||||||
GIT_HOST_URL: ${{ github.server_url }}/
|
GIT_HOST_URL: ${{ github.server_url }}/
|
||||||
RENOVATE_GIT_AUTHOR: "Renovate Bot <[email protected]>"
|
RENOVATE_GIT_AUTHOR: "Renovate Bot <[email protected]>"
|
||||||
|
# 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"
|
||||||
# postUpgradeTasks may run exactly this one command (anchored, no wildcard); the JSON
|
# postUpgradeTasks may run exactly this one command (anchored, no wildcard); the JSON
|
||||||
# string holds a regex, hence the doubled backslash.
|
# string holds a regex, hence the doubled backslash.
|
||||||
RENOVATE_ALLOWED_COMMANDS: '["^python3 scripts/bump_image_versions\\.py origin/main$"]'
|
RENOVATE_ALLOWED_COMMANDS: '["^python3 scripts/bump_image_versions\\.py origin/main$"]'
|
||||||
|
|||||||
@@ -131,7 +131,15 @@ maintainer's production environment. Never reuse another Renovate credential her
|
|||||||
pip refuses an unhashed package and any disagreement between the two). Renovate's `pip-compile` manager bumps
|
pip refuses an unhashed package and any disagreement between the two). Renovate's `pip-compile` manager bumps
|
||||||
a pin and regenerates the lock by replaying the lock's header command; a weekly lock-file-maintenance PR
|
a pin and regenerates the lock by replaying the lock's header command; a weekly lock-file-maintenance PR
|
||||||
moves transitive packages and is never automerged. By hand: `scripts/lock-requirements.sh [--upgrade]`.
|
moves transitive packages and is never automerged. By hand: `scripts/lock-requirements.sh [--upgrade]`.
|
||||||
|
The header must hold only options Renovate knows: it refuses `--newline=LF` ("not supported (yet)"),
|
||||||
|
extracts nothing, and proposes no bump, with only a WARN in an otherwise green run.
|
||||||
Hook repositories in `.pre-commit-config.yaml` are pinned by commit SHA with a `# frozen: vX.Y.Z` comment.
|
Hook repositories in `.pre-commit-config.yaml` are pinned by commit SHA with a `# frozen: vX.Y.Z` comment.
|
||||||
|
Renovate looks them up with `git ls-remote` (packageRule `overrideDatasource: git-tags` plus
|
||||||
|
`RENOVATE_GITHUB_TOKEN_WARN=false` in `renovate.yml`), because there is no GitHub token and the default
|
||||||
|
`github-tags` lookup is skipped or rate limited. A hook bump is never automerged: `git-tags` has no release
|
||||||
|
timestamps, so `minimumReleaseAge` cannot delay it. After a Renovate config change, test it locally before
|
||||||
|
the merge: `renovate --platform=local` (same version as `renovate.yml`) reads this checkout; a dry run in
|
||||||
|
Actions reads `renovate.json` from `main`.
|
||||||
- **Bot-diff gate:** `scripts/check_bot_pr_diff.py` runs in the lint workflow, from `origin/main`'s copy so a
|
- **Bot-diff gate:** `scripts/check_bot_pr_diff.py` runs in the lint workflow, from `origin/main`'s copy so a
|
||||||
pull request cannot weaken it. A `renovate/` head ref may only change version lines (tool pins and their lock
|
pull request cannot weaken it. A `renovate/` head ref may only change version lines (tool pins and their lock
|
||||||
entries and hashes, hook `rev:` lines, Dockerfile FROM tags and digests, matrix `version:` lines, `job_image:` pins, consumer image pins);
|
entries and hashes, hook `rev:` lines, Dockerfile FROM tags and digests, matrix `version:` lines, `job_image:` pins, consumer image pins);
|
||||||
|
|||||||
@@ -179,6 +179,18 @@
|
|||||||
"git.rkdr.net/mortis/**"
|
"git.rkdr.net/mortis/**"
|
||||||
],
|
],
|
||||||
"automerge": true
|
"automerge": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"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.",
|
||||||
|
"matchManagers": [
|
||||||
|
"pre-commit"
|
||||||
|
],
|
||||||
|
"matchDatasources": [
|
||||||
|
"github-tags"
|
||||||
|
],
|
||||||
|
"overrideDatasource": "git-tags",
|
||||||
|
"overridePackageName": "https://github.com/{{{depName}}}",
|
||||||
|
"automerge": false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"lockFileMaintenance": {
|
"lockFileMaintenance": {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# This file is autogenerated by pip-compile with Python 3.13
|
# This file is autogenerated by pip-compile with Python 3.13
|
||||||
# by the following command:
|
# by the following command:
|
||||||
#
|
#
|
||||||
# pip-compile --allow-unsafe --generate-hashes --newline=LF --output-file=requirements-dev.lock --strip-extras requirements-dev.txt
|
# pip-compile --allow-unsafe --generate-hashes --output-file=requirements-dev.lock --strip-extras requirements-dev.txt
|
||||||
#
|
#
|
||||||
aiofiles==25.1.0 \
|
aiofiles==25.1.0 \
|
||||||
--hash=sha256:a8d728f0a29de45dc521f18f07297428d56992a742f0cd2701ba86e44d23d5b2 \
|
--hash=sha256:a8d728f0a29de45dc521f18f07297428d56992a742f0cd2701ba86e44d23d5b2 \
|
||||||
|
|||||||
@@ -18,6 +18,9 @@
|
|||||||
#
|
#
|
||||||
# Renovate runs the same command from the header of the lock (pip-compile manager, renovate.json),
|
# Renovate runs the same command from the header of the lock (pip-compile manager, renovate.json),
|
||||||
# so keep the header: do not add --no-header, and keep the flags below in step with renovate.json.
|
# so keep the header: do not add --no-header, and keep the flags below in step with renovate.json.
|
||||||
|
# Renovate's pip-compile manager refuses a header with an option it does not know ("Option
|
||||||
|
# --newline=LF not supported (yet)", dry run 3880): it then extracts nothing and proposes no bump.
|
||||||
|
# So no --newline here: pip-compile keeps the lock's own line endings (LF on Linux) by default.
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
pip_version="25.2"
|
pip_version="25.2"
|
||||||
@@ -44,6 +47,6 @@ trap 'rm -rf "$tmp"' EXIT
|
|||||||
cd "$root"
|
cd "$root"
|
||||||
# --allow-unsafe: setuptools is a dependency of a tool here, and pip refuses an unpinned
|
# --allow-unsafe: setuptools is a dependency of a tool here, and pip refuses an unpinned
|
||||||
# requirement in a file that carries hashes.
|
# requirement in a file that carries hashes.
|
||||||
"$tmp/venv/bin/pip-compile" --quiet --generate-hashes --strip-extras --allow-unsafe --newline lf \
|
"$tmp/venv/bin/pip-compile" --quiet --generate-hashes --strip-extras --allow-unsafe \
|
||||||
"${upgrade[@]}" --output-file requirements-dev.lock requirements-dev.txt
|
"${upgrade[@]}" --output-file requirements-dev.lock requirements-dev.txt
|
||||||
echo "requirements-dev.lock regenerated; commit it with requirements-dev.txt."
|
echo "requirements-dev.lock regenerated; commit it with requirements-dev.txt."
|
||||||
Reference in new issue
Block a user