Skip to content

Conversation

@tonybase
Copy link

No description provided.

@CLAassistant
Copy link

CLAassistant commented Dec 19, 2025

CLA assistant check
All committers have signed the CLA.

@tonybase tonybase closed this Dec 19, 2025
@tonybase tonybase reopened this Dec 19, 2025
Copy link
Member

@pkwarren pkwarren left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution. It looks like there are some changes needed in the go-kratos project in order to adopt this.

After moving the plugin to the correct location, you can test building the plugin with make test PLUGINS=community/kratos-http. The first time this runs it will create plugin.sum files used to verify deterministic output from the plugin. These will need to be checked in to get the build passing. See https://github.com/bufbuild/plugins/blob/main/CONTRIBUTING.md#creating-a-new-plugin for more information.

@@ -0,0 +1,8 @@
version: v1
name: buf.build/community/kratos-http
Copy link
Member

Choose a reason for hiding this comment

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

These files for the plugin need to be moved to a corresponding directory under plugins - git mv plugins/go-kratos/http plugins/community/kratos-http.

version: v1
name: buf.build/community/kratos-http
plugin_version: v0.7.1
source_url: https://github.com/go-kratos/kratos/tree/main/cmd/protoc-gen-go-http
Copy link
Member

Choose a reason for hiding this comment

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

We typically just use the top-level GitHub project URL in these files.

integration_guide_url: https://github.com/go-kratos/kratos#getting-started
description: A protoc plugin that generates Kratos HTTP server/client stubs and routing code from protobuf services annotated with HTTP options.
spdx_license_id: MIT
license_url: https://github.com/go-kratos/kratos/blob/main/LICENSE
Copy link
Member

Choose a reason for hiding this comment

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

These use the versioned URL in case things are moved around in the repository, however I don't see a corresponding tag in the source repo for the protoc-gen-go-http command (https://pkg.go.dev/github.com/go-kratos/kratos/cmd/protoc-gen-go-http/v2 is showing a v2 pseudo version).

ENV CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH

RUN --mount=type=cache,target=/go/pkg/mod \
go install -ldflags="-s -w" -trimpath go install github.com/go-kratos/kratos/cmd/protoc-gen-go-http/v2@b9fab9a \
Copy link
Member

Choose a reason for hiding this comment

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

This should use a tagged version - it will require the upstream project to create a tag named cmd/protoc-gen-go-http/v2.X.Y (where X.Y are the minor/patch version).

See the grpc-go plugin for an example: https://github.com/grpc/grpc-go/releases/tag/cmd%2Fprotoc-gen-go-grpc%2Fv1.6.0

source:
github:
owner: go-kratos
repository: kratos
Copy link
Member

Choose a reason for hiding this comment

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

Once a tagged release is available, this should update to use a goproxy source similar to https://github.com/bufbuild/plugins/blob/main/plugins/grpc/go/source.yaml.

@@ -0,0 +1,8 @@
version: v1
Copy link
Member

Choose a reason for hiding this comment

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

This looks to be missing a few fields (like output_languages): https://github.com/bufbuild/plugins/blob/main/CONTRIBUTING.md#bufpluginyaml-file

Does it have dependencies on other generated code (like from protocolbuffers/go)? It would be good to verify if it works as a generated SDK. The general requirement is that the generated code outputs to a unique Go package (not to the same directory as protocolbuffers/go).

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.

3 participants