Skip to content

feat(renovate): migrate beats version bumps from workflow to Renovate - #8386

Open
gurevichdmitry wants to merge 3 commits into
mainfrom
feat/renovate-beats-migration
Open

feat(renovate): migrate beats version bumps from workflow to Renovate#8386
gurevichdmitry wants to merge 3 commits into
mainfrom
feat/renovate-beats-migration

Conversation

@gurevichdmitry

@gurevichdmitry gurevichdmitry commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Migrates elastic/beats/v7 version bumps from .github/workflows/bump-beats-version.yml to Renovate, eliminating the last custom workflow that handles dependency updates.

How it works

A minimal annotation comment is added to go.mod above the beats dependency declaring which beats branch to track:

// renovate: beats-branch=main
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20260604204725-a6d4c42eeb5a

Renovate's git-refs custom manager reads the branch name from the annotation and the current SHA from the pseudo-version itself (the 12-char suffix). When the beats branch HEAD changes, Renovate opens a PR that updates both lines — putting the new full SHA into the pseudo-version — then runs make generate via postUpgradeTasks. The Makefile's generate target reads the SHA from the pseudo-version line and runs go get github.com/elastic/beats/v7@<sha> && go mod tidy, which rewrites the entry with the correct timestamp and truncated SHA.

make generate is on the allowedPostUpgradeCommands allowlist in the self-hosted Renovate instance — no new GH Actions workflow required.

Changes

  • go.mod — annotation comment // renovate: beats-branch=<branch> added above the beats entry
  • Makefile (new) — generate target: reads SHA from the pseudo-version line, runs go get + go mod tidy
  • renovate.json — added git-refs custom manager spanning both the annotation and module lines in go.mod; added packageRule with postUpgradeTasks: make generate and automerge: true scoped to beats; kept enabled: false for the gomod manager on github.com/elastic/beats/v7
  • .github/workflows/bump-beats-version.yml — deleted
  • .ci/updatecli/updatecli.d/update-beats.yml and .ci/updatecli/scripts/update-beats.sh — deleted (orphaned after updatecli deprecation in feat(renovate): deprecate updatecli, enable pre-commit manager #8351)

Related

Closes https://github.com/elastic/security-team/issues/19259
Depends on / follow-up to #8351

🤖 Generated with Claude Code

gurevichdmitry and others added 2 commits September 9, 2026 16:54
Replace the bump-beats-version.yml GitHub Actions workflow (which used
updatecli) with a Renovate-based approach:

- Add a Renovate annotation comment in go.mod above the beats dependency
  so the new regex customManager can track the SHA.
- Add a customManager in renovate.json that uses git-refs datasource to
  detect new commits on the elastic/beats main branch.
- Add a packageRule that runs `make generate` as a postUpgradeTask to
  update the go.mod pseudo-version whenever Renovate detects a new SHA.
- Add Makefile with a `generate` target that reads the SHA from the
  go.mod annotation and runs go get + go mod tidy.
- Delete .github/workflows/bump-beats-version.yml (now superseded).

The existing `enabled: false` packageRule for github.com/elastic/beats/v7
is intentionally kept to prevent the gomod manager from also managing it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…fig on beats update

- Delete `.ci/updatecli/updatecli.d/update-beats.yml` and
  `.ci/updatecli/scripts/update-beats.sh`; no workflow invokes them
  and they reference a deleted workflow env var (BRANCH_NAME).
- Add `mage config || true` to `make generate` so beats-version bumps
  regenerate committed config YAMLs (cloudbeat*.yml) via the beats
  template tooling.
- Expand `postUpgradeTasks.fileFilters` to include `cloudbeat*.yml` so
  Renovate commits those regenerated files in beats-update PRs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove redundant beats-sha from annotation comment since the 12-char
SHA is already embedded in the go.mod pseudo-version. The customManager
regex now spans both the annotation line (for branch name) and the
module line (for currentDigest), keeping the annotation minimal.
Also drop mage config from make generate (not available in Renovate runner)
and fix SHA reading to use sed on the module line directly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant