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

fmt.Sprintf call has arguments but no formatting directives #1058

Closed
codyoss opened this issue Jun 29, 2022 · 7 comments · Fixed by #1072
Closed

fmt.Sprintf call has arguments but no formatting directives #1058

codyoss opened this issue Jun 29, 2022 · 7 comments · Fixed by #1072
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@codyoss
Copy link
Member

codyoss commented Jun 29, 2022

This error has been observed when trying to generate REGAPICS. There were a handful of libraries that were manually excluded from the initial beta/alpha generation of REGAPICS due to this error and now it seems some more are starting to have it. In googleapis/google-cloud-go#6269 It was observed in both security/privateca and gaming:

# cloud.google.com/go/security/privateca/apiv1beta1
privateca/apiv1beta1/certificate_authority_client.go:1968:25: fmt.Sprintf call has arguments but no formatting directives
privateca/apiv1beta1/certificate_authority_client.go:2040:25: fmt.Sprintf call has arguments but no formatting directives
privateca/apiv1beta1/certificate_authority_client.go:2103:25: fmt.Sprintf call has arguments but no formatting directives
privateca/apiv1beta1/certificate_authority_client.go:2166:25: fmt.Sprintf call has arguments but no formatting directives
privateca/apiv1beta1/certificate_authority_client.go:2434:25: fmt.Sprintf call has arguments but no formatting directives
privateca/apiv1beta1/certificate_authority_client.go:2497:25: fmt.Sprintf call has arguments but no formatting directives
privateca/apiv1beta1/certificate_authority_client.go:2571:25: fmt.Sprintf call has arguments but no formatting directives
privateca/apiv1beta1/certificate_authority_client.go:2791:25: fmt.Sprintf call has arguments but no formatting directives
privateca/apiv1beta1/certificate_authority_client.go:2961:25: fmt.Sprintf call has arguments but no formatting directives
privateca/apiv1beta1/certificate_authority_client.go:3043:25: fmt.Sprintf call has arguments but no formatting directives
privateca/apiv1beta1/certificate_authority_client.go:3125:25: fmt.Sprintf call has arguments but no formatting directives
privateca/apiv1beta1/certificate_authority_client.go:3207:25: fmt.Sprintf call has arguments but no formatting directives
privateca/apiv1beta1/certificate_authority_client.go:3289:25: fmt.Sprintf call has arguments but no formatting directives
privateca/apiv1beta1/certificate_authority_client.go:3371:25: fmt.Sprintf call has arguments but no formatting directives
privateca/apiv1beta1/certificate_authority_client.go:3453:25: fmt.Sprintf call has arguments but no formatting directives
privateca/apiv1beta1/certificate_authority_client.go:3535:25: fmt.Sprintf call has arguments but no formatting directives

Code: https://github.com/googleapis/google-cloud-go/pull/6269/files#r909626615

@codyoss codyoss added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Jun 29, 2022
@noahdietz
Copy link
Collaborator

The source of the issue is that the HTTP binding(s) for google.longrunning.Operations.GetOperation (in this case) isn't included in the service yaml for both APIs. Their service configs haven't been updated since mid 2020. I will send change to those files to publish just those bindings.

We could do more in the generator to fail, but I wonder what Java is doing when there is no GetOperation http rule in the serviec yaml. @vam-google can you answer that?

@noahdietz
Copy link
Collaborator

I have two changes open to add the missing http bindings for LROs.

@vam-google
Copy link
Contributor

@noahdietz java does not read those values, but instead constructs the url path based on the version of the package the LRO logic is being imported from. Luckily enough all the LRO url paths follow the same general pattern (excluding the name pattern, but that does not get validated), so this works. BAsically a hack, but is simple and does the job.

@noahdietz
Copy link
Collaborator

Perhaps the Go generator should do the same as a fall back in the event that the http binding isn't present...

@noahdietz
Copy link
Collaborator

So I the two APIs in question had their configs fixed, which means we can attempt to generate them with REGAPIC again.

Since this wasn't actually a bug in the generator, I am going to change this to type: feature request scoped to adding "fall back" support for missing http binding.

@noahdietz noahdietz added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Jun 30, 2022
@noahdietz
Copy link
Collaborator

Perhaps the Go generator should do the same as a fall back in the event that the http binding isn't present...

@quartzmo another good item to pick up if you are interested, no pressure though. We can pair at some point if you'd like.

@codyoss
Copy link
Member Author

codyoss commented Jul 6, 2022

Note, I still do believe there are more of these, but I lack my notes to know which clients. I skipped generating some APIs in the first batch due to this error. So a fix/feat will still be needed for wider rollout.

quartzmo added a commit to quartzmo/gapic-generator-go that referenced this issue Jul 14, 2022
quartzmo added a commit to quartzmo/gapic-generator-go that referenced this issue Jul 15, 2022
quartzmo added a commit to quartzmo/gapic-generator-go that referenced this issue Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants