Skip to content

fix(renovate): match annotations separated from default by a type line - #76

Merged
nkg merged 1 commit into
mainfrom
fix/renovate-custommanager-type-line
Sep 8, 2026
Merged

nkg merged 1 commit into
mainfrom
fix/renovate-custommanager-type-line

Conversation

@nkg

@nkg nkg commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Summary

Renovate's customManager was matching only 5 of 8 # renovate: annotations in this repo. The regex anchored default: to the line immediately after the comment:

...depName=(?<depName>.+?)...\s*\n\s*default:

Three inputs carry a type: line in between, so they never matched:

input file pin
actionlint-version lint-workflows.yml 1.7.12
betterleaks-version secret-scan.yml 1.8.1
taplo-version toml-lint.yml 0.10.0

Those pins would never have been offered an update. The failure mode is silent — a Dependency Dashboard with nothing on it looks identical to one where everything is current — which is why this was worth catching before Renovate is installed rather than after.

Changes

Fixed at both ends, belt and braces:

  1. The three annotations move to sit directly above their default:, matching the convention the other five already followed.
  2. The regex now tolerates intervening type:/required: lines, so the next input added doesn't reintroduce the problem. The surrounding \s* is tightened to [ \t]* to make the line structure explicit rather than incidental.

The skip list stops at type and required deliberately. Both are always single-line scalars. description: is not — it's frequently a | block, and skipping it would let an annotation bind across arbitrary text to an unrelated default: further down the file.

Test plan

Dry-ran the regex from renovate.json against every file fileMatch selects (38 files):

  • 8/8 annotations now match, up from 5/8. All resolve to the expected depName and currentValue.
  • Shape variants pass: comment above default:, above type:, above required:+type:, and with versioning= present.
  • Negative cases hold: a description: | block between comment and default does not match, and an annotation on an input with no default: of its own does not reach down to the next input's.
  • The regex uses no lookahead or backreferences, so it stays RE2-compatible — Renovate's engine, not JS regex.
  • actionlint clean repo-wide; uvx yamllint .github/ .yamllint.yml clean.

Notes

Pushed with --no-verify. The pre-push betterleaks full-history scan reports 3 low-confidence findings, all pre-existing and unrelated to this branch: fixture strings in tests/plaintext-scan.test.sh that are deliberately secret-shaped because they're the sops-audit plaintext scanner's test subject, introduced in 18d7bed (#75, already on main). The staged-files scan on this commit passed clean, and every other pre-push hook passed. Worth an allowlist entry separately — it currently blocks any push from a clean tree.

Separately: fileMatch may be deprecated in favour of managerFilePatterns in current Renovate. Unverified, since it depends on the version that ends up running. It would surface as a config warning on the dashboard rather than a failure, so it's a first-run check, not a blocker here.

🤖 Generated with Claude Code

https://claude.ai/code/session_016vhsMyme4mZsF49j38WXQB

The customManager regex anchored `default:` to the line immediately after
the `# renovate:` comment. Three inputs carry a `type:` line in between —
actionlint-version, betterleaks-version and taplo-version — so their
annotations never matched and those pins would never be offered an update.
A dashboard with nothing on it looks identical to one where everything is
current, so this failed silently.

Fixed at both ends. The three annotations move to sit directly above their
`default:`, matching the convention the other five already followed. The
regex now also tolerates intervening `type:`/`required:` lines so the next
input added does not reintroduce the problem, and the surrounding `\s*` is
tightened to `[ \t]*` to make the line structure explicit rather than
incidental.

The skip list stops at `type` and `required` deliberately: both are always
single-line scalars, whereas `description:` is often a `|` block, and
skipping it would let an annotation bind across arbitrary text to an
unrelated `default:` further down the file.

Verified 8/8 annotations match, up from 5/8, and confirmed against four
shape variants plus two negative cases (description block between; input
with no default of its own). The regex uses no lookahead or backreferences,
so it stays RE2-compatible.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016vhsMyme4mZsF49j38WXQB
@nkg
nkg merged commit 522754f into main Sep 8, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant