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

Display Git commit ID in output of odo commands where the version is shown #6131

Closed
rm3l opened this issue Sep 16, 2022 · 2 comments · Fixed by #7074
Closed

Display Git commit ID in output of odo commands where the version is shown #6131

rm3l opened this issue Sep 16, 2022 · 2 comments · Fixed by #7074
Assignees
Labels
kind/task Issue is actionable task lifecycle/active Indicates that an issue or PR is actively being worked on. It will not be closed automatically. priority/Medium Nice to have issue. Getting it done before priority changes would be great.
Milestone

Comments

@rm3l
Copy link
Member

rm3l commented Sep 16, 2022

/kind feature

odo commands currently include a header that contains the latest odo version, e.g:

  __                    
 /  \__     Developing using the my-project Devfile                                     
 \__/  \    Namespace: default                     
 /  \__/    odo version: v3.0.0-rc1
 \__/    

This is fine, but does not help in identifying exactly the right commit, unless we run an additional odo version command.

To help with troubleshooting and issue reporting, I suggest we also include the Git commit ID in this header, like so:

  __
 /  \__     Deploying the application using my-project Devfile
 \__/  \    Namespace: default
 /  \__/    odo version: v3.0.0-rc1 (995e0deed-dirty)
 \__/

This could help for example in troubleshooting commands that run in CI, in case we need to check that the odo binary that is running is the expected one.

Also, the current Git commit ID is determined with git rev-parse --short HEAD, which returns the commit ID for HEAD, but tells nothing about the state of the working tree.
I think a command like git describe --no-match --always --abbrev=9 --dirty --broken should produce a more helpful output, by appending the appropriate suffix or nothing, depending on the state of the working tree: -dirty if the working tree has local changes or -broken if the repo is corrupt.

@openshift-ci openshift-ci bot added the kind/feature Categorizes issue as a feature request. For PRs, that means that the PR is the implementation label Sep 16, 2022
@rm3l rm3l added this to odo Project Oct 3, 2022
@rm3l rm3l moved this to To Do 📝 in odo Project Oct 3, 2022
@rm3l rm3l removed the status in odo Project Oct 3, 2022
@kadel kadel added priority/Medium Nice to have issue. Getting it done before priority changes would be great. kind/task Issue is actionable task and removed kind/feature Categorizes issue as a feature request. For PRs, that means that the PR is the implementation labels Feb 23, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

A friendly reminder that this issue had no activity for 90 days. Stale issues will be closed after an additional 30 days of inactivity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 5, 2023
@rm3l rm3l changed the title Display Git commit ID in output of all odo commands Display Git commit ID in output of odo commands where the version is shown Sep 6, 2023
rm3l added a commit to rm3l/odo that referenced this issue Sep 6, 2023
…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
@rm3l rm3l moved this to In Review 👀 in odo Project Sep 6, 2023
@rm3l
Copy link
Member Author

rm3l commented Sep 6, 2023

/remove-lifecycle state
/lifecycle active

@openshift-ci openshift-ci bot added lifecycle/active Indicates that an issue or PR is actively being worked on. It will not be closed automatically. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Sep 6, 2023
@rm3l rm3l added this to the v3.15.0 🚀 milestone Sep 6, 2023
@rm3l rm3l self-assigned this Sep 6, 2023
openshift-merge-robot pushed a commit that referenced this issue Sep 6, 2023
…s shown (#7074)

* Display Git commit ID in output of odo commands where the version is 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 #6131 for more context

* Append the state of the working tree next to the Git commit ID

`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.

* Fix integration tests

* Fix doc automation tests

Strip the Git commit ID from the full odo version string
prior to comparing the outputs.
We still want to compare the tag displayed.
@github-project-automation github-project-automation bot moved this from In Review 👀 to Done ✅ in odo Project Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/task Issue is actionable task lifecycle/active Indicates that an issue or PR is actively being worked on. It will not be closed automatically. priority/Medium Nice to have issue. Getting it done before priority changes would be great.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants