Skip to content

metis: Refine update-proto.sh to enforce specific protoc version - #1069

Merged
k8s-ci-robot merged 1 commit into
kubernetes:masterfrom
arvindbr8:metis_proto_script
Apr 17, 2026
Merged

k8s-ci-robot merged 1 commit into
kubernetes:masterfrom
arvindbr8:metis_proto_script

Conversation

@arvindbr8

Copy link
Copy Markdown
Contributor

Description

This PR refines the tools/update-proto.sh script to ensure reproducible protobuf code generation across different developer environments and CI.

Currently, the script only installs protoc if it is completely missing from the host. If a developer has an older version of protoc installed system-wide (e.g., 3.21.12), the script will use it, producing different generated code than the CI environment (which uses 34.1).

Key Changes

  • Version Check: Updated the script to not only check if protoc is installed, but also verify that its version matches the requested PROTOC_VERSION (34.1).
  • Forced Local Installation on Mismatch: If the version mismatches or is not found, it downloads the correct release asset from GitHub and installs it locally in _tmp/bin, overriding the system version for the duration of the script.
  • Generator Updates: Removed the guard checks for protoc-gen-go and protoc-gen-go-grpc to ensure the latest versions of these generators are fetched via go install every time.

Verification Results

  1. Verified locally on a machine with an older protoc version: The script successfully detected the mismatch, downloaded version 34.1, and placed it in _tmp/bin.
  2. Verified that the generated .pb.go files now perfectly match what the CI expects, resolving verify-up-to-date failures.

/hold for reviews from @YifeiZhuang
/label tide/merge-method-squash

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Apr 16, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

This issue is currently awaiting triage.

If the repository mantainers determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 16, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Hi @arvindbr8. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot
k8s-ci-robot requested review from cheftako and elmiko April 16, 2026 22:02
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 16, 2026
Comment thread tools/update-proto.sh
echo "protoc not found, installing locally..."
PROTOC_VERSION="34.1"
# Install protoc if not present or version mismatches
PROTOC_VERSION="34.1"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It looks protoc is quite stable, my local old ptotoc version generates the same code as protoc 34.1.
The prow CI environment always install protoc so we will detect immediately if there are ungenerated code.

I think one thing we need to automate/track is to update this protoc version.

@YifeiZhuang

Copy link
Copy Markdown
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 16, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: arvindbr8, YifeiZhuang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 16, 2026
@YifeiZhuang

Copy link
Copy Markdown
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 16, 2026
@aojea

aojea commented Apr 17, 2026

Copy link
Copy Markdown
Member

/hold for reviews from @YifeiZhuang

I assume this is an oversight #1069 (comment) since it was already approved

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 17, 2026
@k8s-ci-robot
k8s-ci-robot merged commit bebcf17 into kubernetes:master Apr 17, 2026
7 checks passed
@arvindbr8 arvindbr8 changed the title meris: Refine update-proto.sh to enforce specific protoc version metis: Refine update-proto.sh to enforce specific protoc version May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants