Skip to content

Implement buf registry sdk info command #3862

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 5, 2025
Merged

Conversation

doriable
Copy link
Member

@doriable doriable commented Jun 4, 2025

This PR implements a new command, buf registry sdk info. This command is
used for resolving SDK information. It always requires the user to provide the module
and plugin information.

This commands expands on buf registry sdk version, allowing the user to resolve
the SDK information based on the version string for the module and plugin. For example,
the user knows the SDK version string, they could provide the following to resolve the module
commit and plugin information for the SDK given version string:

$ buf registry sdk --module=buf.build/connectrpc/eliza --plugin=buf.build/bufbuild/es --version=1.2.1-20230727062025-d8fbf2620c60.1
Module
Owner:  connectrpc
Name:   eliza
Commit: d8fbf2620c604277a0ece1ff3a26f2ff

Plugin
Owner:    bufbuild
Name:     es
Version:  v1.2.1
Revision: 1

Version: 1.2.1-20230727062025-d8fbf2620c60.1

If the user would like to resolve the SDK information for the latest commit on the default
label and latest version of the plugin:

$ buf registry sdk info --module=buf.build/connectrpc/eliza --plugin=buf.build/bufbuild/es
Module
Owner:  connectrpc
Name:   eliza
Commit: <latest commit on default label>

Plugin
Owner:    bufbuild
Name:     es
Version:  <latest version of plugin>
Revision: <latest revision of the plugin version>

Version: <SDK version string for the resolved module commit and plugin version>

If the user would like to resolve the SDK information for a specific module commit and/or plugin version:

$ buf registry sdk --module=buf.build/connectrpc/eliza --plugin=buf.build/bufbuild/es --version=1.2.1-20230727062025-d8fbf2620c60.1
Module
Owner:  connectrpc
Name:   eliza
Commit: d8fbf2620c604277a0ece1ff3a26f2ff

Plugin
Owner:    bufbuild
Name:     es
Version:  v1.2.1
Revision: 1

Version: 1.2.1-20230727062025-d8fbf2620c60.1

If the SDK version and module commit and/or plugin version are provided, the SDK version string will be
resolved and validated against the provided module commit and/or plugin version. If there is a mismatch,
the command will error:

$ buf registry sdk info  \
    --module=buf.build/connectrpc/eliza:8b8b971d6fde4dc8ba5d96f9fda7d53c   \
    --plugin=buf.build/bufbuild/es  \
    --version=1.2.1-20230727062025-d8fbf2620c60.1
Failure: invalid_argument: invalid SDK version v1.2.1-20230727062025-d8fbf2620c60.1 with module short commit d8fbf2620c60 for resolved module reference connectrpc/eliza:8b8b971d6fde4dc8ba5d96f9fda7d53c

Fixes #3485

@doriable doriable requested review from emcfarlane and bufdev June 4, 2025 21:24
Copy link
Contributor

github-actions bot commented Jun 4, 2025

The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedJun 4, 2025, 9:33 PM

@doriable doriable merged commit 381726a into main Jun 5, 2025
10 checks passed
@doriable doriable deleted the 3485-registry-sdk-info branch June 5, 2025 14:44
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.

Extend the buf registry sdk command to reverse versions into module and reference
3 participants