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

Genereate openapi schema with k8s types included #2153

Closed
wants to merge 2 commits into from

Conversation

zachaller
Copy link
Collaborator

@zachaller zachaller commented Jul 21, 2022

fixes #1730

Signed-off-by: zachaller zachaller@hotmail.com

@github-actions
Copy link
Contributor

github-actions bot commented Jul 21, 2022

Go Published Test Results

1 716 tests   1 716 ✔️  2m 32s ⏱️
   101 suites         0 💤
       1 files           0

Results for commit db67b6f.

♻️ This comment has been updated with latest results.

@codecov
Copy link

codecov bot commented Jul 21, 2022

Codecov Report

Merging #2153 (db67b6f) into master (df52869) will increase coverage by 0.00%.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #2153   +/-   ##
=======================================
  Coverage   82.23%   82.23%           
=======================================
  Files         121      121           
  Lines       17953    17955    +2     
=======================================
+ Hits        14763    14765    +2     
  Misses       2420     2420           
  Partials      770      770           
Impacted Files Coverage Δ
utils/analysis/helpers.go 79.17% <0.00%> (+0.10%) ⬆️

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 df52869...db67b6f. Read the comment docs.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 21, 2022

E2E Tests Published Test Results

  1 files    1 suites   45m 2s ⏱️
88 tests 83 ✔️ 3 💤 2
92 runs  85 ✔️ 3 💤 4

For more details on these failures, see this check.

Results for commit db67b6f.

♻️ This comment has been updated with latest results.

@perenesenko
Copy link
Member

BTW @zachaller We have an issue 1730 that can be fixed with this PR

@zachaller zachaller force-pushed the feat-schema-gen branch 2 times, most recently from 36f084e to 8e9640c Compare July 25, 2022 18:19
…rojs

Signed-off-by: zachaller <zachaller@hotmail.com>
Signed-off-by: zachaller <zachaller@hotmail.com>
@sonarcloud
Copy link

sonarcloud bot commented Jul 26, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
1.0% 1.0% Duplication

--report-filename pkg/apis/api-rules/violation_exceptions.list
pkg/apis/rollouts/... \
--go-header-file hack/custom-boilerplate.go.txt \
--input-dirs github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1,github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1,github.com/argoproj/argo-events/pkg/apis/eventsource/v1alpha1,github.com/argoproj/argo-events/pkg/apis/eventbus/v1alpha1,github.com/argoproj/argo-events/pkg/apis/sensor/v1alpha1,github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1,k8s.io/api/admission/v1,k8s.io/api/admissionregistration/v1,k8s.io/api/admissionregistration/v1beta1,k8s.io/api/authentication/v1,k8s.io/api/apiregistration/v1,k8s.io/api/apps/v1,k8s.io/api/apps/v1beta1,k8s.io/api/apps/v1beta2,k8s.io/api/autoscaling/v1beta1,k8s.io/api/autoscaling/v1,k8s.io/api/autoscaling/v2,k8s.io/api/batch/v1,k8s.io/api/batch/v1beta1,k8s.io/api/certificates/v1beta1,k8s.io/api/certificates/v1,k8s.io/api/core/v1,k8s.io/api/extensions/v1beta1,k8s.io/api/networking/v1,k8s.io/api/networking/v1beta1,k8s.io/api/policy/v1,k8s.io/api/policy/v1beta1,k8s.io/api/rbac/v1,k8s.io/api/rbac/b1beta1,k8s.io/api/rbac/v1alpha1,k8s.io/api/storage/v1,k8s.io/api/storage/v1alpha1,k8s.io/api/storage/v1beta1 \
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

List form

github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1
github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1
github.com/argoproj/argo-events/pkg/apis/eventsource/v1alpha1
github.com/argoproj/argo-events/pkg/apis/eventbus/v1alpha1
github.com/argoproj/argo-events/pkg/apis/sensor/v1alpha1
github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1
k8s.io/api/admission/v1
k8s.io/api/admissionregistration/v1
k8s.io/api/admissionregistration/v1beta1
k8s.io/api/authentication/v1
k8s.io/api/apiregistration/v1
k8s.io/api/apps/v1
k8s.io/api/apps/v1beta1
k8s.io/api/apps/v1beta2
k8s.io/api/autoscaling/v1beta1
k8s.io/api/autoscaling/v1
k8s.io/api/autoscaling/v2
k8s.io/api/batch/v1
k8s.io/api/batch/v1beta1
k8s.io/api/certificates/v1beta1
k8s.io/api/certificates/v1
k8s.io/api/core/v1
k8s.io/api/extensions/v1beta1
k8s.io/api/networking/v1
k8s.io/api/networking/v1beta1
k8s.io/api/policy/v1
k8s.io/api/policy/v1beta1
k8s.io/api/rbac/v1
k8s.io/api/rbac/b1beta1
k8s.io/api/rbac/v1alpha1
k8s.io/api/storage/v1
k8s.io/api/storage/v1alpha1
k8s.io/api/storage/v1beta1

@zachaller zachaller marked this pull request as ready for review July 26, 2022 16:07
Copy link
Member

@jessesuen jessesuen left a comment

Choose a reason for hiding this comment

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

I'm pretty against the import of argo-cd events and workflows into go.mod. Is this really necessary?

Comment on lines +7 to +9
github.com/argoproj/argo-cd/v2 v2.4.7
github.com/argoproj/argo-events v1.7.0
github.com/argoproj/argo-workflows/v3 v3.3.8
Copy link
Member

Choose a reason for hiding this comment

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

Yikes. We should really avoid this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So the only reason I did this and I was going to bring this up at the community meeting is because kustomize only supporting 1 openapi schema at a time if end users ever had a kustomize deployment that shared an argoproj resources aka had a rollouts object and workflows object and wanted to patch them they could not do it. So not sure if we want to provide something for end users to work with all projects under the argoproj name or not and how we want to go about doing it.

One option is moving this into it's own codebase to generate the file then we just share it in documentation. This is what I wanted to discuss if other projects also wanted to partake in using this file or not.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I could also try to hack around it a bit by trying to setup a go env that openapi-gen would use

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am still going to try a bit to make it work within rollouts repo without including the other projects deps but it's proving more challenging than originally thought. I am trying to figure out how this works to help https://github.com/kubernetes/gengo/blob/master/parser/parse.go I also did this just as a poc for a seperate repo https://github.com/zachaller/argo-schema-generator which I think makes sense if other projects also want to partake.

@zachaller
Copy link
Collaborator Author

Going to close this because we are going to create a new argoproj repo to host this. We will then be able to link the generated file via documentation from each of the projects.

@zachaller zachaller closed this Jul 27, 2022
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.

Kustomize fail to merge .spec.template.spec.containers[].env fields
3 participants