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 commit hash dirty implementation, similar to kuadrantctl, to authorino. #471

Closed
ehearneRedHat opened this issue Jun 12, 2024 · 3 comments · Fixed by #473
Closed

Add commit hash dirty implementation, similar to kuadrantctl, to authorino. #471

ehearneRedHat opened this issue Jun 12, 2024 · 3 comments · Fixed by #473
Assignees
Labels
kind/enhancement New feature or request
Milestone

Comments

@ehearneRedHat
Copy link
Contributor

ehearneRedHat commented Jun 12, 2024

After speaking with @eguzki in kuadrantctl #85 , the idea of adding a commit hash to the version output of authorino, similar to kuadrantctl, would be a great way for users to see where exactly their version of authorino is coming from.

This can be done through a Makefile target, such as in build . Refer to the above issue to see how it was implemented in kuadrantctl for context.

Additional Context

In addition to the already implemented version and hash being displayed, it would be great to show whether the version of authorino contains just the work on the main branch, or if there were additional changes made to the repository before being committed.

Within kuadrantctl, when ./kuadrantctl version is used, the output when there is additional changes made before being compiled, looks like

kuadrantctl version: <version> (<git-hash>-dirty)

A hash, while beneficial to the keen eye, can easily be overlooked, where as by showing the the branch in question has changes unknown to the user, they can go ahead and remove those changes so their binary is not dirty.

Therefore, within authorino, this additional feature, when the branch has new changes, can be implemented something like

$ ./authorino version
Authorino dc90ac837c3babc6afe6e1e5aacb64fe84c58088 (dirty)

Otherwise, it will remain the same if no new changes were made to the branch

$ ./authorino version
Authorino dc90ac837c3babc6afe6e1e5aacb64fe84c58088
@ehearneRedHat ehearneRedHat added the kind/enhancement New feature or request label Jun 12, 2024
@guicassolato
Copy link
Collaborator

@ehearneRedHat, the Authorino binary already includes the version, which is either a SHA (latest builds) or a semantic version (releases.)

Apart from printed to the logs when the auth server starts:

{"level":"info","ts":"2024-06-12T13:48:57Z","logger":"authorino","msg":"booting up authorino","version":"dc90ac837c3babc6afe6e1e5aacb64fe84c58088","cmd":"server"}

one can also check it by running:

$ ./authorino version
Authorino dc90ac837c3babc6afe6e1e5aacb64fe84c58088

@ehearneRedHat
Copy link
Contributor Author

@guicassolato I was speaking with @eguzki again, and I was made aware that additional context may be needed to understand what the proposed feature was.

I have added that context to the first comment. Thank you for the additional information. :)

@eguzki
Copy link
Collaborator

eguzki commented Jun 13, 2024

This is an effort to have consistent versioning across all kuadrant components. The generic format is:

<version> (<git-hash>[-dirty])
  • <version> will be numeric with format vX.Y.Z[-dev]. -dev suffix expressing it is wip version of the yet unreleased version
  • <git-hash> is the git commit hash. The optional [-dirty] suffix comes when the build has been made out of uncommited files.

@ehearneRedHat ehearneRedHat self-assigned this Jun 27, 2024
@ehearneRedHat ehearneRedHat changed the title Add commit hash implementation, similar to kuadrantctl, to authorino. Add commit hash dirty implementation, similar to kuadrantctl, to authorino. Jun 28, 2024
@ehearneRedHat ehearneRedHat moved this to Ready For Review in Kuadrant Jul 24, 2024
@guicassolato guicassolato added this to the v0.18.x milestone Aug 21, 2024
@github-project-automation github-project-automation bot moved this from Ready For Review to Done in Kuadrant Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants