Skip to content

fix: make Renovate actually track the Kafka docker image version#284

Merged
amuraru merged 1 commit into
masterfrom
fix/renovate-kafka-version-tracking
Jul 14, 2026
Merged

fix: make Renovate actually track the Kafka docker image version#284
amuraru merged 1 commit into
masterfrom
fix/renovate-kafka-version-tracking

Conversation

@amuraru

@amuraru amuraru commented Jul 14, 2026

Copy link
Copy Markdown

Summary

Renovate has never once tracked apache/kafka as a dependency here — every historical Kafka bump (3.1.2 → 3.9.2) has been a manually-branched PR, never a renovate/* one, and the live Dependency Dashboard confirms docker/kafka/Dockerfile's Kafka ARG has never shown up under detected dependencies.

Root cause: the customManagers regex in renovate.json for ARG_VERSION=... comments requires an all-caps variable name immediately before _VERSION=:

(?<depName>[A-Z][A-Z0-9_]*)_VERSION\s*=\s*...

docker/kafka/Dockerfile declared ARG kafka_version=3.9.2 (lowercase), so the regex never matched and the dependency was silently dropped — no error, no warning, just absence from tracking.

Changes

  • Rename kafka_versionKAFKA_VERSION throughout docker/kafka/Dockerfile so the customManager regex matches and Renovate starts tracking apache/kafka again.
  • Add a renovate.json packageRule pinning apache/kafka to allowedVersions: "<4.0.0". Kafka 4.x drops ZooKeeper support entirely (KRaft-only) and needs an operator-side migration, so we don't want an unreviewed major-version PR landing the moment tracking starts working.
  • Add Dockerfile comments pointing future maintainers at the allowedVersions pin and noting java_version should be bumped to 25 (next LTS after 21) as part of that eventual 4.x migration.
  • Separate, pre-existing bug found while verifying the fix with a real docker build: kafka_distro_base_url defaulted to downloads.apache.org, which only mirrors the newest active Kafka releases (currently 4.1.2/4.2.1/4.3.1). The pinned 3.9.2 has already aged off it (confirmed 404), so any cache-cold build of this Dockerfile was already broken today, independent of any future patch release. Switched the default to archive.apache.org, which retains every release permanently.

Test plan

  • renovate-config-validator passes against the updated renovate.json
  • docker build --check (BuildKit lint) — no warnings
  • docker build --target kafka_dist with --build-arg kafka_distro_base_url=https://archive.apache.org/dist/kafka — succeeds, GPG signature verifies
  • docker build --no-cache --target kafka_dist using the new default (no override) — succeeds end-to-end
  • Confirm Renovate picks up apache/kafka under Detected Dependencies on the next Dependency Dashboard refresh

🤖 Generated with Claude Code

amuraru added a commit that referenced this pull request Jul 14, 2026
…mManagers (#285)

Cross-checked every # renovate: / // renovate:-annotated line in the repo
against its customManager regex (same audit that found the Kafka
tracking bug in #284, but this covers other mismatch shapes, not just
case). Cross-referenced against the live Dependency Dashboard (#156),
which was missing exactly these entries, and confirmed each fix with a
standalone regex test against the real file content.

- Makefile: ADDLICENSE_VERSION, GOTEMPLATE_VERSION and MOCKGEN_VERSION
  used `:=` while the customManager regex only matches a plain `=`, so
  google/addlicense, cznic/gotemplate and uber-go/mock were never
  tracked. Switched to `=` to match the other working entries in the
  same file (GOLANGCI_VERSION, LICENSEI_VERSION, etc.) - harmless, since
  these are static literals with no dependency on recursive vs simple
  expansion.

- tests/e2e/versions.go: ZookeeperOperatorVersion uses
  datasource=docker, which has no notion of a Helm repo registryUrl, but
  the customManager regex required `registryUrl=` unconditionally -
  every other entry in this file is a Helm chart and does supply one.
  Made registryUrl optional in the regex/template, mirroring the
  existing optional-group pattern already used for extractVersion in
  the sibling Dockerfile/Makefile manager.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Renovate's custom.regex manager for Dockerfile/Makefile ARG_VERSION-style
comments only matches an ALL-CAPS variable name immediately before
`_VERSION=` (see renovate.json). docker/kafka/Dockerfile used lowercase
`kafka_version`, so the regex never matched and Renovate has silently
never tracked apache/kafka as a dependency - every historical Kafka bump
in this repo was a manual PR, never a renovate/* branch, and the live
Dependency Dashboard confirms docker/kafka/Dockerfile's ARG never showed
up under detected dependencies.

- Rename kafka_version -> KAFKA_VERSION so the customManager regex
  matches, restoring Renovate tracking for apache/kafka.
- Pin Renovate to the Kafka 3.x line via allowedVersions, since 4.x drops
  ZooKeeper support (KRaft-only) and needs an operator-side migration -
  we don't want an unreviewed major PR to land once tracking works again.
- Leave breadcrumbs in the Dockerfile for the eventual 4.x migration
  (remove the allowedVersions pin, bump java_version to 25).
- Fix a separate, pre-existing bug found while verifying the above with
  a real `docker build`: kafka_distro_base_url defaulted to
  downloads.apache.org, which only mirrors the newest active releases.
  The pinned 3.9.2 has already aged off it (confirmed 404), so any
  cache-cold build was already broken regardless of this fix. Switched
  to archive.apache.org, which retains every release permanently;
  verified with a full --no-cache docker build.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@amuraru amuraru force-pushed the fix/renovate-kafka-version-tracking branch from f867ffa to 98652cf Compare July 14, 2026 12:15
@amuraru amuraru merged commit aa9f7e4 into master Jul 14, 2026
6 checks passed
@amuraru amuraru deleted the fix/renovate-kafka-version-tracking branch July 14, 2026 12:17
amuraru added a commit that referenced this pull request Jul 14, 2026
#286)

Both bugs surfaced live after #285 merged and Renovate re-evaluated
master (per the Mend job log the user pulled from
https://developer.mend.io/github/adobe/koperator, and PR #279 /
Dependency Dashboard #156):

  WARN: Package lookup failures (branch="renovate/master-all-minor-patch")
  { "warnings": ["Failed to look up github-releases package
  cznic/gotemplate: no-result"], "files": ["Makefile"] }

  WARN: Invalid regex manager registryUrl { "value": "" }

1. Makefile's GOTEMPLATE_VERSION annotation said `depName=cznic/gotemplate`,
   but the Makefile actually `go install`s `github.com/coveooss/gotemplate/v3`
   (see the bin/gotemplate target a few lines down) - `cznic/gotemplate`
   doesn't exist on GitHub at all (confirmed 404), so the datasource
   lookup could never succeed. Fixed the depName to `coveooss/gotemplate`,
   which does exist and has a v3.12.0 release matching the pinned version.

2. My #285 fix made tests/e2e/versions.go's ZookeeperOperatorVersion
   (datasource=docker) match by making registryUrl optional in the
   regex, but registryUrlTemplate still rendered to an empty string for
   it (docker deps have no Helm-repo registryUrl) - and a templated ""
   is still a defined-but-invalid registryUrl to Renovate, not the same
   as omitting it, hence the warning. Split this into two customManagers
   instead: the original one, unchanged, for helm entries that always
   carry a registryUrl, plus a new one - scoped to the literal
   `datasource=docker` (RE2 has no lookaround, so this is how the split
   avoids overlap without negative-lookahead trickery) - that never
   defines registryUrlTemplate at all. Renovate then auto-derives the
   registry from the image name (confirmed via local run: it correctly
   resolved to https://ghcr.io on its own).

Verified for real, not just via renovate-config-validator: ran
`renovate --platform=local --dry-run=full` end-to-end (LOG_LEVEL=debug)
against this branch. Confirmed in the output:
  - coveooss/gotemplate resolves cleanly, warnings: []
  - ghcr.io/adobe/helm-charts/zookeeper-operator now extracted with
    registryUrl auto-derived as https://ghcr.io, warnings: []
  - apache/kafka still tracked from #284, updates: [] (3.9.2 is in fact
    the latest 3.x release - nothing newer within the allowedVersions
    "<4.0.0" pin, confirmed against GitHub tags)
  - zero occurrences of "invalid regex", "lookup fail", or "no-result"
    anywhere in the full run log

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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