Conversation
|
@toteki @adamewozniak could you guys check if the module specifics seem correct? |
adamewozniak
left a comment
There was a problem hiding this comment.
Just a few questions - also @RafilxTenfen should we ignore the generated files here and maybe add it to make build, or something similar?
These files will likely become expired if they're not generated each time queries are updated
| @@ -0,0 +1,26 @@ | |||
| { | |||
There was a problem hiding this comment.
Could we move this into a folder swagger instead of client/docs maybe?
There was a problem hiding this comment.
this is what other projects are using, but I agree - docs/swagger would be probably better place.
Make sense, maybe we could put it together with proto-gen? since it will be modified it time the proto files change |
Makefile
Outdated
| echo "\033[91mSwagger docs are out of sync!!!\033[0m";\ | ||
| exit 1;\ |
There was a problem hiding this comment.
Are we taking the approach where the swagger docs are always gitignored, or will they be committed?
And if they're being committed - this is most of the ingredients to a CI check that we could make, which would check it they're out of sync on any PR
There was a problem hiding this comment.
client/docs/statik/statik.go is so large that my git clone time for the repository seems to have doubled from this commit.
Because it's all in 13 lines, I also fear that it cannot diff efficiently, so our repo size would increase by the full 10+ MB every time it's generated.
Thus, we need to go the .gitignore route
Co-authored-by: Adam Wozniak <29418299+adamewozniak@users.noreply.github.com>
robert-zaremba
left a comment
There was a problem hiding this comment.
Maybe we can check with the ecosystem if someone else has better setup rather than bundling the swagger docs into the chain app.
Makefile
Outdated
| runsim: $(RUNSIM) | ||
| $(RUNSIM): | ||
| @echo "Installing runsim..." | ||
| @go install github.com/cosmos/tools/cmd/runsim@v1.0.0 |
There was a problem hiding this comment.
I don't think runsim nor statik is needed for swagger. Statik can be used to pack static files in a go library. Not sure if this is the best solution though. I know SDK and Regen are using Statik to serve doc files directly from the app. Ideally I would serve documentation from other app, rather than bundling it into the chain. What do you think?
| @@ -0,0 +1,26 @@ | |||
| { | |||
There was a problem hiding this comment.
this is what other projects are using, but I agree - docs/swagger would be probably better place.
|
@adamewozniak @toteki @robert-zaremba |
adamewozniak
left a comment
There was a problem hiding this comment.
Couple of questions but this looks much cleaner 🥳
There was a problem hiding this comment.
Doc file size (swagger.yaml) is much more manageable now (80 kB) and its format would allow for efficient diff.
Remaining question is whether we should
- .gitignore it anyway (so it's only generated locally when needed, and can't be out of sync)
- commit it (and either manually or through CI, make sure it doesn't desync)
In my opinion, we could commit that, in the same way we commit the generated structs from proto files |
Maybe we can add a CI task (later) where we check to see if swagger is out of date? |
Or check if proto was modified: whenever proto was modified, swagger should be checked if it should be modified as well. |
| }, | ||
| "apis": [ | ||
| { | ||
| "url": "./tmp-swagger-gen/umee/leverage/v1/query.swagger.json", |
There was a problem hiding this comment.
why tmp prefix? It looks weird.
There was a problem hiding this comment.
it is just the name of the temp dir /tmp-swagger-gen used in contrib/scripts/protoc-swagger-gen.sh to generate the ./swagger/swagger.yaml
robert-zaremba
left a comment
There was a problem hiding this comment.
long term we should consider serving swagger docs not from the chain app.
Description
closes: #957
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!to the type prefix if API or client breaking changeCHANGELOG.mdReviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...