Skip to content

Extend the buf registry sdk command to reverse versions into module and reference #3485

@KenxinKun

Description

@KenxinKun

Feature

Today we can do:

$ buf registry sdk version --module=buf.build/connectrpc/eliza --plugin=buf.build/protocolbuffers/go
v1.33.0-20230913231627-233fca715f49.1

However we cannot do the reverse operation.

I am presented with the challenge that I want to use buf export for all the Go imports from the BSR in my go.mod file, for example:

go 1.23.0

require (
	buf.build/gen/go/acme/paymentapis/protocolbuffers/go v1.35.2-20220907172603-9a877cf260e1.1
)

I tried doing buf export buf.build/acme/paymentapis:main -o ./temp and it works with the latest, however if I try
buf export buf.build/acme/paymentapis:9a877cf260e1 -o ./temp with the short sha it fails with resource not found.

Is there a way to get exactly the version in the go.mod?

Metadata

Metadata

Assignees

Labels

FeatureNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions