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

Cannot run odo init interactively with custom verbosity level flag #5513

Closed
rm3l opened this issue Mar 3, 2022 · 0 comments · Fixed by #5601
Closed

Cannot run odo init interactively with custom verbosity level flag #5513

rm3l opened this issue Mar 3, 2022 · 0 comments · Fixed by #5601
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@rm3l
Copy link
Member

rm3l commented Mar 3, 2022

/kind bug

What versions of software are you using?

Operating System:

❯ cat /etc/fedora-release
Fedora release 35 (Thirty Five)

Output of odo version:

❯ odo version  
odo v2.5.0 (3eb92b6a4)

Server: https://api.crc.testing:6443
Kubernetes: v1.22.3+e790d7f

How did you run odo exactly?

odo init -v 4

Actual behavior

❯ odo init -v 4
 I0303 09:36:52.700054 1605912 implem.go:104] The path for preference file is /home/asoro/.odo/preference.yaml
I0303 09:36:52.700189 1605912 util.go:733] HTTPGetRequest: https://raw.githubusercontent.com/redhat-developer/odo/main/build/VERSION
I0303 09:36:52.700202 1605912 segment.go:251] Checking telemetry enable status
I0303 09:36:52.700253 1605912 implem.go:104] The path for preference file is /home/asoro/.odo/preference.yaml
I0303 09:36:52.700265 1605912 util.go:754] Response will be cached in /tmp/odohttpcache for 1h0m0s
 ✗  missing --name parameter: please add --name <name> to specify a name for the component

Expected behavior

Stumbled upon this while trying to debug a test for #5494. I tried to increase the verbosity level of the odo init command in interactive mode, but this returned an error.
Unless I've missed something, I guess additional flags like -v, --v Level should be ignored when deciding which backend (interactive, flag or Alizer) to leverage.

A workaround I found to be working at this time is to set the ODO_LOG_LEVEL environment variable instead, like so:

❯ ODO_LOG_LEVEL=4 odo init
I0303 09:38:00.336942 1607566 implem.go:104] The path for preference file is /home/asoro/.odo/preference.yaml
I0303 09:38:00.337327 1607566 implem.go:104] The path for preference file is /home/asoro/.odo/preference.yaml
I0303 09:38:00.336975 1607566 util.go:754] Response will be cached in /tmp/odohttpcache for 1h0m0s
I0303 09:38:00.337512 1607566 segment.go:251] Checking telemetry enable status
I0303 09:38:00.745688 1607566 util.go:767] Cached response used.
Based on the files in the current directory odo detected
Language: javascript
Project type: nodejs
The devfile "nodejs" from the registry "DefaultDevfileRegistry" will be downloaded.
? Is this correct? (Y/n) 

Any logs, error output, etc?

There is no issue when running odo init in the non-interactive mode and a custom verbosity level flag set.

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Mar 3, 2022
@rm3l rm3l changed the title Cannot run 'odo init' interactively with custom verbosity level flag Cannot run odo init interactively with custom verbosity level flag Mar 3, 2022
rm3l added a commit to rm3l/odo that referenced this issue Mar 3, 2022
This is to check that the welcoming messages are the first
to be displayed to the end users.

Ideally, changing the log level would be done right at the
command level in each of those tests (e.g.:, odo init -v 0),
but this unfortunately cannot be done at this time due to [1].

[1] redhat-developer#5513
rm3l added a commit to rm3l/odo that referenced this issue Mar 3, 2022
This is to check that the welcoming messages are the first
to be displayed to the end users.

Ideally, changing the log level would be done right at the
command level in each of those tests (e.g.:, odo init -v 0),
but this unfortunately cannot be done at this time due to [1].

[1] redhat-developer#5513
rm3l added a commit to rm3l/odo that referenced this issue Mar 4, 2022
This is to check that the welcoming messages are the first
to be displayed to the end users.

Ideally, changing the log level would be done right at the
command level in each of those tests (e.g.:, odo init -v 0),
but this unfortunately cannot be done at this time due to [1].

[1] redhat-developer#5513
rm3l added a commit to rm3l/odo that referenced this issue Mar 4, 2022
This is to check that the welcoming messages are the first
to be displayed to the end users.

Ideally, changing the log level would be done right at the
command level in each of those tests (e.g.:, odo init -v 0),
but this unfortunately cannot be done at this time due to [1].

[1] redhat-developer#5513
rm3l added a commit to rm3l/odo that referenced this issue Mar 7, 2022
This is to check that the welcoming messages are the first
to be displayed to the end users.

Ideally, changing the log level would be done right at the
command level in each of those tests (e.g.:, odo init -v 0),
but this unfortunately cannot be done at this time due to [1].

[1] redhat-developer#5513
rm3l added a commit to rm3l/odo that referenced this issue Mar 7, 2022
This is to check that the welcoming messages are the first
to be displayed to the end users.

Ideally, changing the log level would be done right at the
command level in each of those tests (e.g.:, odo init -v 0),
but this unfortunately cannot be done at this time due to [1].

[1] redhat-developer#5513
openshift-merge-robot pushed a commit that referenced this issue Mar 7, 2022
* Add test specs meeting the acceptance criteria

* Add welcoming messages to odo init

* Purposely set the log level to 0 in the integration tests

This is to check that the welcoming messages are the first
to be displayed to the end users.

Ideally, changing the log level would be done right at the
command level in each of those tests (e.g.:, odo init -v 0),
but this unfortunately cannot be done at this time due to [1].

[1] #5513

* Make helper.RunInteractive log the command output in case unexpected errors occur

This should hopefully help debug the CI issues

* Initialize the test interactive command sub-process env with a copy of the current process env

Otherwise, as was the case here, we might end up with
cases where the first prompt displayed by an interactive command
is the telemetry consent (unless the appropriate env var is set).
@kadel kadel added the v3 label Mar 9, 2022
@kadel kadel moved this to For Consideration in odo v3-alpha1 Mar 11, 2022
@kadel kadel removed the v3 label Mar 24, 2022
@valaparthvi valaparthvi self-assigned this Mar 29, 2022
@valaparthvi valaparthvi moved this from For Consideration to For Review in odo v3-alpha1 Mar 29, 2022
Repository owner moved this from For Review to Done in odo v3-alpha1 Mar 29, 2022
cdrage pushed a commit to cdrage/odo that referenced this issue Aug 31, 2022
* Add test specs meeting the acceptance criteria

* Add welcoming messages to odo init

* Purposely set the log level to 0 in the integration tests

This is to check that the welcoming messages are the first
to be displayed to the end users.

Ideally, changing the log level would be done right at the
command level in each of those tests (e.g.:, odo init -v 0),
but this unfortunately cannot be done at this time due to [1].

[1] redhat-developer#5513

* Make helper.RunInteractive log the command output in case unexpected errors occur

This should hopefully help debug the CI issues

* Initialize the test interactive command sub-process env with a copy of the current process env

Otherwise, as was the case here, we might end up with
cases where the first prompt displayed by an interactive command
is the telemetry consent (unless the appropriate env var is set).
@rm3l rm3l added the v3 label Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants