fix: allowedCommands, and validate the things that validate #61
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/validate-the-validators"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes the failure in #59 and closes the gap that let it ship.
The bug
I wrote
allowedPostUpgradeCommands. Renovate's docs are explicit: "Thisconfiguration option was formerly known as
allowedPostUpgradeCommands."Why nothing caught it
The
renovate-config-validatorhook is scoped^renovate.json$and passes--no-global, so it checks this repo's config against the repositoryschema. The self-hosted config is a different schema and was never checked
at all. The old name is still valid repository config — so it validated clean,
was ignored at run time, and surfaced hours later in a PR.
scripts/ci/check-renovate-global-config.shvalidates it as global config.Verified against three states:
allowedPostUpgradeCommandsInvalid configuration optionThe Renovate version is read from the CronJob image tag, not pinned again — a
second copy would sit in
scripts/ci/, which no custom manager targets, so itwould age silently while looking maintained.
Auditing every other validator
One more gap, latent:
kube-linter,kubeconform,promtoolandhelm-rendermatched
\.yaml$whileno-secret-manifestsmatched\.ya?ml$. A.ymlmanifest would have been checked for Secrets and skipped schema validation and
security linting. The repo already uses
.ymlelsewhere.scripts/grafana-dashboards/renovate.jsonlooked like a gap but is a deliberateexclusion — a Grafana dashboard that happens to share the name. It's recorded in
expected_gap()with its reason.tests/hook-coverage.bats
States what each validator is responsible for and fails when its pattern stops
reaching all of it. This is the fourth time this class of bug has cost time
here: the bats hook that never fired on its own subjects, markdownlint "passing"
an untracked file, the Renovate global config, and now
.yamlvs.ya?ml.Verified by reverting
kubeconformto.yaml$with a.ymlmanifest present —it names the file — and by breaking the bats pattern, which names
renovate.jsonand
README.md.v8r
Validates the repo's own config files against their published schemas:
.pre-commit-config.yaml,mise.toml,.markdownlint.yml,.yamllint.yml,.v8rrc.yml,renovate.json.check-yaml/check-json/taploparse these;none looks at whether the keys inside exist or hold the right type.
It ships no
.pre-commit-hooks.yaml, so it's a local hook with the binary pinnedvia mise's
npm:backend, asmarkdownlint-clialready is.Confirmed it catches real errors:
Deliberately excluded, with reasons in
.v8rrc.yml: Kubernetes manifests(kubeconform validates them against real API schemas including CRDs, which
SchemaStore cannot) and
.forgejo/workflows/(v8r resolves them to GitHub'sworkflow schema, which is not the CI system running here; actionlint covers
them).
renovate.jsonmatched multiple SchemaStore entries, so.v8rrc.ymlnames the schema explicitly.
One trade-off: v8r fetches schemas over the network and caches them, so a first
run offline fails rather than passing quietly.
Verification
All hooks pass, 48 bats tests pass.
d17346ce9829a001927c