Skip to content
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

Add version and revision in config response #297

Merged
merged 3 commits into from
Aug 23, 2023

Conversation

anubhavmishra
Copy link
Contributor

@anubhavmishra anubhavmishra commented Aug 17, 2023

This PR adds version and short_revision in the /api/v1/web/config API response.

Note: This change won't affect the hermes version command output. It will continue showing the version number of the application.

@anubhavmishra anubhavmishra requested a review from a team as a code owner August 17, 2023 01:40
// commit or checkout revision
// from build information
func GetShortRevision() string {
if info, ok := debug.ReadBuildInfo(); ok {
Copy link
Contributor Author

@anubhavmishra anubhavmishra Aug 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go 1.18 supports version control information. https://pkg.go.dev/runtime/debug#ReadBuildInfo

@jeffdaley
Copy link
Contributor

LGTM! Is revision the same as SHA? If so, my preference would be to call it a SHA, since that's what we've been referring to it internally as. But I'm also happy to learn a new term.

Aside: TIL 7-char SHAs redirect to the full URL.

@anubhavmishra
Copy link
Contributor Author

@jeffdaley Yea, I thought about this and settled on revision. Wanted to follow what Golang suggests vcs.revision given VCS could be any version control system.

internal/version/version.go Outdated Show resolved Hide resolved
@anubhavmishra anubhavmishra merged commit b4d0645 into main Aug 23, 2023
2 checks passed
@anubhavmishra anubhavmishra deleted the anubhavmishra/version-and-revision branch August 23, 2023 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants