-
Notifications
You must be signed in to change notification settings - Fork 44
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
build: bump oapi-codegen to 2.4.1 #1355
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
I'd love to get rid of the hack. |
Before we do that, I will say that the hack makes generated content more deterministic. Instead of people regenerating with effectively "random" version, we can upgrade this and create commits which will only show upgrade changes. These generator upgrades did introduce some bugs in provisioning in the past. |
932c392
to
9275921
Compare
How about this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I'm not sure what the real gain is here in changing up the tooling, I don't feel strongly either way however. But each change we'll have will need to update the individual go generate directives.
Anyway LGTM, but one comment on the use of which
.
tools/prepare-source.sh
Outdated
go install golang.org/dl/go$GO_VERSION@latest | ||
$GO_BINARY download | ||
|
||
# Ensure dev tools are installed | ||
which goimports || $GO_BINARY install golang.org/x/tools/cmd/goimports@latest | ||
which goimports >/dev/null || GOBIN=$TOOLS_PATH $GO_BINARY install golang.org/x/tools/cmd/goimports@latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will which still work here? $TOOLS_PATH wouldn't be part of the user's path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh good catch! Rebasing.
I was testing this and as far as I can tell, the tool picks the tool which is installed. I hope this will work, but it is hard to test now that there is only one release that we can use due to Go stack incompatiblity. The next update will tell. But I manually removed the version from all comment headers and the shell script does not add it back now! Looks good. I need to figure out how to silence shellcheck on this line tho, it wants me to enquote it:
|
/retest |
6f78dd8
to
89e887d
Compare
This PR is stale because it has been open 30 days with no activity. Remove "Stale" label or comment or this will be closed in 7 days. |
Requesting re-review @mgold1234 and @croissanne thank you. |
Since the project relaxed the hardcoded Go requirement, we can now update. I propose to keep the pin and thus to keep updating this generator manually. Or alternatively, we can just remove the hack completely.
Quite honestly, I am not huge fan of
go generate
and I would suggest to get rid of it completely callingoapi-codegen
directly. This is what works for us quite nicely in provisioning app (this is from makefile but you get the idea):