Skip to content

Install buf v1.59.0 for protobuf formatting#18779

Merged
harupy merged 6 commits intomasterfrom
copilot/install-buf-formatting-tool
Nov 11, 2025
Merged

Install buf v1.59.0 for protobuf formatting#18779
harupy merged 6 commits intomasterfrom
copilot/install-buf-formatting-tool

Conversation

Copy link
Contributor

Copilot AI commented Nov 11, 2025

Related Issues/PRs

#xxx

What changes are proposed in this pull request?

Adds buf v1.59.0 as a binary tool for protobuf file formatting with automatic pre-commit integration.

Changes:

  • bin/install.py: Added buf tool configuration with download URLs for Linux x86_64 and Darwin arm64
  • .pre-commit-config.yaml: Added buf hook that runs bin/buf format -w --exit-code . on *.proto files. Removed .proto from end-of-file-fixer hook since buf now handles protobuf file formatting
  • mlflow/protos/*.proto: Applied buf standard formatting to 24 protobuf files (sorted imports, normalized whitespace and indentation)

The formatter now runs automatically in pre-commit to maintain consistent protobuf file formatting.

How is this PR tested?

  • Manual tests

Verified:

  • bin/buf --version returns 1.59.0
  • Pre-commit hook detects and fixes formatting issues
  • Hook integrates correctly with existing pre-commit workflow
  • Proto files are no longer processed by end-of-file-fixer hook

Does this PR require documentation update?

  • No. You can skip the rest of this section.

Release Notes

Is this a user-facing change?

  • No. You can skip the rest of this section.

What component(s), interfaces, languages, and integrations does this PR affect?

Components

  • area/build: Build and test infrastructure for MLflow

How should the PR be classified in the release notes? Choose one:

  • rn/none - No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" section

Should this PR be included in the next patch release?

  • Yes (this PR will be cherry-picked and included in the next patch release)
  • No (this PR will be included in the next minor release)
Original prompt

Install buf to format protobuf files

  1. Update bin/install.py to download the buf binary for linux x86_64 and macOS arm64. Use the following command to get the download URLs for buf v1.59.0 (current latest):
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/repos/bufbuild/buf/releases/tags/v1.59.0 | jq -r '.assets[] | "\(.name) \(.browser_download_url)"' | grep 'buf-Linux-x86_64\|Darwin-arm64' | grep -v '^protoc' | grep -v '\.tar\.gz$'
  1. Run the updated bin/install.py to download and install the buf binary. Run bin/buf --version to verify the installation.
  2. Add a hook in .pre-commit-config.yaml to run buf format -w --exit-code
  3. Run the pre-commit hook to ensure it works correctly.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@harupy harupy marked this pull request as ready for review November 11, 2025 11:45
@harupy harupy added the rn/none List under Small Changes in Changelogs. label Nov 11, 2025
@github-actions
Copy link
Contributor

@Copilot Thank you for the contribution! Could you fix the following issue(s)?

⚠ Invalid PR template

This PR does not appear to have been filed using the MLflow PR template. Please copy the PR template from here and fill it out.

Copilot AI and others added 2 commits November 11, 2025 11:48
Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
Copilot AI changed the title [WIP] Add buf installation and pre-commit hook Install buf v1.59.0 for protobuf formatting Nov 11, 2025
Copilot AI requested a review from harupy November 11, 2025 11:57
@harupy
Copy link
Member

harupy commented Nov 11, 2025

@copilot can we rename the pre-commit hook name to buf?

Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 11, 2025

@copilot can we rename the pre-commit hook name to buf?

Done! Renamed the hook from buf-format to buf in commit f9c1bd0. Also removed .proto from the end-of-file-fixer hook since buf now handles proto file formatting.

@github-actions github-actions bot added the area/build Build and test infrastructure for MLflow label Nov 11, 2025
Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
@github-actions
Copy link
Contributor

github-actions bot commented Nov 11, 2025

Documentation preview for dac01d0 is available at:

More info
  • Ignore this comment if this PR does not change the documentation.
  • The preview is updated when a new commit is pushed to this PR.
  • This comment was created by this workflow run.
  • The documentation was built by this workflow run.

Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
@harupy harupy added this pull request to the merge queue Nov 11, 2025
Merged via the queue into master with commit 45c4fe4 Nov 11, 2025
58 of 61 checks passed
@harupy harupy deleted the copilot/install-buf-formatting-tool branch November 11, 2025 13:23
BenWilson2 pushed a commit to BenWilson2/mlflow that referenced this pull request Nov 14, 2025
Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

allow-whitespace-only area/build Build and test infrastructure for MLflow rn/none List under Small Changes in Changelogs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants