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

Allow specifying message to end the spinner with #5972

Merged
merged 2 commits into from
Aug 16, 2022
Merged

Allow specifying message to end the spinner with #5972

merged 2 commits into from
Aug 16, 2022

Conversation

dharmit
Copy link
Member

@dharmit dharmit commented Jul 25, 2022

Signed-off-by: Dharmit Shah shahdharmit@gmail.com

What type of PR is this:
/kind bug

What does this PR do / why we need it:
It fixes the UX that would lead a user to think that there was some error in executing the run command

Which issue(s) this PR fixes:
Fixes #5881

PR acceptance criteria:

  • Unit test

  • Integration test

  • Documentation

How to test changes / Special notes to the reviewer:

  • Run odo dev
  • Change a code file in the directory; odo should not exhibit the erroneous UX
  • Stop odo dev with Ctrl+C; odo should not exhibit the erroneous UX

@netlify
Copy link

netlify bot commented Jul 25, 2022

Deploy Preview for odo-docusaurus-preview canceled.

Name Link
🔨 Latest commit 3534e22
🔍 Latest deploy log https://app.netlify.com/sites/odo-docusaurus-preview/deploys/62f4ff1c6f9f9300097e4f07

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Jul 25, 2022
@dharmit dharmit requested review from rm3l and valaparthvi and removed request for rm3l July 25, 2022 06:57
@openshift-ci openshift-ci bot requested review from cdrage and feloy July 25, 2022 06:58
@dharmit dharmit requested review from rm3l and removed request for cdrage and feloy July 25, 2022 06:58
@odo-robot
Copy link

odo-robot bot commented Jul 25, 2022

Unit Tests on commit 29be44a finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Jul 25, 2022

OpenShift Tests on commit 29be44a finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Jul 25, 2022

Windows Tests (OCP) on commit 29be44a finished with errors.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Jul 25, 2022

Validate Tests on commit 29be44a finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Jul 25, 2022

Kubernetes Tests on commit 29be44a finished successfully.
View logs: TXT HTML

Copy link
Member

@rm3l rm3l left a comment

Choose a reason for hiding this comment

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

Added a comment. I think #5964 is also trying to change how the "Executing the application..." message is displayed to the users.

But regarding the original issue addressed here, would it make sense to capture the interrupt signal in kubeexec.go (where the command goroutine is spawned), and then, in the goroutine itself, detect that signal and call the handler in a way that allows it to handle this case differently (maybe with a status different from Stopped/Errored)?
This way, I think, it would solve the issue of notifying users if the command errors out anytime after it has been started, and it would not display any message if the dev session stops normally.
What do you think?

case remotecmd.Stopped, remotecmd.Errored:
s.End(status == remotecmd.Stopped)
Copy link
Member

Choose a reason for hiding this comment

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

If there is an error a few seconds/minutes after the command has started, users would never be aware of this, I think. See my comment in #5964 (review)

For certain long running tasks, we need to specify a message that
doesn't confuse the user when the spinnner ends. This commit adds
`EndWithStatus` which is a wrapper on top of `End` and lets the
developer specify a custom message to end the spinner with.

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
@dharmit
Copy link
Member Author

dharmit commented Aug 11, 2022

But regarding the original issue addressed here, would it make sense to capture the interrupt signal in kubeexec.go (where the command goroutine is spawned), and then, in the goroutine itself, detect that signal and call the handler in a way that allows it to handle this case differently (maybe with a status different from Stopped/Errored)?
This way, I think, it would solve the issue of notifying users if the command errors out anytime after it has been started, and it would not display any message if the dev session stops normally. What do you think?

@rm3l I had a chat about this with @feloy. His point was that the status indicated by odo is technically correct. So we concluded to change the wording so that it's less confusing for the user. I have pushed a change accordingly. PTAL and let me know what you think about it.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Aug 11, 2022
@rm3l
Copy link
Member

rm3l commented Aug 11, 2022

/approve

@openshift-ci
Copy link

openshift-ci bot commented Aug 11, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rm3l

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. label Aug 11, 2022
@rm3l
Copy link
Member

rm3l commented Aug 11, 2022

@dharmit This PR is no longer about using SpinnerNoSpin.. Can you change the PR title accordingly? Because this is what will appear in the Git history of the main branch.

@dharmit dharmit changed the title Use SpinnerNoSpin for the long-running command Allow specifying message to end the spinner with Aug 11, 2022
@feloy feloy closed this Aug 11, 2022
@feloy feloy reopened this Aug 11, 2022
@feloy feloy closed this Aug 16, 2022
@feloy feloy reopened this Aug 16, 2022
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@dharmit
Copy link
Member Author

dharmit commented Aug 16, 2022

/override windows-integration-test/Windows-test

@openshift-ci
Copy link

openshift-ci bot commented Aug 16, 2022

@dharmit: Overrode contexts on behalf of dharmit: windows-integration-test/Windows-test

In response to this:

/override windows-integration-test/Windows-test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-merge-robot openshift-merge-robot merged commit 72d632b into redhat-developer:main Aug 16, 2022
@dharmit dharmit deleted the fix-5881 branch August 17, 2022 09:05
feloy added a commit to feloy/odo that referenced this pull request Aug 18, 2022
cdrage pushed a commit to cdrage/odo that referenced this pull request Aug 31, 2022
* Allow specifying message to end the spinner with

For certain long running tasks, we need to specify a message that
doesn't confuse the user when the spinnner ends. This commit adds
`EndWithStatus` which is a wrapper on top of `End` and lets the
developer specify a custom message to end the spinner with.

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>

* Update pkg/devfile/adapters/kubernetes/component/commandhandler.go

Co-authored-by: Armel Soro <armel@rm3l.org>

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
Co-authored-by: Armel Soro <armel@rm3l.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. Required by Prow.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

odo dev prints ✗ Executing the application after cleaning up the resources
4 participants