UffizziCloud / uffizzi_cli

The command-line interface for the Uffizzi API
Apache License 2.0
86 stars 46 forks source link

Cli improvements #54

Open moklidia opened 2 years ago

moklidia commented 2 years ago

1) Typo after running uffizzi login

Login to Uffizzi to your previews.

Should say:

Login to Uffizzi to view and manage your previews.  

2) Improve error message for uffizzi preview service list. Subcommand is service list but usage command shows:

ERROR: "uffizzi service list" was called with no arguments
Usage: "uffizzi service logs [DEPLOYMENT_ID]"  

3) Unfriendly error message uffizzi preview create docker-compose.uffizzi.yml (Note: I didn’t have a config file.)

/usr/local/bundle/gems/uffizzi-cli-0.5.0/lib/uffizzi/services/compose_file_service.rb:25:in `read': No such file or directory @ rb_sysopen - ./vote.conf (Errno::ENOENT)
    from /usr/local/bundle/gems/uffizzi-cli-0.5.0/lib/uffizzi/services/compose_file_service.rb:25:in `block in prepare_dependency_files_data'
    from /usr/local/bundle/gems/uffizzi-cli-0.5.0/lib/uffizzi/services/compose_file_service.rb:24:in `map'
    from /usr/local/bundle/gems/uffizzi-cli-0.5.0/lib/uffizzi/services/compose_file_service.rb:24:in `prepare_dependency_files_data'
    from /usr/local/bundle/gems/uffizzi-cli-0.5.0/lib/uffizzi/services/compose_file_service.rb:20:in `prepare_dependencies'
    from /usr/local/bundle/gems/uffizzi-cli-0.5.0/lib/uffizzi/services/compose_file_service.rb:14:in `parse'
    from /usr/local/bundle/gems/uffizzi-cli-0.5.0/lib/uffizzi/cli/preview.rb:269:in `prepare_params'
    from /usr/local/bundle/gems/uffizzi-cli-0.5.0/lib/uffizzi/cli/preview.rb:80:in `handle_create_command'
    from /usr/local/bundle/gems/uffizzi-cli-0.5.0/lib/uffizzi/cli/preview.rb:59:in `run'
    from /usr/local/bundle/gems/uffizzi-cli-0.5.0/lib/uffizzi/cli/preview.rb:25:in `create'
    from /usr/local/bundle/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
    from /usr/local/bundle/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
    from /usr/local/bundle/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
    from /usr/local/bundle/gems/thor-1.2.1/lib/thor/invocation.rb:116:in `invoke'
    from /usr/local/bundle/gems/thor-1.2.1/lib/thor.rb:243:in `block in subcommand'
    from /usr/local/bundle/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
    from /usr/local/bundle/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
    from /usr/local/bundle/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
    from /usr/local/bundle/gems/uffizzi-cli-0.5.0/lib/uffizzi/cli.rb:74:in `dispatch'
    from /usr/local/bundle/gems/thor-1.2.1/lib/thor/base.rb:485:in `start'
    from /usr/local/bundle/gems/uffizzi-cli-0.5.0/exe/uffizzi:5:in `<top (required)>'
    from /usr/local/bundle/bin/uffizzi:25:in `load'
    from /usr/local/bundle/bin/uffizzi:25:in `<main>'

4) Ambiguous error message from uffizzi preview create docker-compose.uffizzi.yml

Compose repository is undefined

5) I would be helpful to give line numbers here:

~ # uffizzi preview create docker-compose.uffizzi.yml
Service worker has neither an image nor a build context specified. At least one must be provided.

6) Unfriendly error message for bad credentials:

~ # uffizzi connect docker-hub
Username:  gadkins
Password:  
/usr/local/bundle/gems/uffizzi-cli-0.5.0/lib/uffizzi/response_helper.rb:41:in `print_errors': undefined method `each_key' for nil:NilClass (NoMethodError)
    from /usr/local/bundle/gems/uffizzi-cli-0.5.0/lib/uffizzi/response_helper.rb:31:in `handle_failed_response'
    from /usr/local/bundle/gems/uffizzi-cli-0.5.0/lib/uffizzi/cli/connect.rb:44:in `handle_docker_hub'
    from /usr/local/bundle/gems/uffizzi-cli-0.5.0/lib/uffizzi/cli/connect.rb:12:in `run'
    from /usr/local/bundle/gems/uffizzi-cli-0.5.0/lib/uffizzi/cli.rb:58:in `connect'
    from /usr/local/bundle/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
    from /usr/local/bundle/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
    from /usr/local/bundle/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
    from /usr/local/bundle/gems/uffizzi-cli-0.5.0/lib/uffizzi/cli.rb:74:in `dispatch'
    from /usr/local/bundle/gems/thor-1.2.1/lib/thor/base.rb:485:in `start'
    from /usr/local/bundle/gems/uffizzi-cli-0.5.0/exe/uffizzi:5:in `<top (required)>'
    from /usr/local/bundle/bin/uffizzi:25:in `load'
    from /usr/local/bundle/bin/uffizzi:25:in `<main>'

7) This error message should probably be displayed before asking for my credentials.

~ # uffizzi connect docker-hub
Username: gadkins
Password:  
Credential of that type already exist.

The error message should say:

Credentials of type 'docker-hub' already exist for this account. To remove them, run $ uffizzi disconnect docker-hub

8) There is currently no way to view which credentials uffizzi has. We could add a command to list credentials that uffizzi connect uses:

uffizzi connect list-credentials
moklidia commented 2 years ago

Linked API PR: https://github.com/UffizziCloud/uffizzi_app/pull/55

moklidia commented 2 years ago

1) Couldn't reproduce this particular message 2) Fixed 3) Fixed 4) Not relevant - GitHub credentials are switched off for CLI 5) We don't have the ability to track the line number 6) Couldn't reproduce 7) Fixed 8) Implemented

Please also check the help for the following commands:

bundle exec uffizzi connect
bundle exec uffizzi connect docker-hub
bundle exec uffizzi connect gcr
bundle exec uffizzi connect acr
bundle exec uffizzi connect ecr
bundle exec uffizzi connect ghcr
bundle exec uffizzi disconnect

Please check that default help messages for subcommands (without arguments) are consistent with description in the man files

bundle exec uffizzi project
bundle exec uffizzi preview
bundle exec uffizzi coect
NealArw commented 2 years ago

:point_right: 1. Not Fixed

  1. Tested - OK
bash-5.1# bundle exec uffizzi preview service list
ERROR: "uffizzi service list" was called with no arguments
Usage: "uffizzi service list [DEPLOYMENT_ID]"
  1. Tested - OK
bash-5.1# bundle exec uffizzi project compose set -f file.yml
No such file or directory @ rb_sysopen - file.yml
bash-5.1#
  1. Skiped

  2. Skiped

:point_right: 6. Couldn't reproduce. Skiped. @gadkins Please, could you add additional information about this case?

:point_right: 7. Not Fixed

bash-5.1# bundle exec uffizzi connect docker-hub
Username:  uffizzitest
Password:
Credential of that type already exist.
bash-5.1#

:point_right: 8. Tested - OK. @gadkins I think, we need help for the new command uffizzi connect list-credentials? Please, could you perform a description of the help?

bash-5.1# bundle exec uffizzi connect list-credentials
ecr
docker-hub
gcr
acr
NealArw commented 2 years ago

BUG: Try to login into docker with invalid credentials:

bash-5.1# bundle exec uffizzi connect docker-hub
Username:  q
Password:
undefined method `token' for "{\"detail\":\"Incorrect authentication credentials\"}\n\n":String
moklidia commented 2 years ago
NealArw commented 2 years ago

1. TESTED - OK

bash-5.1# bundle exec uffizzi login
Login to Uffizzi to view and manage your previews.
bash-5.1#

👉 7. Needs to reduce space size between words account. and To remove.

bash-5.1# bundle exec uffizzi connect ecr
Credentials of type ecr already exist for this account.       To remove them, run $ uffizzi disconnect ecr
bash-5.1

Login to Docker with invalid credentials - TESTED - OK

bash-5.1# bundle exec uffizzi connect docker-hub
Username:  uffizzitest
Password:
Successfully connected to DockerHub
bash-5.1#

Login to GHCR - fixed (https://github.com/UffizziCloud/uffizzi_cli/issues/66) TESTED - OK

bash-5.1# bundle exec uffizzi connect ghcr
Github Username:  NealArw
Access Token:
Successfully connected to GHCR
bash-5.1#
NealArw commented 2 years ago
  1. TESTED - OK
bash-5.1# bundle exec uffizzi connect docker-hub
Credentials of type docker-hub already exist for this account. To remove them, run $ uffizzi disconnect docker-hub.
bash-5.1#
NealArw commented 2 years ago

TESTED on prod:

  1. OK
  2. OK
  3. OK
  4. OK
  5. OK
  6. OK