-
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
Do not necessarily error out if odo dev
is stopped via Ctrl+C
#6917
Merged
openshift-merge-robot
merged 5 commits into
redhat-developer:main
from
rm3l:6514-ctrl-c-odo-dev-reported-as-an-error-in-telemetry
Jun 22, 2023
Merged
Do not necessarily error out if odo dev
is stopped via Ctrl+C
#6917
openshift-merge-robot
merged 5 commits into
redhat-developer:main
from
rm3l:6514-ctrl-c-odo-dev-reported-as-an-error-in-telemetry
Jun 22, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for odo-docusaurus-preview canceled.
|
openshift-ci
bot
added
kind/bug
Categorizes issue or PR as related to a bug.
area/dev
Issues or PRs related to `odo dev`
area/refactoring
Issues or PRs related to code refactoring
labels
Jun 21, 2023
rm3l
requested review from
feloy and
valaparthvi
and removed request for
kadel and
anandrkskd
June 21, 2023 10:10
Looking into the tests that are not passing... |
openshift-ci
bot
added
the
do-not-merge/work-in-progress
Indicates that a PR should not merge because it is a work in progress. Required by Prow.
label
Jun 21, 2023
rm3l
force-pushed
the
6514-ctrl-c-odo-dev-reported-as-an-error-in-telemetry
branch
2 times, most recently
from
June 21, 2023 15:47
21ec4e7
to
ceb4872
Compare
openshift-ci
bot
removed
the
do-not-merge/work-in-progress
Indicates that a PR should not merge because it is a work in progress. Required by Prow.
label
Jun 21, 2023
feloy
approved these changes
Jun 22, 2023
openshift-ci
bot
added
the
lgtm
Indicates that a PR is ready to be merged. Required by Prow.
label
Jun 22, 2023
See ExitInMain[1] and ExitInMain_ExitOnce[2] coding convention guidelines. [1] https://github.com/redhat-developer/odo/wiki/Dev:-Coding-Conventions#exit-in-main [2] https://github.com/redhat-developer/odo/wiki/Dev:-Coding-Conventions#exit-once
This makes sure the exit code of the command is mapped onto any error returned by Cleanup
rm3l
force-pushed
the
6514-ctrl-c-odo-dev-reported-as-an-error-in-telemetry
branch
from
June 22, 2023 08:21
ceb4872
to
9b891a7
Compare
openshift-ci
bot
removed
the
lgtm
Indicates that a PR is ready to be merged. Required by Prow.
label
Jun 22, 2023
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Had to rebase onto |
feloy
approved these changes
Jun 22, 2023
openshift-ci
bot
added
the
lgtm
Indicates that a PR is ready to be merged. Required by Prow.
label
Jun 22, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/dev
Issues or PRs related to `odo dev`
area/refactoring
Issues or PRs related to code refactoring
kind/bug
Categorizes issue or PR as related to a bug.
lgtm
Indicates that a PR is ready to be merged. Required by Prow.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this:
/kind bug
/area dev
/area refactoring
What does this PR do / why we need it:
This PR makes sure hitting
Ctrl-C
is not reported as an error. Well, the exit code is mapped onto any error returned while cleaning up the Dev resources.But in telemetry, no error should be reported.
To do so, it first starts with refactoring error handling, making sure errors are propagated correctly up to the CLI layer, so that non-nil errors would propagate as non-zero exit code and nil errors will be propagated as zero exit code.
See [1] and [2] for the rationale.
[1] https://github.com/redhat-developer/odo/wiki/Dev:-Coding-Conventions#exit-in-main
[2] https://github.com/redhat-developer/odo/wiki/Dev:-Coding-Conventions#exit-once
Which issue(s) this PR fixes:
Fixes #6514
PR acceptance criteria:
Unit test
Integration test
Documentation
How to test changes / Special notes to the reviewer:
The exit code of
odo dev
is now mapped to the error returned when cleaning up the Dev resources. However, no error is reported in telemetry regardless of the status of the cleanup logic.