Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
33b390a
feat: sync upstream main + opensourceways release/no_volumes into main
Longwt123 Jul 17, 2026
f1e89a5
ci: add vitest coverage config for diff-cover (clover.xml at root)
Longwt123 Jul 17, 2026
78308d8
test(k8s): add vitest spec files for coverage gate
Longwt123 Jul 17, 2026
959ff4a
fix: exclude spec files from tsc build; move specs into utils/ for CI…
Longwt123 Jul 17, 2026
4e1e869
fix: resolve CI build and lint errors in PR #25
Longwt123 Jul 17, 2026
339e51f
style: fix prettier formatting in exec-pod-step-with-output-test
Longwt123 Jul 17, 2026
eebebdc
test: fix waitForPodPhases timeout in error-serialization tests
Longwt123 Jul 17, 2026
7bbb7c4
test: fix double-quoting in run-container-step env tests
Longwt123 Jul 20, 2026
3fbb09c
fix: resolve module loading errors in vitest coverage CI
Longwt123 Jul 20, 2026
c885ba9
test: extend coverage for heartbeat/prepare-job/run-container-step/k8…
Longwt123 Jul 20, 2026
56be393
fix(build): exclude spec files and add skipLibCheck to docker/hooklib…
Longwt123 Jul 20, 2026
667e77d
fix(lint): fix no-floating-promises + no-unused-vars in spec files
Longwt123 Jul 20, 2026
21ff8f3
fix(test): fix docker jest type errors and improve k8s unit coverage
Longwt123 Jul 20, 2026
9023f82
style: fix prettier formatting in k8s-index.spec.ts
Longwt123 Jul 20, 2026
79e5ef3
fix(build): revert bootstrap from npm ci to npm install
Longwt123 Jul 22, 2026
ab6f596
fix(k8s): downgrade @babel/core and @babel/preset-env to ^7.x
Longwt123 Jul 22, 2026
4151720
fix(hooklib): remove peer:true fields from package-lock.json
Longwt123 Jul 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

56 changes: 0 additions & 56 deletions .eslintrc.json

This file was deleted.

28 changes: 28 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: 2

updates:
# Group updates into a single PR per workspace package
- package-ecosystem: npm
directory: "/packages/docker"
schedule:
interval: weekly
groups:
all-dependencies:
patterns:
- "*"
- package-ecosystem: npm
directory: "/packages/hooklib"
schedule:
interval: weekly
groups:
all-dependencies:
patterns:
- "*"
- package-ecosystem: npm
directory: "/packages/k8s"
schedule:
interval: weekly
groups:
all-dependencies:
patterns:
- "*"
69 changes: 59 additions & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,75 @@ on:
paths-ignore:
- '**.md'
workflow_dispatch:

jobs:
build:
format-and-lint:
name: Format & Lint Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: sed -i "s|{{PATHTOREPO}}|$(pwd)|" packages/k8s/tests/test-kind.yaml
name: Setup kind cluster yaml config
- uses: helm/kind-action@v1.2.0
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
config: packages/k8s/tests/test-kind.yaml
- run: npm install
node-version: 24
cache: npm
- run: node --version && npm --version
name: Log Node and npm versions
- run: npm ci
name: Install dependencies
- run: npm run bootstrap
name: Bootstrap the packages
- run: npm run build-all
name: Build packages
- run: npm run format-check
name: Check formatting
- name: Check linter
run: |
npm run lint
git diff --exit-code -- ':!packages/k8s/tests/test-kind.yaml'
- name: Run tests
run: npm run test
git diff --exit-code -- . ':!packages/k8s/tests/test-kind.yaml'

docker-tests:
name: Docker Hook Tests
runs-on: ubuntu-latest
needs: format-and-lint
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- run: node --version && npm --version
name: Log Node and npm versions
- run: npm ci
name: Install dependencies
- run: npm run bootstrap
name: Bootstrap the packages
- run: npm run build-all
name: Build packages
- name: Run Docker tests
run: npm run test --prefix packages/docker

k8s-tests:
name: Kubernetes Hook Tests
runs-on: ubuntu-latest
needs: format-and-lint
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- run: sed -i "s|{{PATHTOREPO}}|$(pwd)|" packages/k8s/tests/test-kind.yaml
name: Setup kind cluster yaml config
- uses: helm/kind-action@v1.12.0
with:
config: packages/k8s/tests/test-kind.yaml
- run: node --version && npm --version
name: Log Node and npm versions
- run: npm ci
name: Install dependencies
- run: npm run bootstrap
name: Bootstrap the packages
- run: npm run build-all
name: Build packages
- name: Run Kubernetes tests
run: npm run test --prefix packages/k8s
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v5

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- name: Install dependencies
run: npm install

Expand All @@ -21,7 +25,7 @@ jobs:
- name: Build packages
run: npm run build-all

- uses: actions/github-script@v7
- uses: actions/github-script@v8
id: releaseVersion
with:
result-encoding: string
Expand All @@ -47,7 +51,7 @@ jobs:

- name: Create release notes
id: releaseNotes
uses: actions/github-script@v7
uses: actions/github-script@v8
with:
script: |
const fs = require('fs');
Expand Down
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @actions/actions-launch
* @github/actions-runtime @nikola-jokic
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ COPY . /app/

RUN npm install && npm run bootstrap && npm run build-all

FROM ghcr.nju.edu.cn/actions/actions-runner:2.329.0
FROM ghcr.nju.edu.cn/actions/actions-runner:2.334.0

COPY --from=runner_builder /app/packages/k8s/dist/index.js /home/runner/k8s/index.js

Expand Down
129 changes: 129 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
const eslint = require('@eslint/js');
const tseslint = require('@typescript-eslint/eslint-plugin');
const tsparser = require('@typescript-eslint/parser');
const globals = require('globals');
const pluginJest = require('eslint-plugin-jest');

module.exports = [
eslint.configs.recommended,
{
files: ['**/*.ts'],
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
project: ['./tsconfig.json', './packages/*/tsconfig.json']
},
globals: {
...globals.node,
...globals.es6
}
},
plugins: {
'@typescript-eslint': tseslint,
},
rules: {
// Disabled rules from original config
'eslint-comments/no-use': 'off',
'import/no-namespace': 'off',
'no-constant-condition': 'off',
'no-unused-vars': 'off',
'i18n-text/no-en': 'off',
'camelcase': 'off',
'semi': 'off',
'no-shadow': 'off',

// TypeScript ESLint rules
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
varsIgnorePattern: '^_'
}
],
'@typescript-eslint/explicit-member-accessibility': ['error', { accessibility: 'no-public' }],
'@typescript-eslint/no-require-imports': 'error',
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/explicit-function-return-type': ['error', { allowExpressions: true }],
'@typescript-eslint/no-array-constructor': 'error',
'@typescript-eslint/no-empty-interface': 'error',
'@typescript-eslint/no-explicit-any': 'off', // Fixed: removed duplicate and kept only this one
'@typescript-eslint/no-extraneous-class': 'error',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-for-in-array': 'error',
'@typescript-eslint/no-inferrable-types': 'error',
'@typescript-eslint/no-misused-new': 'error',
'@typescript-eslint/no-namespace': 'error',
'@typescript-eslint/no-non-null-assertion': 'warn',
'@typescript-eslint/no-unnecessary-qualifier': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/no-var-requires': 'error',
'@typescript-eslint/prefer-for-of': 'warn',
'@typescript-eslint/prefer-function-type': 'warn',
'@typescript-eslint/prefer-includes': 'error',
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/require-array-sort-compare': 'error',
'@typescript-eslint/restrict-plus-operands': 'error',
'@typescript-eslint/unbound-method': 'error',
'@typescript-eslint/no-shadow': ['error']
}
},
{
// Test files configuration - Fixed file pattern to match .ts files
files: ['**/*test*.ts', '**/*spec*.ts', '**/tests/**/*.ts'],
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
project: ['./tsconfig.json', './packages/*/tsconfig.json']
},
globals: {
...globals.node,
...globals.es6,
// Fixed Jest globals
describe: 'readonly',
it: 'readonly',
test: 'readonly',
expect: 'readonly',
beforeEach: 'readonly',
afterEach: 'readonly',
beforeAll: 'readonly',
afterAll: 'readonly',
jest: 'readonly'
}
},
plugins: {
'@typescript-eslint': tseslint,
jest: pluginJest
},
rules: {
// Disable no-undef for test files since Jest globals are handled above
'no-undef': 'off',
// Relax some rules for test files
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/explicit-function-return-type': 'off'
}
},
{
files: ['**/jest.config.js', '**/jest.setup.js'],
languageOptions: {
globals: {
...globals.node,
jest: 'readonly',
module: 'writable'
}
},
rules: {
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-var-requires': 'off',
'import/no-commonjs': 'off'
}
}
];
3 changes: 0 additions & 3 deletions examples/extension.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ metadata:
labels:
labeled-by: "extension"
spec:
securityContext:
runAsUser: 1000
runAsGroup: 3000
restartPolicy: Never
containers:
- name: $job # overwrites job container
Expand Down
Loading
Loading