Skip to content

Commit 8d4a84c

Browse files
Merge pull request #2118 from kubernetes-client/master
Merge `master` into `release-0.x`
2 parents b298b5b + 15c6ef8 commit 8d4a84c

File tree

854 files changed

+115455
-95490
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

854 files changed

+115455
-95490
lines changed

.github/dependabot.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
time: "02:00"
8+
- package-ecosystem: "npm"
9+
directory: "/"
10+
target-branch: "release-1.x"
11+
schedule:
12+
interval: "daily"
13+
time: "01:00"
14+
- package-ecosystem: "github-actions"
15+
directory: "/"
16+
schedule:
17+
interval: "daily"
18+
time: "03:00"

.github/workflows/codeql-analysis.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ on:
2121
schedule:
2222
- cron: '35 14 * * 3'
2323

24+
permissions:
25+
actions: read
26+
contents: read
27+
security-events: write
28+
2429
jobs:
2530
analyze:
2631
name: Analyze
@@ -36,11 +41,11 @@ jobs:
3641

3742
steps:
3843
- name: Checkout repository
39-
uses: actions/checkout@v2
44+
uses: actions/checkout@v4
4045

4146
# Initializes the CodeQL tools for scanning.
4247
- name: Initialize CodeQL
43-
uses: github/codeql-action/init@v1
48+
uses: github/codeql-action/init@v3
4449
with:
4550
languages: ${{ matrix.language }}
4651
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -51,7 +56,7 @@ jobs:
5156
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5257
# If this step fails, then you should remove it and run the build manually (see below)
5358
- name: Autobuild
54-
uses: github/codeql-action/autobuild@v1
59+
uses: github/codeql-action/autobuild@v3
5560

5661
# ℹ️ Command-line programs to run using the OS shell.
5762
# 📚 https://git.io/JvXDl
@@ -65,4 +70,4 @@ jobs:
6570
# make release
6671

6772
- name: Perform CodeQL Analysis
68-
uses: github/codeql-action/analyze@v1
73+
uses: github/codeql-action/analyze@v3

.github/workflows/deploy-docs.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@ on:
33
push:
44
branches:
55
- master
6+
permissions:
7+
contents: write
68
jobs:
79
build-and-deploy-docs:
810
runs-on: ubuntu-latest
911
steps:
1012
- name: Checkout
11-
uses: actions/checkout@v2.3.1
13+
uses: actions/checkout@v4
1214
- name: Setup Node.js
13-
uses: actions/setup-node@v2
15+
uses: actions/setup-node@v4
1416
with:
15-
node-version: '14.x'
17+
node-version: '20'
1618
# Pre-check to validate that versions match between package.json
1719
# and package-lock.json. Needs to run before npm install
1820
- name: Validate package.json and package-lock.json versions
@@ -23,7 +25,7 @@ jobs:
2325
run: npm run docs
2426

2527
- name: Deploy docs
26-
uses: JamesIves/github-pages-deploy-action@4.1.4
28+
uses: JamesIves/github-pages-deploy-action@v4.7.2
2729
with:
2830
branch: gh-pages # The branch the action should deploy to.
2931
folder: docs # The folder the action should deploy.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Generate
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
kubernetesBranch:
7+
type: string
8+
required: true
9+
description: 'The remote kubernetes release branch to fetch openapi spec. .e.g. "release-1.23"'
10+
genCommit:
11+
type: string
12+
required: true
13+
default: 'f0bb447'
14+
description: 'The commit to use for the kubernetes-client/gen repo'
15+
16+
17+
jobs:
18+
generate:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout Javascript
22+
uses: actions/checkout@v4
23+
- name: Setup Node
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: '20'
27+
- name: Checkout Gen
28+
run: |
29+
git clone https://github.com/kubernetes-client/gen
30+
pushd gen
31+
git checkout "${{ github.event.inputs.genCommit }}"
32+
# apply https://github.com/kubernetes-client/gen/pull/224
33+
git config --global user.name "Github Actions"
34+
git config --global user.email "<>"
35+
git cherry-pick --strategy=recursive -X theirs c557f7f b32dcd6 0ef2cec 9701a7c a608a9d
36+
rm -rf gen/.git
37+
# apply https://github.com/kubernetes-client/gen/pull/237
38+
- name: Patch Dockerfile
39+
run: echo "RUN git config --system --add safe.directory /source/openapi-generator" >> gen/openapi/openapi-generator/Dockerfile
40+
- name: Generate Branch Name
41+
run: |
42+
SUFFIX=$(openssl rand -hex 4)
43+
echo "BRANCH=automated-generate-$SUFFIX" >> $GITHUB_ENV
44+
- name: Generate Openapi
45+
run: |
46+
pushd gen/openapi
47+
cat <<"EOF"> settings
48+
# kubernetes-client/gen commit to use for code generation.
49+
export GEN_COMMIT="${{ github.event.inputs.genCommit }}"
50+
# GitHub username/organization to clone kubernetes repo from.
51+
export USERNAME=kubernetes
52+
# Kubernetes branch/tag to get the OpenAPI spec from.
53+
export KUBERNETES_BRANCH="${{ github.event.inputs.kubernetesBranch }}"
54+
# client version for packaging and releasing. It can
55+
# be different than SPEC_VERSION.
56+
export CLIENT_VERSION="0.8-SNAPSHOT"
57+
# Name of the release package
58+
export PACKAGE_NAME="@kubernetes/node-client"
59+
export OPENAPI_GENERATOR_COMMIT=1314e229
60+
EOF
61+
bash typescript.sh ../../src/gen settings
62+
popd
63+
cp settings ../../settings
64+
rm -rf gen
65+
- name: Commit and push
66+
run: |
67+
# Commit and push
68+
git config user.email "[email protected]"
69+
git config user.name "Kubernetes Prow Robot"
70+
git checkout -b "$BRANCH"
71+
git add .
72+
git commit -s -m 'Automated openapi generation from ${{ github.event.inputs.kubernetesBranch }}'
73+
git push origin "$BRANCH"
74+
- name: Pull Request
75+
uses: repo-sync/pull-request@v2
76+
with:
77+
source_branch: ${{ env.BRANCH }}
78+
destination_branch: ${{ github.ref_name }}
79+
github_token: ${{ secrets.GITHUB_TOKEN }}
80+
pr_title: "Automated Generate from openapi ${{ github.event.inputs.kubernetesBranch }}"

.github/workflows/release.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Release
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
workflow_dispatch:
8+
inputs:
9+
releaseVersion:
10+
type: string
11+
required: true
12+
description: The version of this release. Must be a semantic version of the form X.Y.Z.
13+
dry_run:
14+
type: boolean
15+
required: true
16+
default: false
17+
description: Dry run, will not push branches or upload the artifacts.
18+
pre_release:
19+
type: boolean
20+
required: true
21+
default: false
22+
description: If true, push pre-release tag.
23+
skip_tag:
24+
type: boolean
25+
required: true
26+
default: false
27+
description: If true, don't tag this release, just push it.
28+
29+
jobs:
30+
release:
31+
runs-on: ubuntu-latest
32+
environment: production
33+
steps:
34+
- name: Checkout Javascript
35+
uses: actions/checkout@v4
36+
- name: Setup Node
37+
uses: actions/setup-node@v4
38+
with:
39+
node-version: '20'
40+
registry-url: 'https://registry.npmjs.org'
41+
- name: Install dependencies
42+
run: npm install
43+
- name: Package
44+
run: ./build-package.sh
45+
- name: Upload
46+
if: ${{ github.event.inputs.dry_run != 'true' && github.event.inputs.pre_release != 'true' }}
47+
run: npm publish
48+
env:
49+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
50+
- name: Upload pre-release
51+
if: ${{ github.event.inputs.dry_run != 'true' && github.event.inputs.pre_release == 'true' }}
52+
run: npm publish --tag next
53+
env:
54+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
55+
- name: Tag release
56+
if: ${{ github.event.inputs.skip_tag != 'true' }}
57+
run: |
58+
git config --global user.name 'Github Bot'
59+
git config --global user.email '<>'
60+
git tag ${{ github.events.inputs.releaseVersion }}
61+
- name: Push tag
62+
if: ${{ github.event.inputs.dry_run != 'true' }}
63+
run: |
64+
git push ${{ github.events.inputs.releaseVersion }}

.github/workflows/test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
node: [ '16', '14', '12' ]
14+
# Remove specific version from 20 when https://github.com/tschaub/mock-fs/issues/380 is fixed
15+
node: [ '22', '20.7.0', '18' ]
1516
name: Node ${{ matrix.node }} validation
1617
steps:
17-
- uses: actions/checkout@v2
18-
- uses: actions/setup-node@v2
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-node@v4
1920
with:
2021
node-version: ${{ matrix.node }}
2122
# Pre-check to validate that versions match between package.json

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pretty-quick

.husky/pre-push

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm test && npm run lint

.mocharc.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"require": "tsx",
3+
"extensions": ["ts"],
4+
"spec": [
5+
"src/**/*_test.ts"
6+
],
7+
"watch-files": [
8+
"src"
9+
]
10+
}

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ We'd love to accept your patches! Before we can accept them you need to sign Clo
1212
## Reporting an issue
1313
If you have any problem with the package or any suggestions, please file an [issue](https://github.com/kubernetes-client/javascript/issues).
1414

15+
Note: Before raising a new issue, please do check the existing issues and make sure it is not a duplicate one.
16+
1517
## Contributing a Patch
1618
1. Submit an issue describing your proposed change to the repo.
1719
2. Fork this repo, develop and test your code changes.

0 commit comments

Comments
 (0)