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

Feat: enhance velq ql and support cue file #4196

Merged
merged 2 commits into from Jun 17, 2022
Merged

Conversation

wonderflow
Copy link
Collaborator

@wonderflow wonderflow commented Jun 16, 2022

Signed-off-by: Jianbo Sun jianbo.sjb@alibaba-inc.com

Description of your changes

This PR changes the experience of vela ql, supports:

vela ql --query "<query>"
vela ql --file my-view.cue

I have:

  • Read and followed KubeVela's contribution process.
  • Related Docs updated properly. In a new feature or configuration option, an update to the documentation is necessary.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

Special notes for your reviewer

@wonderflow wonderflow added the backport release-1.4 add this label will automatically backport this PR to release-1.4 branch label Jun 16, 2022
@wonderflow wonderflow changed the title Feat: enhance velq ql and support cue file Fix: enhance velq ql and support cue file Jun 16, 2022
@codecov
Copy link

codecov bot commented Jun 16, 2022

Codecov Report

Merging #4196 (25260eb) into master (dc0c194) will increase coverage by 13.26%.
The diff coverage is 16.66%.

@@             Coverage Diff             @@
##           master    #4196       +/-   ##
===========================================
+ Coverage   47.13%   60.40%   +13.26%     
===========================================
  Files         295      331       +36     
  Lines       27767    31967     +4200     
===========================================
+ Hits        13089    19309     +6220     
+ Misses      13159    10145     -3014     
- Partials     1519     2513      +994     
Flag Coverage Δ
apiserver-unittests 35.24% <16.66%> (?)
core-unittests 54.94% <10.00%> (-0.05%) ⬇️
e2e-multicluster-test 19.97% <0.00%> (-0.02%) ⬇️
e2e-rollout-tests 22.33% <0.00%> (+0.01%) ⬆️
e2etests 29.34% <0.00%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/velaql/parse.go 65.67% <0.00%> (-26.00%) ⬇️
pkg/workflow/tasks/template/load.go 75.00% <0.00%> (+16.93%) ⬆️
pkg/velaql/view.go 68.29% <37.50%> (-2.76%) ⬇️
pkg/workflow/tasks/discover.go 82.11% <100.00%> (+6.46%) ⬆️
...es/policydefinition/policydefinition_controller.go 64.21% <0.00%> (-5.27%) ⬇️
pkg/cue/definition/template.go 62.80% <0.00%> (-2.80%) ⬇️
pkg/workflow/providers/multicluster/deploy.go 77.52% <0.00%> (-2.25%) ⬇️
...tepdefinition/workflowstepdefinition_controller.go 69.14% <0.00%> (-2.13%) ⬇️
...kg/workflow/providers/multicluster/multicluster.go 81.25% <0.00%> (-2.09%) ⬇️
...troller/core.oam.dev/v1alpha2/application/apply.go 86.66% <0.00%> (ø)
... and 108 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d2fca08...25260eb. Read the comment docs.

pkg/velaql/parse.go Outdated Show resolved Hide resolved
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
@barnettZQG
Copy link
Collaborator

@wonderflow --file provide a view definition? If yes, how to provide the parameters?
Or:

vela ql --query xxx --view-file=./view.cue

@wonderflow
Copy link
Collaborator Author

@wonderflow --file provide a view definition? If yes, how to provide the parameters? Or:

vela ql --query xxx --view-file=./view.cue

user can write the parameter in the cue file, actually we don't need any parameter as the CUE file is concrete. Use case:

vela ql --view-file=./view.cue

The view file should be like:

import (
	"vela/ql"
)
configmap: ql.#Read & {
   value: {
      kind: "ConfigMap"
      apiVersion: "v1"
      metadata: {
        name: "mycm"
      }
   }
}
status: configmap.value.data.key

export: "status"

@wonderflow wonderflow changed the title Fix: enhance velq ql and support cue file Feat: enhance velq ql and support cue file Jun 16, 2022
@wonderflow wonderflow removed the backport release-1.4 add this label will automatically backport this PR to release-1.4 branch label Jun 16, 2022
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
@wonderflow wonderflow merged commit f157515 into kubevela:master Jun 17, 2022
@wonderflow wonderflow deleted the ql branch June 17, 2022 05:44
@wonderflow
Copy link
Collaborator Author

/backport 1.4

@github-actions github-actions bot added the backport release-1.4 add this label will automatically backport this PR to release-1.4 branch label Jun 27, 2022
@github-actions
Copy link

Successfully created backport PR #4266 for release-1.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release-1.4 add this label will automatically backport this PR to release-1.4 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants