-
Notifications
You must be signed in to change notification settings - Fork 538
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
Fix type definition for KubernetesObjectApi.read() #2129
Fix type definition for KubernetesObjectApi.read() #2129
Conversation
Welcome @jportner! |
Changes here LGTM. It looks like after these changes, main contains all of the changes from #854 except some minor differences which I believe are a result of the different underlying clients. /lgtm |
Hrm, our CI/CD doesn't appear to be triggering, probably because we need to update the github action to include the |
bf33e49
to
85007ed
Compare
FYI @brendandburns this is what I see. I don't have permission to start the CI: @jportner thanks for rebasing. Still LGTM /lgtm |
@cjihrig ok, I think you need to add yourself here: https://github.com/kubernetes/org/blob/main/config/kubernetes-client/org.yaml#L141 Also, let's remove @davidgamero from admin since he hasn't been super involved lately (we can leave him as approver/reviewer) |
/lgtm Is this unit testable? If so, we should add unit tests. |
This commit adds myself to the javascript-admin team and removes davidgamero as requested in kubernetes-client/javascript#2129 (comment)
This reverts commit 0170e82.
Well I can't think of a way to test the looser type definition directly. If you temporarily revert the first change in 85007ed, you can see that there's now a type error in the tests. I tried to push a temporary revert to demonstrate that but it looks like the GitHub workflow wouldn't run again until I got another LGTM label 😅 Anyway, with the first change temporarily reverted (HEAD: 0170e82) if you try npm run build-with-tests
> @kubernetes/[email protected] build-with-tests
> tsc --project tsconfig-with-tests.json && cp 'src/test/echo space.js' dist/test
src/object_test.ts:1762:66 - error TS2345: Argument of type '{ apiVersion: string; kind: string; metadata: { name: string; namespace: string; }; }' is not assignable to parameter of type 'CustomTestResource'.
Property 'spec' is missing in type '{ apiVersion: string; kind: string; metadata: { name: string; namespace: string; }; }' but required in type 'CustomTestResource'.
1762 const custom = await client.read<CustomTestResource>({
~
1763 apiVersion: 'example.com/v1',
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
1768 },
~~~~~~~~~~~~~~~~~~
1769 });
~~~~~~~~~~~~~
src/object_test.ts:1728:17
1728 spec: {
~~~~
'spec' is declared here.
Found 1 error in src/object_test.ts:1762 Are you satisfied with that? |
/lgtm
Someone from within the org needs to approve CI runs for outside collaborators. @brendandburns is there any specific reason this is active for CI runs which do testing, linting, etc.? |
@mstruebing there are security concerns w/ running random PRs from unknown users automatically. People can do things like craft malicious PRs that mine Bitcoin, etc. I think we want a maintainer to look at each PR before we approve it for running tests on our compute. |
That test looks good enough to me, I mainly want something that will catch if we regress this change somehow. I think this fits the bill. Thanks! /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brendandburns, jportner, saurabh2590 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Resolves #2128
This PR restores the old type definition that existed in 0.x.