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

Implement API for generating OpenAPI schema for definition #784

Merged
merged 2 commits into from
Jan 6, 2021

Conversation

zzxwill
Copy link
Collaborator

@zzxwill zzxwill commented Dec 18, 2020

Fetched cue parameters from workloaddefinition/traitdefinition, generated
OpenAPI v3 schema, fixed problems of tainted description filed, added filed
"title" required by form-render component, added it in API server router

To fix #680

@zzxwill zzxwill marked this pull request as ready for review December 21, 2020 08:39
@codecov
Copy link

codecov bot commented Dec 21, 2020

Codecov Report

Merging #784 (a9a419d) into master (810cbca) will increase coverage by 0.24%.
The diff coverage is 51.79%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #784      +/-   ##
==========================================
+ Coverage   35.94%   36.19%   +0.24%     
==========================================
  Files         103      105       +2     
  Lines        8668     8821     +153     
==========================================
+ Hits         3116     3193      +77     
- Misses       5192     5252      +60     
- Partials      360      376      +16     
Flag Coverage Δ
unittests 36.19% <51.79%> (+0.24%) ⬆️

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

Impacted Files Coverage Δ
cmd/core/main.go 20.66% <0.00%> (-0.28%) ⬇️
pkg/appfile/service.go 70.50% <ø> (ø)
...plicationconfiguration/applicationconfiguration.go 83.95% <0.00%> (-0.35%) ⬇️
...dev/v1alpha2/applicationconfiguration/component.go 71.65% <0.00%> (ø)
.../core/scopes/healthscope/healthscope_controller.go 75.23% <ø> (ø)
.../manualscalertrait/manualscalertrait_controller.go 0.00% <ø> (ø)
...erizedworkload/containerizedworkload_controller.go 0.00% <ø> (ø)
pkg/serverlib/definition.go 43.15% <43.15%> (ø)
pkg/utils/common/common.go 58.49% <81.81%> (ø)
...licationconfiguration/component_custom_revision.go 63.63% <100.00%> (+53.63%) ⬆️
... and 4 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 810cbca...da09798. Read the comment docs.

@zzxwill zzxwill changed the title [WIP] Implement API for generating OpenAPI schema for definition Implement API for generating OpenAPI schema for definition Dec 21, 2020
go.mod Outdated Show resolved Hide resolved
pkg/server/definitionHandler.go Outdated Show resolved Hide resolved
pkg/utils/common/common.go Show resolved Hide resolved
pkg/utils/common/common.go Show resolved Hide resolved
pkg/utils/common/common.go Show resolved Hide resolved
pkg/server/definitionHandler_test.go Outdated Show resolved Hide resolved
@zzxwill zzxwill force-pushed the form-render branch 3 times, most recently from ff273cf to 6721724 Compare December 23, 2020 02:57
@zzxwill zzxwill changed the title Implement API for generating OpenAPI schema for definition [WIP][Testing Codecov]Implement API for generating OpenAPI schema for definition Dec 23, 2020
@zzxwill zzxwill force-pushed the form-render branch 2 times, most recently from a9bccbb to 7daa8b9 Compare December 25, 2020 07:53
@zzxwill zzxwill changed the title [WIP][Testing Codecov]Implement API for generating OpenAPI schema for definition Implement API for generating OpenAPI schema for definition Dec 25, 2020
@zzxwill zzxwill force-pushed the form-render branch 2 times, most recently from a59dcf3 to 96373dd Compare December 29, 2020 02:13
Copy link
Collaborator

@wonderflow wonderflow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review了一半,感觉我前面的review似乎都没改?

.gitignore Outdated Show resolved Hide resolved
pkg/serverlib/definition.go Show resolved Hide resolved
pkg/serverlib/definition.go Show resolved Hide resolved
pkg/serverlib/definition.go Outdated Show resolved Hide resolved
@zzxwill zzxwill force-pushed the form-render branch 3 times, most recently from 4d71259 to 90194bb Compare January 2, 2021 07:59
Fetched cue parameters from workloaddefinition/traitdefinition, generated
OpenAPI v3 schema, fixed problems of tainted `description` filed, added filed
"title" required by form-render component, added it in API server router

To fix kubevela#680
@wonderflow
Copy link
Collaborator

Much better now, ping @hongchaodeng to do one more round review.

@ryanzhang-oss
Copy link
Collaborator

One question, does this still work if we move this to the serverside (no local files)?

@zzxwill
Copy link
Collaborator Author

zzxwill commented Jan 6, 2021

One question, does this still work if we move this to the serverside (no local files)?

No, currently it heavily depends on the local ~/.vela folder.

@wonderflow
Copy link
Collaborator

@zzxwill we should use a storage interface to do so, just like #751

Copy link
Member

@hongchaodeng hongchaodeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm with one minor comment

pkg/appfile/service.go Outdated Show resolved Hide resolved
Co-authored-by: Hongchao Deng <hongchaodeng1@gmail.com>
@wonderflow wonderflow merged commit 775991c into kubevela:master Jan 6, 2021
@zzxwill zzxwill deleted the form-render branch February 1, 2021 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature][Dashboard][OpenAPI] auto-render frontend form for WorkloadDefinition/TraitDefinition
4 participants