-
Notifications
You must be signed in to change notification settings - Fork 66
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
Option to consistently sort tags #51
Comments
Not really sure if this is a bug or a feature request. I'm happy to implement this if there's interest and you can point me in the right direction. |
Hi @jgkawell, Thank you for the report. I'll take a look at it shortly. How often does this problem occur? |
@ucpr Sorry for the late reply. This happens every time I generate files using the plugin. For example, I might generate the files once and get one ordering of tags and then generate the files immediately after and get a different ordering. The order seems to be completely random. |
I attempted to reproduce the problem in my environment, but I was unable to do so. To help me investigate further, could you please provide the minimal configuration required to reproduce the issue? |
I also have the same problem! It always changes the order for the auto-generated tags. This is what I have in the version: v1
plugins:
- plugin: gotag
out: .
opt: paths=source_relative,outdir=gen/go,auto=json-as-lower_camel_case+bson-as-lower_camel_case+db-as-snake_case |
Okay I've got a repeatable example for you:
version: v1
version: v1
plugins:
- name: go
out: .
opt:
- paths=source_relative
version: v1
plugins:
- name: gotag
out: .
opt:
- outdir=.
- paths=source_relative
- xxx=pg+"-" bun+"-" json+"-" yaml+"-" csv+"-"
- auto=pg-as-lower_snake+bun-as-lower_snake+yaml-as-lower_snake+csv-as-lower_snake+json-as-lower_snake
syntax = "proto3";
package v1;
option go_package = "github.com/example/example";
service EchoService {
rpc Speak(SpeakRequest) returns(SpeakResponse) {}
}
message SpeakRequest {
string input = 1;
}
message SpeakResponse {
string output = 2;
} Running the below command over and over will randomly change the position of the tags: buf generate --template buf.gen.go.yaml && buf generate --template buf.gen.gotag.yaml |
Thank you! |
Thank you for your support in investigating the issue. Please try it out: |
I will be closing the issue. If you encounter any problems, feel free to reach out. |
Upgrading `protoc-gen-gotag` to resolve random ordered tags: srikrsna/protoc-gen-gotag#51 Also fixed the npm imports for buf/connectrpc
@ucpr This is working great! Thank you for the fix! |
Often I run into the case mentioned in #38 where I will regenerated a file and end up with changes because the sorting of the tags changes randomly on each compilation. This causes issues in automation because changes are being detected in generated files when no functional change has actually been made. Here's an example of the git diff:
I'm seeing this issue on the latest stable version v1.0.1.
The text was updated successfully, but these errors were encountered: