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

Knative Generator Rewrite #2157

Merged
merged 3 commits into from May 8, 2020

Conversation

Fabian-K
Copy link
Contributor

@Fabian-K Fabian-K commented Apr 22, 2020

[knative]

  • update generator to use shared logic
  • replace knative-annotator with shared model-annotator
  • remove the generated *Schema class

[tekton]

  • update to knative package change

[common]

  • add editorconfig for *.go (although this is not applied to all go files yet)

As always, I´m looking forward to feedback!

Thanks,
Fabian

@centos-ci
Copy link

Can one of the admins verify this patch?

@Fabian-K Fabian-K changed the title Tekton Generator Rewrite Knative Generator Rewrite Apr 22, 2020
@rohanKanojia
Copy link
Member

ok to test

@Fabian-K
Copy link
Contributor Author

Hey, thanks for already looking into this! I´d suggest pausing this for now, I´d rebase it on top of #2160

@Fabian-K Fabian-K marked this pull request as draft April 23, 2020 10:14
@Fabian-K Fabian-K marked this pull request as ready for review May 4, 2020 16:49
…de proper scoping (namespaced vs cluster-wide) for all parts using the rewritten go generator.

Changes:
- go configuration requires scoping definition for all CRDs
- marker interface 'Namespaced' added
- go generator adds the marker interface to all Namespaced CRDs
- during the generation of the *OperationsImpl, the marker interface is used to detect the proper scoping.

This fixes fabric8io#2193
// no other types need to be defined as they are auto discovered
crdLists := []reflect.Type{

// serving v1
Copy link
Member

Choose a reason for hiding this comment

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

Umm, why have you removed all resources from duck v1beta1. Are they not part of Knative model?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

2 things:

  • all types that are only used internally are auto-discovered by the generator. Only CRDs need to be passed in as a starting point.
  • AFAIK everything related to duck is not a CRD exposed by knative. Instead that is somehow used internally for duck typing. I might be wrong on this, do you have other information?

Copy link
Member

Choose a reason for hiding this comment

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

Umm, I don't have much idea about Knative. I think it's okay if duck classes were not exposed earlier. I was just concerned if we could break something by dropping something that was present earlier.

- update generator to use shared logic
- replace knative-annotator with shared model-annotator
- remove the generated *Schema class

[tekton]
- update to knative package change

[common]
- add editorconfig for *.go (although this is not applied to all go files yet)
@sonarcloud
Copy link

sonarcloud bot commented May 6, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@rohanKanojia
Copy link
Member

[merge]

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.

None yet

6 participants