upjet icon indicating copy to clipboard operation
upjet copied to clipboard

Question: Code generation results differ/Upgrade go imports

Open b509 opened this issue 1 year ago • 1 comments

What happened?

Upjet generates different results for me than for another maintainer or the official pipeline https://github.com/crossplane-contrib/provider-keycloak/blob/main/.github/workflows/ci.yml

Differences seem to be in quotes (mine: one double quote, pipeline: two single quotes), linebreaks and empty lines. You can see some examples here https://github.com/denniskniep/provider-keycloak/commit/ca7b2f2dace6604cfb531a873dba1bd325174f97 https://github.com/denniskniep/provider-keycloak/commit/16990cb32a1420dec4321b7ebdc7dbdf1bc87293

How can we reproduce it?

My assumption is that I had installed the newest go version (1.22) but the pipeline is using v1.21 and I had probably installed the imports using v1.22. Can anyone support in why this is happening?

b509 avatar May 18 '24 22:05 b509

I ran into this issue a while back in provider-upjet-aws, where depending on the golang version, upjet would sometimes transform double `` into a "smart quote" like in your example. I don't remember whether it's the new version or the old one that's doing the transformation. I tried tracking it down, and the closest I got was a recent change in some go documentation tool handling the parsing of quotation marks inside comments. It didn't seem like it was obviously applicable to what I was seeing, but it was the only semi-related thing I could find.

Ultimately, the double `` in the terraform-provider-aws docs, which was causing the diff based on go version, was a bug, so I just posted a PR to remove it upstream.

mbbush avatar Jul 03 '24 17:07 mbbush