Skip to content
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

Initialism in proto file is not handled well #90

Open
cory-miller opened this issue Feb 20, 2025 · 0 comments
Open

Initialism in proto file is not handled well #90

cory-miller opened this issue Feb 20, 2025 · 0 comments

Comments

@cory-miller
Copy link

cory-miller commented Feb 20, 2025

Consider a protobuf service such as this:

service AWS {
  option (temporal.v1.service) = {task_queue: 'aws-task-queue'};

  // ManageAWS does some workflow thing.
  rpc ManageAWS(ManageAWSRequest) returns (ManageAWSResponse) {
    option (temporal.v1.workflow) = {id: 'some-workflow-1/${! id }/${! uuid_v4() }'};
  }

  // ManageAWSResource does some workflow thing.
  rpc ManageAWSResource(ManageAWSResourceRequest) returns (ManageAWSResourceResponse) {
    option (temporal.v1.workflow) = {id: 'some-workflow-2/${! uuid_v4() }'};
  }
}

The generated output for the service name and the methods get confused around the casing here. It will generate methods such as ManageAwsasync (note the async part is all lower case). The issue as far as I understand comes from how github.com/iancoleman/strcase is used. This tool will dump ManageAWSAsync into this and that library sees AWSA and assumes that is one word.

This problem seems to come around v1.3.0 of this tool which I understand is quite old at this point. I've been updating our libraries and so our older code generated output with initialism but now we get the above problem. The naming changes will force us into migrating our workflows since Temporal will not see them as the same. So I'm hoping that I can avoid this by keeping the initialism. This is also more consistent with other generated output such protoc-gen-go itself and other tools such as the generators for gRPC and ConnectRPC.

The strcase library has methods to provide initialisms. Would you be open to allowing this plugin to pass through some data as a flag? I've opened #89 and #91 to demonstrate what I'm seeing with and without a flag to mask the output.

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

No branches or pull requests

1 participant