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

[Feature] vela def support list version and get detail for definition revision #4131

Closed
wonderflow opened this issue Jun 8, 2022 · 9 comments · Fixed by #4307
Closed

[Feature] vela def support list version and get detail for definition revision #4131

wonderflow opened this issue Jun 8, 2022 · 9 comments · Fixed by #4307
Assignees
Labels
area/cli good first issue Good for newcomers help wanted Extra attention is needed and welcome new comers who are well skilled
Milestone

Comments

@wonderflow
Copy link
Collaborator

wonderflow commented Jun 8, 2022

Is your feature request related to a problem? Please describe.

We have version control for definition, but they can only be used by kubectl which is not unified with vela cli.

https://kubevela.io/docs/platform-engineers/x-def-version

Describe the solution you'd like

I propose we should align with vela def command:

  1. list versions
$ vela def get webservice --versions
NAME            REVISION   HASH               TYPE
webservice-v1   1          3f6886d9832021ba   Component
webservice-v2   2          b3b9978e7164d973   Component
  1. get detailed parameters with specified version
$ vela show webservice --version=v1

Describe alternatives you've considered

Additional context

@wonderflow wonderflow added good first issue Good for newcomers help wanted Extra attention is needed and welcome new comers who are well skilled area/cli labels Jun 8, 2022
@wonderflow wonderflow added this to the KubeVela-v1.5 milestone Jun 8, 2022
@StevenLeiZhang
Copy link
Collaborator

StevenLeiZhang commented Jun 9, 2022

  1. refer to vela addon list, how about show x-definition's versions, when user list them.
➜  ~ vela def list
NAME                         	TYPE                  	NAMESPACE  	DESCRIPTION   AVAILABLE-VERSIONS
config-image-registry     	ComponentDefinition   	vela-system	  xxxx     [v1,v2]
cron-task                    	ComponentDefinition   	vela-system	xxxx           [v1]
  1. vela def get still get the details of specified x-definition, if user specify --version, show the details of specified version. Show the latest version, if version is not specified explicitly
  2. do not need vela def show

@wonderflow
Copy link
Collaborator Author

wonderflow commented Jun 9, 2022

The results between vela def get and vela show are different, you can try:

$ vela show webservice
# Properties
+-------+----------------------------------------------------------------------------------+---------------+----------+---------+
| NAME  |                                   DESCRIPTION                                    |     TYPE      | REQUIRED | DEFAULT |
+-------+----------------------------------------------------------------------------------+---------------+----------+---------+
| cmd   | Commands to run in the container                                                 | []string      | false    |         |
| env   | Define arguments by using environment variables                                  | [[]env](#env) | false    |         |
| image | Which image would you like to use for your service                               | string        | true     |         |
| port  | Which port do you want customer traffic sent to                                  | int           | true     |      80 |
| cpu   | Number of CPU units for the service, like `0.5` (0.5 CPU core), `1` (1 CPU core) | string        | false    |         |
+-------+----------------------------------------------------------------------------------+---------------+----------+---------+
<the usage of the parameter>
$ vela def get webservice

<it print the whole result for CUE definition>

Users may need the result of the parameters they can use.

@StevenLeiZhang
Copy link
Collaborator

StevenLeiZhang commented Jun 10, 2022

The results between vela def get and vela show are different, you can try:

$ vela show webservice
# Properties
+-------+----------------------------------------------------------------------------------+---------------+----------+---------+
| NAME  |                                   DESCRIPTION                                    |     TYPE      | REQUIRED | DEFAULT |
+-------+----------------------------------------------------------------------------------+---------------+----------+---------+
| cmd   | Commands to run in the container                                                 | []string      | false    |         |
| env   | Define arguments by using environment variables                                  | [[]env](#env) | false    |         |
| image | Which image would you like to use for your service                               | string        | true     |         |
| port  | Which port do you want customer traffic sent to                                  | int           | true     |      80 |
| cpu   | Number of CPU units for the service, like `0.5` (0.5 CPU core), `1` (1 CPU core) | string        | false    |         |
+-------+----------------------------------------------------------------------------------+---------------+----------+---------+
<the usage of the parameter>
$ vela def get webservice

<it print the whole result for CUE definition>

Users may need the result of the parameters they can use.

How about

  1. vela def list lists all version for every x-definition as what vela addon lsit does.

available versions are printed by vela def list, not vela def get. This design is aligned with vela addon list

  1. vela def get --version=xxx prints the whole result for CUE definition of specified version
  2. vela def show --version=xxx prints the usage of the parameter of specified version

if version is not specified, just print the latest one.

@wonderflow
Copy link
Collaborator Author

Yes. We're on the same side. The only difference is we already have vela show. I don't deny to add a vela def show but we should still keep vela show.

@charlie0129
Copy link
Member

/assign

@charlie0129
Copy link
Member

charlie0129 commented Jun 29, 2022

Do we need revisions on doc site as well (vela show webservice --web --version v1)? Although I don't think that's much needed.

CLI might just be enough, for history versions.

$ vela show -h
Show the reference doc for component, trait or workflow types.

Usage:
  vela show [flags]

Examples:
show webservice

Flags:
  -e, --env string         specify environment name for application
  -h, --help               help for show
  -n, --namespace string   specify the Kubernetes namespace to use
  -v, --version string     Get the specified version of a definition.
      --web                 start web doc site

Global Flags:
  -y, --yes   Assume yes for all user prompts

@wonderflow
Copy link
Collaborator Author

Yes CLI is enough for now.

@charlie0129
Copy link
Member

I would suggest using --revision over --version, since it is called DefinitionRevision literally

@wonderflow
Copy link
Collaborator Author

I would suggest using --revision over --version, since it is called DefinitionRevision literally

Yes, better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli good first issue Good for newcomers help wanted Extra attention is needed and welcome new comers who are well skilled
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants