Skip to content

ci: automate protobuf source generation for Renovate updates#1920

Open
zeitlinger wants to merge 4 commits intomainfrom
automate-protobuf-generation
Open

ci: automate protobuf source generation for Renovate updates#1920
zeitlinger wants to merge 4 commits intomainfrom
automate-protobuf-generation

Conversation

@zeitlinger
Copy link
Member

@zeitlinger zeitlinger commented Feb 27, 2026

Summary

  • Group protobuf-java and protoc into a single Renovate PR (separateMajorMinor: false)
  • Add workflow that triggers on renovate/protobuf branch to regenerate protobuf sources
  • Remove mise use --pin protoc@latest from generate task (no longer needed with grouping)

Known limitation

The workflow pushes with GITHUB_TOKEN, which doesn't trigger CI re-runs. After the generated commit is pushed, close and reopen the PR to trigger CI.

Follow-up: switch to PROMBOT_GITHUB_TOKEN so CI re-runs automatically.

Test plan

Group protobuf-java and protoc into a single Renovate PR and add a
workflow that regenerates protobuf sources when both deps are updated.
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger zeitlinger marked this pull request as draft February 27, 2026 09:19
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger zeitlinger marked this pull request as ready for review February 27, 2026 11:24
@zeitlinger
Copy link
Member Author

@roidelapluie — could you add PROMBOT_GITHUB_TOKEN as a secret to this repo? It's already used in prometheus/prometheus for similar automation (repo_sync.yml). That would let this workflow push with a token that triggers CI re-runs, removing the need to close/reopen the PR manually.

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds automation to regenerate protobuf sources when Renovate updates protobuf dependencies, streamlining the update process by grouping protobuf-java and protoc updates together.

Changes:

  • Groups protobuf-java and protoc in Renovate configuration to create a single PR for both updates
  • Adds a GitHub Actions workflow that automatically regenerates protobuf sources when the renovate/protobuf branch is updated
  • Simplifies the mise generate task by removing the mise use --pin protoc@latest command (no longer needed since Renovate handles both updates)

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/generate-protobuf.yml New workflow that triggers on renovate/protobuf branch to regenerate protobuf sources and commit them back to the PR
.github/renovate.json5 Groups protobuf-java and protoc dependencies together with separateMajorMinor disabled
.github/renovate-tracked-deps.json Adds the new generate-protobuf workflow to tracked dependencies for mise version updates
mise.toml Simplifies generate task by removing mise use command and updating description

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- name: Commit and push generated sources
run: |
git diff --quiet && exit 0
UNEXPECTED=$(git diff --name-only | grep -v '\.java$' | grep -v '^mise\.toml$' || true)
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mise.toml file should not change during the generate step anymore since the mise use --pin protoc@latest command has been removed from the generate task. Including mise.toml in the list of acceptable changed files could mask unexpected modifications to this file. Consider removing | grep -v '^mise\.toml$' from this line to ensure only Java files are modified during generation.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accepted — removed the mise.toml exception from the unexpected files check.

# TODO: switch to PROMBOT_GITHUB_TOKEN once it's added to this repo.
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add '*.java' mise.toml
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the generate task no longer modifies mise.toml (the mise use --pin protoc@latest command was removed), there's no need to add mise.toml to the git commit. This line should only add the generated Java files: git add '*.java'

Suggested change
git add '*.java' mise.toml
git add '*.java'

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accepted — now only adding *.java to the commit.

Since the generate task no longer runs `mise use --pin protoc@latest`,
mise.toml should not change during generation.
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.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.

2 participants