docs: remove references to anything outside this repository
This repository is public and stands alone. Comments and prose no longer describe another repository, its documents, hosts, network or runner sizing; each one states its own reason or is gone. - Workflow headers keep the conclusions (disposable runner with no outside secret, the if: guard is not a boundary, no fork pull requests, the image build's memory cap) and drop the description. - Isolation lines are worded as a property of this repository. - The denied image namespace stays in check_image_versions.py, described only as a namespace this repository's CI must not use. - CLAUDE.md and CONTRIBUTING.md gain the standing rule and the search to run when bringing content in from another repository. - ci image 0.2.29 -> 0.2.30: .pre-commit-config.yaml and requirements-dev.txt are image inputs. The ADR 0004 pointers, the README Roadmap, the skills-source mentions and released changelog entries stay as they are. Closes #108 Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
This commit is contained in:
1 parent
ef0a1010f3
commit
3384ff2836
19 files changed
+83
-71
No files matched your search
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
# Same profile as the environment repo. The production profile enforces
|
# The production profile is ansible-lint's strictest. It enforces
|
||||||
# var-naming[no-role-prefix]: every role variable carries the role name as a prefix.
|
# var-naming[no-role-prefix]: every role variable carries the role name as a prefix.
|
||||||
profile: production
|
profile: production
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Runner labels used by the workflows, so actionlint accepts them. These belong
|
# Runner labels used by the workflows, so actionlint accepts them. These belong
|
||||||
# to the Collection's own runner (scoped to the mortis org); the production
|
# to the Collection's own runner (scoped to the mortis org). No other label is
|
||||||
# labels (docker, ubuntu-lxc, molecule) are deliberately not listed, so a
|
# listed, so a workflow that names one fails actionlint: this repository's jobs
|
||||||
# workflow that names one fails actionlint.
|
# run only on its own runners.
|
||||||
self-hosted-runner:
|
self-hosted-runner:
|
||||||
labels:
|
labels:
|
||||||
- kamino-docker
|
- kamino-docker
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ name: Images
|
|||||||
# - Layers: every layer stays far below Cloudflare's 100 MB request-body limit (see the
|
# - Layers: every layer stays far below Cloudflare's 100 MB request-body limit (see the
|
||||||
# Dockerfile). No kaniko cache: a tiny, rarely rebuilt image gains little, and cache
|
# Dockerfile). No kaniko cache: a tiny, rarely rebuilt image gains little, and cache
|
||||||
# layers would be pushed through the same Cloudflare-limited path.
|
# layers would be pushed through the same Cloudflare-limited path.
|
||||||
# - Memory: the runner LXC has 3 GB and capacity 1; the job container is capped at 2 GB.
|
# - Memory: the job container is capped at 2 GB, so a runaway build cannot exhaust the runner.
|
||||||
on: # yamllint disable-line rule:truthy
|
on: # yamllint disable-line rule:truthy
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
@@ -88,13 +88,13 @@ jobs:
|
|||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
job_image: ubuntu:26.04@sha256:d66b366dac61b575bee2aef07e9c26e8070096fbe84a3d4d3eb0da069b5d76db
|
job_image: ubuntu:26.04@sha256:d66b366dac61b575bee2aef07e9c26e8070096fbe84a3d4d3eb0da069b5d76db
|
||||||
- name: ci
|
- name: ci
|
||||||
version: 0.2.29
|
version: 0.2.30
|
||||||
subpath: ""
|
subpath: ""
|
||||||
dockerfile: images/ci/Dockerfile
|
dockerfile: images/ci/Dockerfile
|
||||||
job_image: ubuntu:26.04@sha256:d66b366dac61b575bee2aef07e9c26e8070096fbe84a3d4d3eb0da069b5d76db
|
job_image: ubuntu:26.04@sha256:d66b366dac61b575bee2aef07e9c26e8070096fbe84a3d4d3eb0da069b5d76db
|
||||||
container:
|
container:
|
||||||
image: ${{ matrix.job_image }}
|
image: ${{ matrix.job_image }}
|
||||||
# Keeps a runaway build from taking the whole 3 GB runner LXC down with it.
|
# Keeps a runaway build from taking the whole runner down with it.
|
||||||
options: --memory=2g --memory-swap=2g
|
options: --memory=2g --memory-swap=2g
|
||||||
env:
|
env:
|
||||||
DEBIAN_FRONTEND: noninteractive
|
DEBIAN_FRONTEND: noninteractive
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
name: Lint
|
name: Lint
|
||||||
|
|
||||||
# Runs on the Collection's own runner (label kamino-docker, scoped to the mortis org),
|
# Runs only on the Collection's own runner (label kamino-docker, scoped to the mortis org).
|
||||||
# never on the production runner. No org secret is used: the only credential is the
|
# No org secret is used: the only credential is the
|
||||||
# job token (secrets.GITHUB_TOKEN), which is read-only for a fork pull request. No pull_request_target.
|
# job token (secrets.GITHUB_TOKEN), which is read-only for a fork pull request. No pull_request_target.
|
||||||
# The tools come from the ci image (images/ci, built by image.yml): the pinned Python
|
# The tools come from the ci image (images/ci, built by image.yml): the pinned Python
|
||||||
# tools of requirements-dev.txt, the collections of requirements.yml and the hook
|
# tools of requirements-dev.txt, the collections of requirements.yml and the hook
|
||||||
@@ -44,7 +44,7 @@ jobs:
|
|||||||
ANSIBLE_COLLECTIONS_PATH: /opt/collections
|
ANSIBLE_COLLECTIONS_PATH: /opt/collections
|
||||||
steps:
|
steps:
|
||||||
# The container has no Node, so JavaScript actions such as actions/checkout
|
# The container has no Node, so JavaScript actions such as actions/checkout
|
||||||
# cannot run; clone with git and the job token, as the environment repo does.
|
# cannot run; clone with git and the job token.
|
||||||
- name: Checkout the commit under test
|
- name: Checkout the commit under test
|
||||||
env:
|
env:
|
||||||
GIT_CONFIG_COUNT: "1"
|
GIT_CONFIG_COUNT: "1"
|
||||||
|
|||||||
@@ -4,21 +4,15 @@ name: Molecule
|
|||||||
# extensions/molecule/*/ and roles/*/molecule/*/. extensions/molecule/image-smoke and
|
# extensions/molecule/*/ and roles/*/molecule/*/. extensions/molecule/image-smoke and
|
||||||
# image-smoke-2604 test the test images themselves, so they run even before any role exists.
|
# image-smoke-2604 test the test images themselves, so they run even before any role exists.
|
||||||
#
|
#
|
||||||
# It runs on the `kamino-molecule` label, a host executor on kamino-runner, which uses
|
# It runs on the `kamino-molecule` label, a host executor that uses the runner's own
|
||||||
# that LXC's own Docker daemon; no job container is given the Docker socket. That makes
|
# Docker daemon; no job container is given the Docker socket. That makes the job
|
||||||
# the job root-equivalent on the runner LXC, which is rebuildable and holds no
|
# root-equivalent on the runner, which is disposable and holds no secret from outside
|
||||||
# production secret (ADR 0004 in the maintainer's environment repository, Runner
|
# this repository (ADR 0004 in the maintainer's environment repository, Runner
|
||||||
# isolation). The runner sits in an isolated network segment (outbound DNS to two
|
# isolation). The `if:` guard is a convenience filter, not a boundary: a fork controls its
|
||||||
# resolvers and web traffic only; inbound SSH from two management hosts only), so a
|
# own workflow file. So the repository does not accept fork pull requests; the real
|
||||||
# scenario cannot reach the LAN. A live test on 2026-11-08 showed a fork pull request's
|
# condition is that only trusted people can push branches or open pull requests here.
|
||||||
# Build workflow starting on the runner at once, with no approval step (the tester may
|
|
||||||
# have had write access, so this is unproven for outsiders). The `if:` guard is a
|
|
||||||
# convenience filter, not a boundary: a fork controls its own workflow file. So the
|
|
||||||
# repository should not accept fork pull requests from untrusted users until the
|
|
||||||
# operator decides otherwise; the real condition is that only trusted people can push
|
|
||||||
# branches or open pull requests here.
|
|
||||||
#
|
#
|
||||||
# The molecule venv is provisioned on the runner by the gitea_runner role. The collections
|
# The molecule venv is provisioned on the runner, not by this workflow. The collections
|
||||||
# the roles use are this repository's own pins (requirements.yml, the file the ci image bakes
|
# the roles use are this repository's own pins (requirements.yml, the file the ci image bakes
|
||||||
# for Lint), and the driver's own collection is pinned in extensions/molecule/requirements.yml:
|
# for Lint), and the driver's own collection is pinned in extensions/molecule/requirements.yml:
|
||||||
# the job installs both, cached on the runner by their checksum. The test image is pulled from
|
# the job installs both, cached on the runner by their checksum. The test image is pulled from
|
||||||
@@ -53,8 +47,8 @@ permissions:
|
|||||||
# same rule as lint.yml and build.yml); a run on main is never cancelled, so its group is the
|
# same rule as lint.yml and build.yml); a run on main is never cancelled, so its group is the
|
||||||
# commit SHA. Scenarios use fixed container names on the runner's shared Docker daemon, so two
|
# commit SHA. Scenarios use fixed container names on the runner's shared Docker daemon, so two
|
||||||
# runs must not overlap. The group no longer guarantees that (it is per pull request now): the
|
# runs must not overlap. The group no longer guarantees that (it is per pull request now): the
|
||||||
# runner's single slot does (gitea_runner_capacity: 1 in the maintainer's environment
|
# runner's single slot does. Raise the runner's capacity and this needs a lock or a shared
|
||||||
# repository). Raise that capacity and this needs a lock or a shared group again.
|
# group again.
|
||||||
concurrency:
|
concurrency:
|
||||||
group: molecule-${{ github.event_name == 'pull_request' && github.ref || github.sha }}
|
group: molecule-${{ github.event_name == 'pull_request' && github.ref || github.sha }}
|
||||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||||
@@ -82,12 +76,12 @@ jobs:
|
|||||||
MOLECULE_IMAGE_2604: >-
|
MOLECULE_IMAGE_2604: >-
|
||||||
git.rkdr.net/mortis/molecule-ubuntu2604:0.1.5@sha256:4ba40ee3603a33778254f22bc0f9360b9f7dd0ed5c03c5b2f935186c7b84dd6f
|
git.rkdr.net/mortis/molecule-ubuntu2604:0.1.5@sha256:4ba40ee3603a33778254f22bc0f9360b9f7dd0ed5c03c5b2f935186c7b84dd6f
|
||||||
steps:
|
steps:
|
||||||
# The molecule venv is provisioned by the gitea_runner role (install_services); fail with
|
# The molecule venv is provisioned on the runner, not by this job; fail with a clear
|
||||||
# a clear message when this runs before it has.
|
# message when it is missing.
|
||||||
- name: Check the provisioned tooling
|
- name: Check the provisioned tooling
|
||||||
run: |
|
run: |
|
||||||
if ! test -x "$MOLECULE_VENV/bin/molecule"; then
|
if ! test -x "$MOLECULE_VENV/bin/molecule"; then
|
||||||
echo "::error::molecule is not installed on this runner: run install_services for kamino-runner first"
|
echo "::error::molecule is not installed on this runner: provision its molecule venv first"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
docker version --format '{{.Server.Version}}' || { echo "::error::the Docker daemon is not reachable by the runner user"; exit 1; }
|
docker version --format '{{.Server.Version}}' || { echo "::error::the Docker daemon is not reachable by the runner user"; exit 1; }
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
name: Renovate
|
name: Renovate
|
||||||
|
|
||||||
# Dependency updates for this repository (renovate.json). Runs on the Collection's own runner
|
# Dependency updates for this repository (renovate.json). Runs only on the Collection's own runner
|
||||||
# (label kamino-docker, the untrusted side), never in the production cluster: code from this
|
# (label kamino-docker), and no credential from anywhere else is used here.
|
||||||
# repository must not run there. The credential is the token of a Kamino-only bot user, held as
|
# 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 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
|
||||||
@@ -43,8 +43,8 @@ jobs:
|
|||||||
if: github.repository == 'mortis/kamino' || github.repository == 'Mortis/Kamino'
|
if: github.repository == 'mortis/kamino' || github.repository == 'Mortis/Kamino'
|
||||||
runs-on: kamino-docker
|
runs-on: kamino-docker
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
# Docker Hub image, pinned by digest like the cluster's CronJob (same version). The -full
|
# Docker Hub image, pinned by digest. The -full flavour ships python3 for the
|
||||||
# flavour ships python3 for the postUpgradeTasks command. Hand-bumped: renovate.json
|
# postUpgradeTasks command. Hand-bumped: renovate.json
|
||||||
# disables updates for this file. The image sets RENOVATE_BINARY_SOURCE=global, so pip-compile
|
# 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
|
# 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
|
# reads from the lock header: that python's minor version must equal .python-version, or a lock
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@ vault-pass*
|
|||||||
gitleaks-report.json
|
gitleaks-report.json
|
||||||
# galaxy-importer output
|
# galaxy-importer output
|
||||||
importer_result.json
|
importer_result.json
|
||||||
# APM (holocron skills): apm_modules/ is the dependency cache; .claude/skills,
|
# APM: apm_modules/ is the dependency cache; .claude/skills,
|
||||||
# agents and hooks are `apm install` deploy output, regenerated on every install.
|
# agents and hooks are `apm install` deploy output, regenerated on every install.
|
||||||
apm_modules/
|
apm_modules/
|
||||||
.claude/skills/
|
.claude/skills/
|
||||||
|
|||||||
@@ -69,8 +69,8 @@ repos:
|
|||||||
# once it fails (a global fail_fast would hide every other failure).
|
# once it fails (a global fail_fast would hide every other failure).
|
||||||
- repo: local
|
- repo: local
|
||||||
hooks:
|
hooks:
|
||||||
# REUSE compliance (licence files, SPDX data, REUSE.toml; docs/licensing.md in the
|
# REUSE compliance (licence files, SPDX data, REUSE.toml). The wrapper tolerates only
|
||||||
# environment repo). The wrapper tolerates only unused licence texts, see its docstring.
|
# unused licence texts, see its docstring.
|
||||||
- id: reuse-lint
|
- id: reuse-lint
|
||||||
name: REUSE compliance
|
name: REUSE compliance
|
||||||
description: reuse lint, tolerating unused licence texts until the roles arrive
|
description: reuse lint, tolerating unused licence texts until the roles arrive
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ Guidance for Claude Code (claude.ai/code) in this repository.
|
|||||||
|
|
||||||
## What this is
|
## What this is
|
||||||
|
|
||||||
`mortis.kamino`: an Ansible Collection (GPL-3.0-or-later, REUSE-compliant), extracted role by
|
`mortis.kamino`: an Ansible Collection (GPL-3.0-or-later, REUSE-compliant) of reusable,
|
||||||
role from the author's homelab environment repository. The design contract is ADR 0004 (in the
|
hardened roles. The design contract is ADR 0004 (in the
|
||||||
maintainer's environment repository). Roles arrive here wave by wave; `docker` is in 1.0.0, `fail2ban` in 1.1.0, `network_interfaces` and `systemd_hardening` in 1.2.0, `system_baseline` in 1.3.0, `ufw` in 1.4.0; 1.5.0 adds no role (new `system_baseline` options); `sshd` in 1.6.0; `user_management` in 1.7.0; `traefik`, with the internal `_binary_update`, in 1.8.0.
|
maintainer's environment repository). Roles arrive here wave by wave; `docker` is in 1.0.0, `fail2ban` in 1.1.0, `network_interfaces` and `systemd_hardening` in 1.2.0, `system_baseline` in 1.3.0, `ufw` in 1.4.0; 1.5.0 adds no role (new `system_baseline` options); `sshd` in 1.6.0; `user_management` in 1.7.0; `traefik`, with the internal `_binary_update`, in 1.8.0.
|
||||||
|
|
||||||
**Roadmap.** The roles still to come, and the ones that will never be extracted, are listed in
|
**Roadmap.** The roles still to come, and the ones that will never be extracted, are listed in
|
||||||
@@ -39,6 +39,13 @@ or create tags: those are the operator's.
|
|||||||
hook run builds the Go hook environments and takes minutes: run commits in the background.
|
hook run builds the Go hook environments and takes minutes: run commits in the background.
|
||||||
`git push` also runs `ansible-test sanity` on HEAD (`scripts/ansible-test-sanity.sh`, the Build
|
`git push` also runs `ansible-test sanity` on HEAD (`scripts/ansible-test-sanity.sh`, the Build
|
||||||
job's check, which ruff and the other hooks do not cover); its first run builds virtualenvs and takes minutes.
|
job's check, which ruff and the other hooks do not cover); its first run builds virtualenvs and takes minutes.
|
||||||
|
- **This repository stands alone.** No tracked file, issue or pull request text or comment,
|
||||||
|
release note or job output refers to another repository of the maintainer's, its documents,
|
||||||
|
hosts, network or namespaces, or states host sizing. Every comment states its own reason. When
|
||||||
|
bringing content in from another repository, before committing, search the incoming diff for
|
||||||
|
mentions of the source repository, its documents, hostnames, addresses, account namespaces and
|
||||||
|
sibling paths; rewrite comments so they stand alone; say in the pull request what was searched
|
||||||
|
for. No control holds this rule, and it has no expiry.
|
||||||
- Feature branch and pull request; `main` and `v*` tags are protected. Never push to `main`.
|
- Feature branch and pull request; `main` and `v*` tags are protected. Never push to `main`.
|
||||||
Releases are the operator's: annotated `vX.Y.Z` tags equal to `galaxy.yml`'s version.
|
Releases are the operator's: annotated `vX.Y.Z` tags equal to `galaxy.yml`'s version.
|
||||||
- Conventional Commits. A PR says what was verified and what was not.
|
- Conventional Commits. A PR says what was verified and what was not.
|
||||||
@@ -128,8 +135,8 @@ Single-context: `GLOSSARY.md` and `docs/adr/` at the root, both created lazily.
|
|||||||
## Dependency automation (Renovate)
|
## Dependency automation (Renovate)
|
||||||
|
|
||||||
`renovate.json` is run by `.gitea/workflows/renovate.yml` (daily cron and `workflow_dispatch`) on the
|
`renovate.json` is run by `.gitea/workflows/renovate.yml` (daily cron and `workflow_dispatch`) on the
|
||||||
`kamino-docker` runner, as a Kamino-only bot user, so code from this repository never runs in the
|
`kamino-docker` runner, as a Kamino-only bot user: this repository's jobs run only on its own
|
||||||
maintainer's production environment. Never reuse another Renovate credential here.
|
runners, and no credential from anywhere else is used here. Never reuse another Renovate credential here.
|
||||||
|
|
||||||
- **Policy:** minor and patch bumps automerge, majors are manual; the Lint and Build checks are the gate.
|
- **Policy:** minor and patch bumps automerge, majors are manual; the Lint and Build checks are the gate.
|
||||||
A new Ubuntu release is a deliberate edit, never a bump. The `job_image` of each matrix entry in `image.yml`
|
A new Ubuntu release is a deliberate edit, never a bump. The `job_image` of each matrix entry in `image.yml`
|
||||||
@@ -164,8 +171,8 @@ maintainer's production environment. Never reuse another Renovate credential her
|
|||||||
constrains the bot's own pull requests.
|
constrains the bot's own pull requests.
|
||||||
- **No Collection release from tooling bumps:** tooling files are in `galaxy.yml` `build_ignore`. A
|
- **No Collection release from tooling bumps:** tooling files are in `galaxy.yml` `build_ignore`. A
|
||||||
role-visible change needs a changelog fragment and a new `galaxy.yml` version; only the operator tags.
|
role-visible change needs a changelog fragment and a new `galaxy.yml` version; only the operator tags.
|
||||||
- **No production images:** `check_image_versions.py pins` fails when anything under `.gitea/workflows`
|
- **Denied image namespace:** `check_image_versions.py pins` fails when anything under `.gitea/workflows`
|
||||||
mentions the maintainer's production image namespace.
|
mentions the image namespace this repository's CI must not use (the string is in the script).
|
||||||
- **Hand edits on a bot branch:** a commit pushed by hand to a `renovate/` branch makes Renovate stop
|
- **Hand edits on a bot branch:** a commit pushed by hand to a `renovate/` branch makes Renovate stop
|
||||||
rebasing it, so merge that pull request by hand.
|
rebasing it, so merge that pull request by hand.
|
||||||
- **The runner has a single slot:** the Renovate job (up to 30 minutes) delays Lint, Build and Molecule.
|
- **The runner has a single slot:** the Renovate job (up to 30 minutes) delays Lint, Build and Molecule.
|
||||||
|
|||||||
+9
-5
@@ -2,10 +2,14 @@
|
|||||||
|
|
||||||
- Open a pull request against `main`. The forge does not allow self-registration, so only
|
- Open a pull request against `main`. The forge does not allow self-registration, so only
|
||||||
accounts the maintainer has created can open pull requests or issues for now. Fork
|
accounts the maintainer has created can open pull requests or issues for now. Fork
|
||||||
pull requests are not a supported path: a fork controls its own workflow file, and a test
|
pull requests are not a supported path: a fork controls its own workflow file. Workflows on fork pull requests get
|
||||||
showed workflows starting without an approval step. Workflows on fork pull requests get
|
|
||||||
no secrets and a read-only token. To discuss a contribution, write to the address in
|
no secrets and a read-only token. To discuss a contribution, write to the address in
|
||||||
`SECURITY.md`.
|
`SECURITY.md`.
|
||||||
|
- This repository stands alone: nothing public here (a tracked file, issue or pull request
|
||||||
|
text or comment, release note or job output) refers to another repository of the maintainer's, its
|
||||||
|
documents, hosts, network or namespaces, or states host sizing. When you bring content in
|
||||||
|
from another repository, search the incoming diff for such mentions before committing,
|
||||||
|
rewrite comments so they stand alone, and say in the pull request what you searched for.
|
||||||
- Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/)
|
- Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/)
|
||||||
(`feat:`, `fix:`, `docs:`, `ci:` ...). CI checks every commit.
|
(`feat:`, `fix:`, `docs:`, `ci:` ...). CI checks every commit.
|
||||||
- Every user-visible change needs a changelog fragment in `changelogs/fragments/`
|
- Every user-visible change needs a changelog fragment in `changelogs/fragments/`
|
||||||
@@ -49,14 +53,14 @@
|
|||||||
bumps the version and tags.
|
bumps the version and tags.
|
||||||
- `renovate.json` configures dependency bumps (minor and patch automerge, majors by hand). Renovate
|
- `renovate.json` configures dependency bumps (minor and patch automerge, majors by hand). Renovate
|
||||||
runs for this repository in `.gitea/workflows/renovate.yml` (daily cron on the Collection's own
|
runs for this repository in `.gitea/workflows/renovate.yml` (daily cron on the Collection's own
|
||||||
runner, as a Kamino-only bot user (repository secret `RENOVATE_BOT_TOKEN`); no cluster code involved). To dry-run after changing the
|
runner, as a Kamino-only bot user (repository secret `RENOVATE_BOT_TOKEN`); no credential from anywhere else is used). To dry-run after changing the
|
||||||
config: Actions > Renovate > Run workflow with `dry_run=true`, then read the debug log (the job fails on a failed clone or an ERROR problem). The dry run
|
config: Actions > Renovate > Run workflow with `dry_run=true`, then read the debug log (the job fails on a failed clone or an ERROR problem). The dry run
|
||||||
proves reads (and runs the post-upgrade task); whether the bot can push and open a pull
|
proves reads (and runs the post-upgrade task); whether the bot can push and open a pull
|
||||||
request, and whether such pull requests start the PR workflows, only the first live run shows
|
request, and whether such pull requests start the PR workflows, only the first live run shows
|
||||||
(open item, see CLAUDE.md). Pull requests from `renovate/` branches must pass
|
(open item, see CLAUDE.md). Pull requests from `renovate/` branches must pass
|
||||||
`scripts/check_bot_pr_diff.py`, which only allows version, tag, digest and pin lines.
|
`scripts/check_bot_pr_diff.py`, which only allows version, tag, digest and pin lines.
|
||||||
- Workflows must not mention `git.rkdr.net/defame1297/` (the production image set); the
|
- Workflows must not mention `git.rkdr.net/defame1297/` (an image namespace this repository's
|
||||||
`Check image pins` step fails if they do.
|
CI must not use); the `Check image pins` step fails if they do.
|
||||||
|
|
||||||
## Maintainer setup
|
## Maintainer setup
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ SPDX-FileCopyrightText = "Defame1297 and contributors"
|
|||||||
SPDX-License-Identifier = "GPL-3.0-or-later"
|
SPDX-License-Identifier = "GPL-3.0-or-later"
|
||||||
|
|
||||||
# Third-party-derived content, so files without a header do not fall back to the
|
# Third-party-derived content, so files without a header do not fall back to the
|
||||||
# Collection default (docs/licensing.md in the environment repo). "override"
|
# Collection default. "override"
|
||||||
# wins over the default and over any header. Later entries win over earlier ones.
|
# wins over the default and over any header. Later entries win over earlier ones.
|
||||||
# These paths arrive with their roles (wave 1 and 2).
|
# These paths arrive with their roles (wave 1 and 2).
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ license: GPL-3.0-or-later
|
|||||||
|
|
||||||
# Consumer side: holocron plugins are addressed as git+path objects rather than
|
# Consumer side: holocron plugins are addressed as git+path objects rather than
|
||||||
# <name>@holocron marketplace aliases, so nothing outside this manifest is
|
# <name>@holocron marketplace aliases, so nothing outside this manifest is
|
||||||
# needed. Unpinned (default branch) on purpose, matching ../ansible and
|
# needed. Unpinned (default branch) on purpose: Renovate cannot keep a pin
|
||||||
# ../ai-development: Renovate cannot keep a pin current here. Its apm manager
|
# current here. Its apm manager documents only the string form (not these
|
||||||
# documents only the string form (not these git+path objects), is not in
|
# git+path objects), is not in
|
||||||
# renovate.json's enabledManagers, and holocron's v* tags are repo-wide and
|
# renovate.json's enabledManagers, and holocron's v* tags are repo-wide and
|
||||||
# lag main (v2.0.1 is 164 commits behind and predates plugins/mattpocock). A
|
# lag main (v2.0.1 is 164 commits behind and predates plugins/mattpocock). A
|
||||||
# hand-kept ref would just go stale. The third-party skills are pinned inside
|
# hand-kept ref would just go stale. The third-party skills are pinned inside
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
A disposable **Ubuntu 24.04** test target for the molecule scenarios of the
|
A disposable **Ubuntu 24.04** test target for the molecule scenarios of the
|
||||||
[`mortis.kamino`](https://git.rkdr.net/mortis/kamino) Ansible Collection: a container that behaves like a small
|
[`mortis.kamino`](https://git.rkdr.net/mortis/kamino) Ansible Collection: a container that behaves like a small
|
||||||
24.04 host (systemd as PID 1), so a role can be converged and verified in it without a VM.
|
24.04 host (systemd as PID 1), so a role can be converged and verified in it without a VM.
|
||||||
It is the release of the home lab's LXC hosts today.
|
It is the release the hosts run today.
|
||||||
|
|
||||||
## What is in it
|
## What is in it
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
# ansible-core 2.19 is what the environment repo's CI image pins
|
# The roles were written against ansible-core 2.19 and nothing older has been
|
||||||
# (ci_python_tool_ansible_core_version). Raise this when a role needs a newer
|
# tested. Raise this when a role needs a newer core; lowering it needs the molecule and
|
||||||
# core; lowering it needs the molecule and sanity runs on the older core first.
|
# sanity runs on the older core first.
|
||||||
requires_ansible: ">=2.19.0"
|
requires_ansible: ">=2.19.0"
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
"description": "Run by .gitea/workflows/renovate.yml on the kamino-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. The top-level postUpgradeTasks runs scripts/bump_image_versions.py on every branch, lock refreshes included, which carry no package a packageRule could match (allowed by RENOVATE_ALLOWED_COMMANDS of .gitea/workflows/renovate.yml, where Renovate runs).",
|
"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. The top-level postUpgradeTasks runs scripts/bump_image_versions.py on every branch, lock refreshes included, which carry no package a packageRule could match (allowed by RENOVATE_ALLOWED_COMMANDS of .gitea/workflows/renovate.yml, where Renovate runs).",
|
||||||
"extends": [
|
"extends": [
|
||||||
"config:recommended",
|
"config:recommended",
|
||||||
":enablePreCommit"
|
":enablePreCommit"
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
# package too, with the sha256 of each release file) and is what gets installed; pip refuses an
|
# package too, with the sha256 of each release file) and is what gets installed; pip refuses an
|
||||||
# install in which the two files disagree. Renovate bumps a pin here and regenerates the lock
|
# install in which the two files disagree. Renovate bumps a pin here and regenerates the lock
|
||||||
# (pip-compile manager); by hand, run scripts/lock-requirements.sh and commit both files (#113).
|
# (pip-compile manager); by hand, run scripts/lock-requirements.sh and commit both files (#113).
|
||||||
# ansible-core and ansible-lint started equal to the environment repo's runner image
|
|
||||||
# (hosts/group_vars/all/ci_python_tools.yml there) and are no longer kept equal automatically.
|
|
||||||
# Renovate (renovate.json) bumps these pins; a bump rebuilds the ci image (images/ci) and
|
# Renovate (renovate.json) bumps these pins; a bump rebuilds the ci image (images/ci) and
|
||||||
# Renovate then moves the consumers' pins to it.
|
# Renovate then moves the consumers' pins to it.
|
||||||
ansible-core==2.22.0
|
ansible-core==2.22.0
|
||||||
|
|||||||
@@ -12,9 +12,8 @@ cannot make a tag immutable), so an image whose content changes under an unchang
|
|||||||
version is pushed as sha-*/latest only, and a hand-pasted <version>@<new digest> pin
|
version is pushed as sha-*/latest only, and a hand-pasted <version>@<new digest> pin
|
||||||
would pair a tag with a digest it does not point to.
|
would pair a tag with a digest it does not point to.
|
||||||
|
|
||||||
pins No file under .gitea/workflows may mention `git.rkdr.net/defame1297/`: the production
|
pins No file under .gitea/workflows may mention `git.rkdr.net/defame1297/`: an image
|
||||||
image set of the environment repo never belongs in this CI (the `mortis` side is the
|
namespace this repository's CI must not use (ADR 0004 Runner isolation).
|
||||||
untrusted one, ADR 0004 Runner isolation).
|
|
||||||
Every `git.rkdr.net/mortis/<name>:<version>@sha256:<digest>` in the consumer
|
Every `git.rkdr.net/mortis/<name>:<version>@sha256:<digest>` in the consumer
|
||||||
workflows must name an image of the matrix, with a well-formed digest and a
|
workflows must name an image of the matrix, with a well-formed digest and a
|
||||||
version that is not newer than the matrix (a pin lags the matrix between the PR
|
version that is not newer than the matrix (a pin lags the matrix between the PR
|
||||||
@@ -80,7 +79,7 @@ ANY_PIN_RE = re.compile(
|
|||||||
r"""(?:[:@][^\s,)\]}'"]*)?""",
|
r"""(?:[:@][^\s,)\]}'"]*)?""",
|
||||||
re.IGNORECASE,
|
re.IGNORECASE,
|
||||||
)
|
)
|
||||||
# The production image namespace of the environment repo; any spelling of the host's case.
|
# An image namespace this repository's CI must not use; any spelling of the host's case.
|
||||||
FOREIGN_RE = re.compile(r"git\.rkdr\.net(?::[0-9]+)?/defame1297/", re.IGNORECASE)
|
FOREIGN_RE = re.compile(r"git\.rkdr\.net(?::[0-9]+)?/defame1297/", re.IGNORECASE)
|
||||||
WORKFLOW_DIR = ".gitea/workflows"
|
WORKFLOW_DIR = ".gitea/workflows"
|
||||||
# Semver 2.0.0: no leading zeros in numeric identifiers (core or prerelease).
|
# Semver 2.0.0: no leading zeros in numeric identifiers (core or prerelease).
|
||||||
@@ -644,10 +643,10 @@ def changed_images(head_matrix, changed, read_head_file):
|
|||||||
|
|
||||||
|
|
||||||
def check_foreign_images(workflow_texts):
|
def check_foreign_images(workflow_texts):
|
||||||
"""Errors for each workflow file that mentions the production image namespace, comments included."""
|
"""Errors for each workflow file that mentions the denied image namespace, comments included."""
|
||||||
return [
|
return [
|
||||||
f"{fname}: mentions git.rkdr.net/defame1297/, the production image set; the Collection's CI "
|
f"{fname}: mentions git.rkdr.net/defame1297/, an image namespace this repository's CI "
|
||||||
"must never use or name it"
|
"must not use or name"
|
||||||
for fname, text in sorted(workflow_texts.items())
|
for fname, text in sorted(workflow_texts.items())
|
||||||
if FOREIGN_RE.search(text)
|
if FOREIGN_RE.search(text)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
"""Run `reuse lint`, tolerating only unused licence texts.
|
"""Run `reuse lint`, tolerating only unused licence texts.
|
||||||
|
|
||||||
LICENSES/ carries the texts docs/licensing.md lists (GPL-3.0-only, Apache-2.0, MIT,
|
LICENSES/ carries licence texts (GPL-3.0-only, Apache-2.0, MIT,
|
||||||
EUPL-1.2) before the roles that use them exist; reuse >= 6 reports those as
|
EUPL-1.2) before the roles that use them exist; reuse >= 6 reports those as
|
||||||
non-compliant. Every other finding still fails. Once the extraction waves have brought
|
non-compliant. Every other finding still fails. Once the extraction waves have brought
|
||||||
in files for all of them, delete UNUSED_ALLOWED and call `reuse lint` directly.
|
in files for all of them, delete UNUSED_ALLOWED and call `reuse lint` directly.
|
||||||
|
|||||||
@@ -129,9 +129,9 @@ class PureTest(unittest.TestCase):
|
|||||||
def matrix(self, mol="0.1.0", ci="0.2.0"):
|
def matrix(self, mol="0.1.0", ci="0.2.0"):
|
||||||
return civ.matrix_of(IMAGE_YML.format(mol=mol, ci=ci))
|
return civ.matrix_of(IMAGE_YML.format(mol=mol, ci=ci))
|
||||||
|
|
||||||
def test_foreign_production_images_are_denied(self):
|
def test_images_of_the_denied_namespace_are_refused(self):
|
||||||
for text in (
|
for text in (
|
||||||
"image: git.rkdr.net/defame1297/gitea-ansible-runner:1@sha256:" + "a" * 64,
|
"image: git.rkdr.net/defame1297/some-image:1@sha256:" + "a" * 64,
|
||||||
"# GIT.RKDR.NET:443/Defame1297/x",
|
"# GIT.RKDR.NET:443/Defame1297/x",
|
||||||
"image: git.rkdr.net/defame1297/y",
|
"image: git.rkdr.net/defame1297/y",
|
||||||
):
|
):
|
||||||
@@ -139,10 +139,20 @@ class PureTest(unittest.TestCase):
|
|||||||
for text in (
|
for text in (
|
||||||
"image: git.rkdr.net/mortis/ci:0.2.0",
|
"image: git.rkdr.net/mortis/ci:0.2.0",
|
||||||
"https://git.rkdr.net/defame1297x",
|
"https://git.rkdr.net/defame1297x",
|
||||||
"see Defame1297/ansible-homelab-mono",
|
"see Defame1297/some-repository",
|
||||||
):
|
):
|
||||||
self.assertEqual(civ.check_foreign_images({"w.yml": text}), [], text)
|
self.assertEqual(civ.check_foreign_images({"w.yml": text}), [], text)
|
||||||
|
|
||||||
|
def test_the_refusal_names_the_namespace_and_nothing_about_its_use(self):
|
||||||
|
(message,) = civ.check_foreign_images(
|
||||||
|
{"w.yml": "image: git.rkdr.net/defame1297/y"}
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
message,
|
||||||
|
"w.yml: mentions git.rkdr.net/defame1297/, an image namespace this repository's CI "
|
||||||
|
"must not use or name",
|
||||||
|
)
|
||||||
|
|
||||||
def test_pins_ok_and_lagging(self):
|
def test_pins_ok_and_lagging(self):
|
||||||
pin = f"image: git.rkdr.net/mortis/ci:0.1.0@{DIGEST}\n"
|
pin = f"image: git.rkdr.net/mortis/ci:0.1.0@{DIGEST}\n"
|
||||||
self.assertEqual(civ.check_pins(self.matrix(), {"lint.yml": pin}), [])
|
self.assertEqual(civ.check_pins(self.matrix(), {"lint.yml": pin}), [])
|
||||||
@@ -717,7 +727,7 @@ class GitTest(unittest.TestCase):
|
|||||||
self.assertIn(text, err)
|
self.assertIn(text, err)
|
||||||
self.assertEqual(len(err.strip().splitlines()), 1, err)
|
self.assertEqual(len(err.strip().splitlines()), 1, err)
|
||||||
|
|
||||||
def test_pins_cli_denies_a_production_image_in_any_workflow(self):
|
def test_pins_cli_refuses_the_denied_namespace_in_any_workflow(self):
|
||||||
self.write(".gitea/workflows/lint.yml", "name: Lint\n")
|
self.write(".gitea/workflows/lint.yml", "name: Lint\n")
|
||||||
self.assertEqual(self.bump_args("pins")[0], 0)
|
self.assertEqual(self.bump_args("pins")[0], 0)
|
||||||
self.write(
|
self.write(
|
||||||
|
|||||||
Reference in new issue
Block a user