-
Notifications
You must be signed in to change notification settings - Fork 520
CONSOLE-4775: Proposal for automated types generation from OpenAPI specs #1846
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
base: master
Are you sure you want to change the base?
Conversation
18043a8
to
ef79bd8
Compare
@logonoff: This pull request references CONSOLE-4775 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.21.0" version, but no target version was set. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
1 similar comment
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
b2a5455
to
7ab9c50
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @logonoff, appreciate it. A few questions:
- Is this a package we expect console plugin developers to use?
- What types do we expose in the plugin SDK, and will these types replace those?
- Will this introduce any breaking changes for plugins?
2. Where should the type generation library be maintained? Should it be part of | ||
`openshift/api`, or a separate repository? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest we answer this question before merging the enhancement. My first inclination is to make this a separate repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was some discussion around where the generation code should live when this proposal is implemented, so I've left this as an open question for now until we can answer it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7ab9c50
to
d157fac
Compare
If a console plugin needs to read a resource which this types library supplies a type for, then they are free to use this package. Otherwise, I do not expect all console plugin developers to need this package. Future work could include adding extra sources of CRDs so that console plugins have a centralized place to get resource TypeScript types, but this is out of scope for the initial implementation
I believe we export
There are a few changes I've made to Moreover, since I switched from These changes do cause compilation to fail when I tried applying them in OpenShift console. However, I don't expect this to impact the backwards-compatibility for dynamic plugins as types get complied away at build time. |
I agree this is out of scope and not a priority.
Thanks, agree on re-exporting.
So when plugins upgrade the version of the SDK package they use, they might need to fix type errors, but there are no runtime errors for plugins built with an older version, correct? I'd add some of these details to the enhancement so it's clear what the impact is to plugins since we treat the SDK as a public API. Thanks @logonoff |
d157fac
to
fd774ca
Compare
Right. Personally I also found that in openshift/console, the type errors were infrequent and easily fixable as well, so I don't see this as a big cause for concern
Thanks, I've added it as a drawback |
…generation from OpenAPI specs
fd774ca
to
6443979
Compare
@logonoff: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
No description provided.