ci: lint the rendered role templates #466

Stängd
öppnade 2026-09-08 23:04:27 +00:00 av supernaut · 1 kommentar
Ägare

Twelve roles/*/templates/*.sh.j2 and roles/backup-drill/templates/bitborg-backup-drill.py.j2 are linted by nothing. scripts/shellcheck.sh targets scripts/*.sh, and ruff cannot parse Jinja. These run as timers that delete registry packages, boot VMs and restore backups.

Add a script that renders each template with the role defaults (the same approach as scripts/check-alert-rules.py), then runs the shellcheck and ruff wrappers on the output. Wire it into CI and lefthook.

Twelve `roles/*/templates/*.sh.j2` and `roles/backup-drill/templates/bitborg-backup-drill.py.j2` are linted by nothing. `scripts/shellcheck.sh` targets `scripts/*.sh`, and ruff cannot parse Jinja. These run as timers that delete registry packages, boot VMs and restore backups. Add a script that renders each template with the role defaults (the same approach as `scripts/check-alert-rules.py`), then runs the shellcheck and ruff wrappers on the output. Wire it into CI and lefthook.
Upphovsperson
Ägare

Audit note. Two more gaps in the lint scope, same shape as this issue.

  • scripts/shellcheck.sh:35 globs scripts/*.sh only. ansible/roles/*/files/*.sh (for example roles/keycloak/files/healthcheck.sh) is never linted. Add that glob now. It needs no rendering.
  • scripts/smoke-textfile.py SEARCH_GLOBS (:21-23) omits roles/*/files/*.py. controller.py and renovate_dashboard_exporter.py write .prom files. Both are safe today.

Separately, lefthook.json pre-push (:36-90) lacks four cheap checks that CI runs: check-no-password-output, the Renovate exporter test, tofu-apply --self-test and the two smoke scripts. A push can pass the hook and fail CI.

Audit note. Two more gaps in the lint scope, same shape as this issue. - `scripts/shellcheck.sh:35` globs `scripts/*.sh` only. `ansible/roles/*/files/*.sh` (for example `roles/keycloak/files/healthcheck.sh`) is never linted. Add that glob now. It needs no rendering. - `scripts/smoke-textfile.py` `SEARCH_GLOBS` (`:21-23`) omits `roles/*/files/*.py`. `controller.py` and `renovate_dashboard_exporter.py` write `.prom` files. Both are safe today. Separately, `lefthook.json` pre-push (`:36-90`) lacks four cheap checks that CI runs: `check-no-password-output`, the Renovate exporter test, `tofu-apply --self-test` and the two smoke scripts. A push can pass the hook and fail CI.
supernaut refererade till detta ärende från en incheckning 2026-10-18 11:17:09 +00:00
supernaut refererade till detta ärende från en incheckning 2026-10-18 11:37:34 +00:00
supernaut refererade till detta ärende från en incheckning 2026-10-18 11:41:43 +00:00
Logga in för att delta i denna konversation.
Ingen milstolpe
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-infra#466
Ingen beskrivning angiven.