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

odo preference - cleanup #5535

Closed
7 tasks done
Tracked by #5522
kadel opened this issue Mar 9, 2022 · 6 comments
Closed
7 tasks done
Tracked by #5522

odo preference - cleanup #5535

kadel opened this issue Mar 9, 2022 · 6 comments
Assignees
Labels
estimated-size/M (10-20) Rough sizing for Epics. About 1 sprint of work for one person

Comments

@kadel
Copy link
Member

kadel commented Mar 9, 2022

there should be the following set of subcommands for odo preference command

examples

$ odo preference set ConsentTelemetry true

Value of 'ConsentTelemetry' preference was set to 'true'
$ odo preference unset ConsentTelemetry

Value of 'ConsentTelemetry' was removed from preferences. Its default value will be used.
$ odo preference add registry StagingRegistry https://registry.stage.devfile.io```

New Devfile registry was added to odo.
$ odo preference remove registry StagingRegistry

Devfile registry 'StagingRegistry' was removed from odo.
$ odo preference view

Preference parameters:
PARAMETER             VALUE
UpdateNotification    true (default)
Timeout               
PushTimeout           
RegistryCacheTime     
Ephemeral             
ConsentTelemetry      false


Devfile registries:
NAME                       URL                                   
StagingRegistry            https://registry.stage.devfile.io     
DefaultDevfileRegistry     https://registry.devfile.io           
``


@kadel kadel added kind/epic An issue categorized as a high-level Epic. Needs to be scoped and broken down in 1+ stories/tasks v3 labels Mar 9, 2022
@kadel kadel added this to the v3.0.0-alpha2 milestone Mar 9, 2022
This was referenced Mar 9, 2022
@kadel kadel added the estimated-size/M (10-20) Rough sizing for Epics. About 1 sprint of work for one person label Mar 23, 2022
@dharmit
Copy link
Member

dharmit commented Mar 23, 2022

[ ] odo preference set - sets value for single value item (UpdateNotification, Timeout, PushTimeout, RegistryCacheTime, Ephemeral, ConsentTelemetry)

We have been using int for all timeouts so far. I suggest using time.Duration for it. We can use DurationVar instead of IntVar from cobra point of view. Two benefits that I can think of by doing this:

  • Not having to convert int to time.Duration as the values are now in time.Duration by default.
  • Clearer CLI documentation, IMO. For example, odo watch -h from main branch looks like:
    $ odo watch -h
    ....
    --delay int              Time in seconds blah blah blah (default 1)
    ....
    But with --delay being set to DurationVar, here it is:
    $ odo watch -h
    ....
    --delay duration         Time in seconds blah blah blah (default 1s)
    ....

@kadel kadel removed the v3 label Mar 24, 2022
@kadel kadel changed the title rework odo preference odo preference - cleanup Mar 24, 2022
@kadel kadel removed the kind/epic An issue categorized as a high-level Epic. Needs to be scoped and broken down in 1+ stories/tasks label May 16, 2022
@kadel kadel modified the milestones: v3.0.0-beta1, v3.0.0-beta2 Jun 2, 2022
@valaparthvi
Copy link
Contributor

valaparthvi commented Jun 13, 2022

@dharmit, taking your suggestion into account, the commands will look like the following:
odo preference set

$ odo preference set timeout 4m
? timeout is already set. Do you want to override it in the config Yes
Global preference was successfully updated

odo preference view

$ odo preference view           
PARAMETER             CURRENT_VALUE
UpdateNotification    false
Timeout               4m0s
PushTimeout           
RegistryCacheTime     
Ephemeral             
ConsentTelemetry      true

odo preference --help

$ odo preference --help
Modifies odo specific configuration settings within the global preference file.


Available Global Parameters:
 ...
 ...
 Timeout - Timeout (in Duration) for cluster server connection check (Default: 1s)
 ...

...
...
Examples:

  ...
  ...
  # All available preference values you can set
  ...
  odo preference set Timeout 1s
  ...
 ...

Is this what you were going for?

cc: @kadel

@dharmit
Copy link
Member

dharmit commented Jun 13, 2022

@valaparthvi yeah, that looks more like what I had in mind. 👍🏾

@valaparthvi valaparthvi moved this to In Progress in odo v3-beta1 Jun 13, 2022
@valaparthvi
Copy link
Contributor

@kadel What plans do you have for odo preference registry list, and odo preference registry update? Will we still keep them as is and only move add, and remove?

@valaparthvi
Copy link
Contributor

@kadel What plans do you have for odo preference registry list, and odo preference registry update? Will we still keep them as is and only move add, and remove?

From the cabal discussion:

  • Drop odo preference registry update; if needed, user can always remove and add registry
  • Move odo preference registry list to odo preference view

@dharmit
Copy link
Member

dharmit commented Jun 22, 2022

  • Drop odo preference registry update; if needed, user can always remove and add registry

  • Move odo preference registry list to odo preference view

@valaparthvi IMO, we should add these to the issue's acceptance criteria.

Repository owner moved this from In Progress to Done in odo v3-beta2 Jun 28, 2022
@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
estimated-size/M (10-20) Rough sizing for Epics. About 1 sprint of work for one person
Projects
No open projects
Status: Done
Development

No branches or pull requests

4 participants