-
Notifications
You must be signed in to change notification settings - Fork 243
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
Display Git commit ID in output of odo
commands where the version is shown
#7074
Conversation
…displayed This covers: - odo init - odo dev - odo deploy Displaying the commit ID (same as in `odo version`) will help quickly pinpoint the exact commit without having to run `odo version`. See redhat-developer#6131 for more context
`git describe` is much more helpful to quickly understand the state of the working tree. For backward compatibility, we are defaulting to `git rev-parse`, just in case `git describe` does not work correctly.
✅ Deploy Preview for odo-docusaurus-preview canceled.
|
In CI, we can see that the working tree has local changes, which is weird to me. I'm looking into this..
|
Strip the Git commit ID from the full odo version string prior to comparing the outputs. We still want to compare the tag displayed.
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Ok, the problem is that after cloning odo in CI, we are copying the local repo of odo to a temporary directory before running the tests. For the repo in the temporary directory not to be marked as dirty, the Git index needs to be refreshed (either manually or using other Git commands that can auto-refresh it), but that should not be an issue for the doc automation tests here. /hold cancel |
What type of PR is this:
/kind task
What does this PR do / why we need it:
To help with troubleshooting, this PR appends the Git commit ID next to the
odo
version in the output of commands where the version is shown. This currently includes:odo version
odo init
odo dev
odo deploy
Furthermore, the Git commit ID displayed is enriched with the current state of the working tree, like
-dirty
if the working tree has local changes. This will help quickly understand the version and help troubleshoot commands that run in CI for example.Example:
Which issue(s) this PR fixes:
Fixes #6131
PR acceptance criteria:
Unit test
Integration test
Documentation
How to test changes / Special notes to the reviewer: