johanbrandhorst / grpc-gateway-boilerplate

All the boilerplate you need to get started with writing grpc-gateway powered REST services in Go
MIT License
474 stars 81 forks source link

updating to new buf manifest/config versions #39

Closed insanitywholesale closed 1 year ago

insanitywholesale commented 1 year ago

First off I'd like to thank you for your awesome work, this repository has been an incredibly valuable source for learning how to structure a gRPC project in Go that uses gRPC-gateway.

I started writing my own template last year to add a few more things that I wanted to be figured out when I want to write a new service and it can be found in this repository on gitlab (it's also mirrored here on github).

Currently, my buf.yaml and buf.gen.yaml look a lot like yours and there is also wouldbe-buf.work.yaml because it currently doesn't work if you try to upgrade or if you just follow the steps in the official tour.

This led me to spend many evenings trying to troubleshoot it until I read a blog post that provided just enough details to figure out the issue. In this commit on a feature branch I discovered that there is indeed a way to upgrade to it although it's less than ideal.

In rough order:

That's what worked for me, I hope this helps somewhat in case you were holding back from upgrading due to the inability for buf to pull in .proto dependencies or generate files properly. Let me know if there is any additional information I can provide in case you wish to update the way buf stuff is handled, otherwise feel free to close the issue, I just wanted to share my experience dealing with this problem and what I did to fix it.

johanbrandhorst commented 1 year ago

Hi, thanks for the kind words! I think we should be able to use buf beta migrate-v1beta1 to do most of the work for us. I'd forgotten I hadn't updated this repo yet, I should get to it :).

insanitywholesale commented 1 year ago

I didn't even know such a command existed! Great to know it can be done more easily than what I previously thought