-
Notifications
You must be signed in to change notification settings - Fork 125
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
feat: Add /version endpoint reporting build and version info #191
base: main
Are you sure you want to change the base?
Conversation
Refs: - mccutchen#188 - mccutchen#190 Signed-off-by: Mateusz Łoskot <[email protected]>
Signed-off-by: Mateusz Łoskot <[email protected]>
Okay, I think this will be pretty tricky to get right. Let's zoom out and look at the ways go-httpbin is currently built:
I think the published docker images in (1) are the most relevant for our purposes here. I think we'll want to come up with a mechanism that works with both the GitHub Actions automation and the manual To make that work, I think we might need to add What do you think? I may be missing other options we have here, please let me know! |
Thank you @mccutchen for the extensive explanation - I have learned a lot. When I started working on the idea of However, perhaps a more explicit and old-school way would be appropriate to handle all the cases you mention, i.e. For example,
Perhaps there is a golang way to achieve similar, but I am unaware Go newbie. |
I'm not sure I like that approach either, just because it will be tricky to juggle different contents of a VERSION file and make it more complicated to cut a new release. (What would that look like, one commit to bump VERSION, tag release, follow-up commit to revert VERSION back to I'm sorry, while I do think this would be a good feature to add, I still don't quite have a clear idea in my own head for how we might implement it in a way that doesn't add too much complexity/burden to the development and release process. I'll think about it a bit more; happy to keep working through ideas here if you come up with other approaches! |
@mccutchen I perfectly understand your reluctance as the tradeoffs or complications are clear and obvious. I'm just thinking out loud that Go ecosystem must have solved such problem of setting version in a way that is nicely integrated with Git workflow, binaries build and container images build workflows. By the way, I've been looking for inspirations what other established Go projects do, e.g. Flux CD seems to rely on goreleaser which relies on tagging, so AFAIU everything starts from creating a semver-based tag:
while building from non-relased snapshot sets the so called dev version |
Refs:
Tasks
-version
command line option to return thegitVersion
or the whole VersonInfo like/version
endpoint/version
go-httpbin -version