Compare commits

...

42 Commits

Author SHA1 Message Date
GitHub Action c8cfec839d build 2026-03-03 21:17:31 +00:00
David Gamero a4d35bd653 releases/v5.1.0 (#499)
* chore(release): bump version to 5.1.0

* chore(release): update package-lock.json to 5.1.0
2026-03-03 13:16:48 -08:00
David Gamero e202ed4d60 Add typecheck to build script (#498) 2026-03-03 12:34:01 -08:00
dependabot[bot] 80628307ac Bump the actions group in /.github/workflows with 2 updates (#494)
Bumps the actions group in /.github/workflows with 2 updates: [github/codeql-action](https://github.com/github/codeql-action) and [actions/stale](https://github.com/actions/stale).


Updates `github/codeql-action` from 4.32.3 to 4.32.4
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/9e907b5e64f6b83e7804b09294d44122997950d6...89a39a4e59826350b863aa6b6252a07ad50cf83e)

Updates `actions/stale` from 10.1.1 to 10.2.0
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/997185467fa4f803885201cee163a9f38240193d...b5d41d4e1d5dceea10e7104786b73624c18a190f)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.32.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: actions/stale
  dependency-version: 10.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: David Gamero <david340804@gmail.com>
2026-03-03 17:28:00 +00:00
dependabot[bot] 332b91818e Bump @types/node from 25.3.0 to 25.3.3 in the actions group (#497)
Bumps the actions group with 1 update: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `@types/node` from 25.3.0 to 25.3.3
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 25.3.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-03 12:07:07 -05:00
dependabot[bot] 8bb8e3e420 Bump the actions group across 1 directory with 2 updates (#495)
Bumps the actions group with 2 updates in the / directory: [@octokit/plugin-retry](https://github.com/octokit/plugin-retry.js) and [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `@octokit/plugin-retry` from 8.0.3 to 8.1.0
- [Release notes](https://github.com/octokit/plugin-retry.js/releases)
- [Commits](https://github.com/octokit/plugin-retry.js/compare/v8.0.3...v8.1.0)

Updates `@types/node` from 25.2.3 to 25.3.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@octokit/plugin-retry"
  dependency-version: 8.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: "@types/node"
  dependency-version: 25.3.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: David Gamero <david340804@gmail.com>
2026-03-02 18:06:52 +00:00
dependabot[bot] f3086d990b Bump rollup from 4.57.1 to 4.59.0 (#496)
Bumps [rollup](https://github.com/rollup/rollup) from 4.57.1 to 4.59.0.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v4.57.1...v4.59.0)

---
updated-dependencies:
- dependency-name: rollup
  dependency-version: 4.59.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-02 13:04:32 -05:00
David Gamero 01cfe404ef Migrate to esbuild/Vitest and upgrade @actions/* to ESM-only versions (#492)
* Migrate build toolchain from ncc/Jest to esbuild/Vitest

Replace the legacy ncc/Jest/Babel build stack with a modern ESM toolchain:

Build:
- Replace @vercel/ncc with esbuild (--platform=node --target=node20 --format=esm)
- Add createRequire banner for CJS interop in ESM bundle
- Add "type": "module" to package.json
- Add tsc --noEmit typecheck script (esbuild strips types without checking)
- Add typecheck to husky pre-commit hook

Dependencies:
- Bump @actions/core@3, exec@3, io@3, tool-cache@4 (ESM-only)
- Replace jest/ts-jest/@babel/* with vitest@4

Tests:
- Convert 29 test files: jest.fn()→vi.fn(), jest.mock()→vi.mock(), jest.spyOn()→vi.spyOn()
- Fix vitest 4 compat: mockImplementation requires args, mock call tracking, await .rejects

CI:
- Update build step from ncc build → npm run build
- Update composite action to use npm run build

* Switch tsconfig to NodeNext module resolution

Change module/moduleResolution from ES2022/bundler to NodeNext/NodeNext
and target from ES2022 to ES2020.

- Add .js extensions to all relative imports across 59 source/test files
  (required by NodeNext module resolution)
- Add vitest/globals to tsconfig types array for global test API declarations
2026-02-24 11:57:56 -08:00
dependabot[bot] 84e2095bf0 Bump github/codeql-action in /.github/workflows in the actions group (#491)
Bumps the actions group in /.github/workflows with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 4.32.0 to 4.32.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/b20883b0cd1f46c72ae0ba6d1090936928f9fa30...9e907b5e64f6b83e7804b09294d44122997950d6)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.32.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tatsat (Tats) Mishra 🐉 <tamishra@microsoft.com>
2026-02-17 15:18:18 -05:00
dependabot[bot] 1ad0b3bc5b Bump undici and @actions/http-client (#490)
Bumps [undici](https://github.com/nodejs/undici) and [@actions/http-client](https://github.com/actions/toolkit/tree/HEAD/packages/http-client). These dependencies needed to be updated together.

Updates `undici` from 5.29.0 to 6.23.0
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.29.0...v6.23.0)

Updates `@actions/http-client` from 3.0.1 to 3.0.2
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/http-client/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/http-client)

---
updated-dependencies:
- dependency-name: undici
  dependency-version: 6.23.0
  dependency-type: indirect
- dependency-name: "@actions/http-client"
  dependency-version: 3.0.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-18 08:51:55 +13:00
dependabot[bot] 8f82d97be7 Bump the actions group in /.github/workflows with 3 updates (#488)
Bumps the actions group in /.github/workflows with 3 updates: [actions/checkout](https://github.com/actions/checkout), [github/codeql-action](https://github.com/github/codeql-action) and [actions/setup-python](https://github.com/actions/setup-python).


Updates `actions/checkout` from 6.0.1 to 6.0.2
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/8e8c483db84b4bee98b60c0593521ed34d9990e8...de0fac2e4500dabe0009e67214ff5f5447ce83dd)

Updates `github/codeql-action` from 4.31.10 to 4.32.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/cdefb33c0f6224e58673d9004f47f7cb3e328b89...b20883b0cd1f46c72ae0ba6d1090936928f9fa30)

Updates `actions/setup-python` from 6.1.0 to 6.2.0
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/83679a892e2d95755f2dac6acb0bfd1e9ac5d548...a309ff8b426b58ec0e2a45f0f869d46889d02405)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: github/codeql-action
  dependency-version: 4.32.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: actions/setup-python
  dependency-version: 6.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-10 12:51:17 -08:00
dependabot[bot] d9732d2f20 Bump the actions group with 2 updates (#486)
Bumps the actions group with 2 updates: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) and [prettier](https://github.com/prettier/prettier).


Updates `@types/node` from 25.0.7 to 25.0.9
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `prettier` from 3.7.4 to 3.8.0
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.7.4...3.8.0)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 25.0.9
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: prettier
  dependency-version: 3.8.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-20 10:34:31 -05:00
dependabot[bot] fc94f1c6e0 Bump github/codeql-action in /.github/workflows in the actions group (#485)
Bumps the actions group in /.github/workflows with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 4.31.9 to 4.31.10
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/5d4e8d1aca955e8d8589aabd499c5cae939e33c7...cdefb33c0f6224e58673d9004f47f7cb3e328b89)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: David Gamero <david340804@gmail.com>
2026-01-13 16:34:53 -08:00
dependabot[bot] ac0cc3d225 Bump the actions group with 4 updates (#484)
Bumps the actions group with 4 updates: [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core), [@actions/tool-cache](https://github.com/actions/toolkit/tree/HEAD/packages/tool-cache), [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) and [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `@actions/core` from 2.0.1 to 2.0.2
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

Updates `@actions/tool-cache` from 2.0.2 to 3.0.0
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/tool-cache/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/tool-cache)

Updates `@babel/preset-env` from 7.28.5 to 7.28.6
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.28.6/packages/babel-preset-env)

Updates `@types/node` from 25.0.3 to 25.0.7
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-version: 2.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: "@actions/tool-cache"
  dependency-version: 3.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: "@babel/preset-env"
  dependency-version: 7.28.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: "@types/node"
  dependency-version: 25.0.7
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-13 16:26:29 -05:00
dependabot[bot] cf2c9c0edd Bump @types/node from 25.0.2 to 25.0.3 in the actions group (#480)
Bumps the actions group with 1 update: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `@types/node` from 25.0.2 to 25.0.3
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 25.0.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: David Gamero <david340804@gmail.com>
2026-01-06 21:28:06 +00:00
dependabot[bot] d206adcc7f Bump github/codeql-action in /.github/workflows in the actions group (#481)
Bumps the actions group in /.github/workflows with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 4.31.8 to 4.31.9
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/1b168cd39490f61582a9beae412bb7057a6b2c4e...5d4e8d1aca955e8d8589aabd499c5cae939e33c7)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-06 16:25:29 -05:00
David Gamero 68aff7a5a7 docker driver (#482)
* docker driver

* centralize action setup

* distribute timeout to call sites

* bump timeout
2026-01-05 18:23:31 -08:00
dependabot[bot] 1748cb02b8 Bump the actions group with 3 updates (#478)
Bumps the actions group with 3 updates: [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core), [@actions/exec](https://github.com/actions/toolkit/tree/HEAD/packages/exec) and [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `@actions/core` from 1.11.1 to 2.0.1
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/@actions/artifact@2.0.1/packages/core)

Updates `@actions/exec` from 1.1.1 to 2.0.0
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/exec/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/exec)

Updates `@types/node` from 24.10.1 to 25.0.2
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-version: 2.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: "@actions/exec"
  dependency-version: 2.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: "@types/node"
  dependency-version: 25.0.2
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-16 17:21:37 +00:00
dependabot[bot] 6aac2fd790 Bump the actions group in /.github/workflows with 2 updates (#479)
Bumps the actions group in /.github/workflows with 2 updates: [github/codeql-action](https://github.com/github/codeql-action) and [medyagh/setup-minikube](https://github.com/medyagh/setup-minikube).


Updates `github/codeql-action` from 4.31.7 to 4.31.8
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/cf1bb45a277cb3c205638b2cd5c984db1c46a412...1b168cd39490f61582a9beae412bb7057a6b2c4e)

Updates `medyagh/setup-minikube` from 0.0.20 to 0.0.21
- [Release notes](https://github.com/medyagh/setup-minikube/releases)
- [Commits](https://github.com/medyagh/setup-minikube/compare/e3c7f79eb1e997eabccc536a6cf318a2b0fe19d9...e9e035a86bbc3caea26a450bd4dbf9d0c453682e)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: medyagh/setup-minikube
  dependency-version: 0.0.21
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-16 09:17:07 -08:00
dependabot[bot] 511707c4a0 Bump prettier from 3.7.3 to 3.7.4 in the actions group (#476)
Bumps the actions group with 1 update: [prettier](https://github.com/prettier/prettier).


Updates `prettier` from 3.7.3 to 3.7.4
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.7.3...3.7.4)

---
updated-dependencies:
- dependency-name: prettier
  dependency-version: 3.7.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-15 16:34:46 +00:00
dependabot[bot] b35cf6be4f Bump the actions group in /.github/workflows with 4 updates (#477)
Bumps the actions group in /.github/workflows with 4 updates: [actions/checkout](https://github.com/actions/checkout), [github/codeql-action](https://github.com/github/codeql-action), [actions/stale](https://github.com/actions/stale) and [actions/setup-python](https://github.com/actions/setup-python).


Updates `actions/checkout` from 6.0.0 to 6.0.1
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/1af3b93b6815bc44a9784bd300feb67ff0d1eeb3...8e8c483db84b4bee98b60c0593521ed34d9990e8)

Updates `github/codeql-action` from 4.31.5 to 4.31.7
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/fdbfb4d2750291e159f0156def62b853c2798ca2...cf1bb45a277cb3c205638b2cd5c984db1c46a412)

Updates `actions/stale` from 10.1.0 to 10.1.1
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/5f858e3efba33a5ca4407a664cc011ad407f2008...997185467fa4f803885201cee163a9f38240193d)

Updates `actions/setup-python` from 6.0.0 to 6.1.0
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/e797f83bcb11b83ae66e0230d6156d7c80228e7c...83679a892e2d95755f2dac6acb0bfd1e9ac5d548)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: github/codeql-action
  dependency-version: 4.31.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: actions/stale
  dependency-version: 10.1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: actions/setup-python
  dependency-version: 6.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-15 11:26:46 -05:00
dependabot[bot] 07c26e70d3 Bump the actions group with 2 updates (#475)
Bumps the actions group with 2 updates: [prettier](https://github.com/prettier/prettier) and [ts-jest](https://github.com/kulshekhar/ts-jest).


Updates `prettier` from 3.6.2 to 3.7.3
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.6.2...3.7.3)

Updates `ts-jest` from 29.4.5 to 29.4.6
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/kulshekhar/ts-jest/compare/v29.4.5...v29.4.6)

---
updated-dependencies:
- dependency-name: prettier
  dependency-version: 3.7.3
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: ts-jest
  dependency-version: 29.4.6
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-08 12:22:29 -08:00
dependabot[bot] 0090ff3ba3 Bump the actions group in /.github/workflows with 2 updates (#474)
Bumps the actions group in /.github/workflows with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 5.0.1 to 6.0.0
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/93cb6efe18208431cddfb8368fd83d5badbf9bfd...1af3b93b6815bc44a9784bd300feb67ff0d1eeb3)

Updates `github/codeql-action` from 4.31.3 to 4.31.5
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/014f16e7ab1402f30e7c3329d33797e7948572db...fdbfb4d2750291e159f0156def62b853c2798ca2)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: github/codeql-action
  dependency-version: 4.31.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-01 14:19:36 -05:00
dependabot[bot] f67ee4df16 Bump @types/node in the actions group across 1 directory (#473)
Bumps the actions group with 1 update in the / directory: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `@types/node` from 24.10.0 to 24.10.1
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 24.10.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-18 22:29:40 +00:00
dependabot[bot] 1cd48cb18d Bump the actions group across 1 directory with 2 updates (#470)
Bumps the actions group with 2 updates in the /.github/workflows directory: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 5.0.0 to 5.0.1
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/08c6903cd8c0fde910a37f88322edcfb5dd907a8...93cb6efe18208431cddfb8368fd83d5badbf9bfd)

Updates `github/codeql-action` from 4.30.9 to 4.31.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/16140ae1a102900babc80a33c44059580f687047...014f16e7ab1402f30e7c3329d33797e7948572db)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 5.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: github/codeql-action
  dependency-version: 4.31.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-18 22:18:58 +00:00
dependabot[bot] f754598e02 Bump glob from 10.4.5 to 10.5.0 (#472)
Bumps [glob](https://github.com/isaacs/node-glob) from 10.4.5 to 10.5.0.
- [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/node-glob/compare/v10.4.5...v10.5.0)

---
updated-dependencies:
- dependency-name: glob
  dependency-version: 10.5.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-19 11:13:58 +13:00
dependabot[bot] 2842c5ae3c Bump js-yaml from 4.1.0 to 4.1.1 (#468)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.1.0 to 4.1.1.
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/4.1.0...4.1.1)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 4.1.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-18 10:46:51 -08:00
dependabot[bot] c384f1639a Bump the actions group with 4 updates (#467)
Bumps the actions group with 4 updates: [@actions/io](https://github.com/actions/toolkit/tree/HEAD/packages/io), [@octokit/core](https://github.com/octokit/core.js), [@octokit/plugin-retry](https://github.com/octokit/plugin-retry.js) and [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `@actions/io` from 1.1.3 to 2.0.0
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/io/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/io)

Updates `@octokit/core` from 7.0.5 to 7.0.6
- [Release notes](https://github.com/octokit/core.js/releases)
- [Commits](https://github.com/octokit/core.js/compare/v7.0.5...v7.0.6)

Updates `@octokit/plugin-retry` from 8.0.2 to 8.0.3
- [Release notes](https://github.com/octokit/plugin-retry.js/releases)
- [Commits](https://github.com/octokit/plugin-retry.js/compare/v8.0.2...v8.0.3)

Updates `@types/node` from 24.9.1 to 24.10.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@actions/io"
  dependency-version: 2.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: "@octokit/core"
  dependency-version: 7.0.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: "@octokit/plugin-retry"
  dependency-version: 8.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: "@types/node"
  dependency-version: 24.10.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-11 18:49:13 -05:00
dependabot[bot] b497d9edf8 Bump the actions group with 3 updates (#466)
Bumps the actions group with 3 updates: [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env), [@babel/preset-typescript](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-typescript) and [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `@babel/preset-env` from 7.28.3 to 7.28.5
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.28.5/packages/babel-preset-env)

Updates `@babel/preset-typescript` from 7.27.1 to 7.28.5
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.28.5/packages/babel-preset-typescript)

Updates `@types/node` from 24.9.0 to 24.9.1
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-version: 7.28.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: "@babel/preset-typescript"
  dependency-version: 7.28.5
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: "@types/node"
  dependency-version: 24.9.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-30 19:00:09 -07:00
dependabot[bot] 4f9a03ce42 Bump @types/node from 24.7.2 to 24.9.0 in the actions group (#464)
Bumps the actions group with 1 update: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `@types/node` from 24.7.2 to 24.9.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 24.9.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-22 00:37:08 +00:00
dependabot[bot] 0ca601cacf Bump the actions group across 1 directory with 2 updates (#463)
Bumps the actions group with 2 updates in the /.github/workflows directory: [github/codeql-action](https://github.com/github/codeql-action) and [actions/stale](https://github.com/actions/stale).


Updates `github/codeql-action` from 3.30.1 to 3.30.6
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/f1f6e5f6af878fb37288ce1c627459e94dbf7d01...64d10c13136e1c5bce3e5fbde8d4906eeaafc885)

Updates `actions/stale` from 10.0.0 to 10.1.0
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/3a9db7e6a41a89f618792c92c0e97cc736e1b13f...5f858e3efba33a5ca4407a664cc011ad407f2008)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.30.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: actions/stale
  dependency-version: 10.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-21 14:17:18 -04:00
dependabot[bot] e237e65ac2 Bump the actions group across 1 directory with 7 updates (#462)
Bumps the actions group with 7 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [@octokit/core](https://github.com/octokit/core.js) | `7.0.3` | `7.0.5` |
| [@octokit/plugin-retry](https://github.com/octokit/plugin-retry.js) | `8.0.1` | `8.0.2` |
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `24.3.1` | `24.7.0` |
| [@vercel/ncc](https://github.com/vercel/ncc) | `0.38.3` | `0.38.4` |
| [jest](https://github.com/jestjs/jest/tree/HEAD/packages/jest) | `30.1.3` | `30.2.0` |
| [ts-jest](https://github.com/kulshekhar/ts-jest) | `29.4.1` | `29.4.4` |
| [typescript](https://github.com/microsoft/TypeScript) | `5.9.2` | `5.9.3` |



Updates `@octokit/core` from 7.0.3 to 7.0.5
- [Release notes](https://github.com/octokit/core.js/releases)
- [Commits](https://github.com/octokit/core.js/compare/v7.0.3...v7.0.5)

Updates `@octokit/plugin-retry` from 8.0.1 to 8.0.2
- [Release notes](https://github.com/octokit/plugin-retry.js/releases)
- [Commits](https://github.com/octokit/plugin-retry.js/compare/v8.0.1...v8.0.2)

Updates `@types/node` from 24.3.1 to 24.7.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `@vercel/ncc` from 0.38.3 to 0.38.4
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.38.3...0.38.4)

Updates `jest` from 30.1.3 to 30.2.0
- [Release notes](https://github.com/jestjs/jest/releases)
- [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jestjs/jest/commits/v30.2.0/packages/jest)

Updates `ts-jest` from 29.4.1 to 29.4.4
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/kulshekhar/ts-jest/compare/v29.4.1...v29.4.4)

Updates `typescript` from 5.9.2 to 5.9.3
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release-publish.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.9.2...v5.9.3)

---
updated-dependencies:
- dependency-name: "@octokit/core"
  dependency-version: 7.0.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: "@octokit/plugin-retry"
  dependency-version: 8.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: "@types/node"
  dependency-version: 24.7.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: "@vercel/ncc"
  dependency-version: 0.38.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: jest
  dependency-version: 30.2.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: ts-jest
  dependency-version: 29.4.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: typescript
  dependency-version: 5.9.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-15 15:12:08 -04:00
Craig Duncan 862964743d Ensure error messages display the correct namespace (#458)
* Ensure the kubectl is configured with a default namespace, and override it on the deployment resource

* Provide a helper method to get the namespace of a resource but fallback to the default if unavailable

* Ensure error messages display the correct namespace
2025-10-08 14:40:50 -04:00
dependabot[bot] f647f23716 Bump the actions group across 1 directory with 2 updates (#456)
Bumps the actions group with 2 updates in the / directory: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) and [jest](https://github.com/jestjs/jest/tree/HEAD/packages/jest).


Updates `@types/node` from 24.3.0 to 24.3.1
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `jest` from 30.0.5 to 30.1.3
- [Release notes](https://github.com/jestjs/jest/releases)
- [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jestjs/jest/commits/v30.1.3/packages/jest)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 24.3.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: jest
  dependency-version: 30.1.3
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: David Gamero <david340804@gmail.com>
2025-09-17 16:58:00 -04:00
dependabot[bot] d703e5aec9 Bump the actions group in /.github/workflows with 3 updates (#457)
Bumps the actions group in /.github/workflows with 3 updates: [github/codeql-action](https://github.com/github/codeql-action), [actions/stale](https://github.com/actions/stale) and [actions/setup-python](https://github.com/actions/setup-python).


Updates `github/codeql-action` from 3.30.0 to 3.30.1
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/2d92b76c45b91eb80fc44c74ce3fce0ee94e8f9d...f1f6e5f6af878fb37288ce1c627459e94dbf7d01)

Updates `actions/stale` from 9.1.0 to 10.0.0
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/5bef64f19d7facfb25b37b414482c7164d639639...3a9db7e6a41a89f618792c92c0e97cc736e1b13f)

Updates `actions/setup-python` from 5.6.0 to 6.0.0
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/a26af69be951a213d495a4c3e4e4022e16d87065...e797f83bcb11b83ae66e0230d6156d7c80228e7c)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.30.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: actions/stale
  dependency-version: 10.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/setup-python
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-17 16:49:35 -04:00
dependabot[bot] 65b4b3bcfe Bump github/codeql-action in /.github/workflows in the actions group (#454)
Bumps the actions group in /.github/workflows with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.29.11 to 3.30.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/3c3833e0f8c1c83d449a7478aa59c036a9165498...2d92b76c45b91eb80fc44c74ce3fce0ee94e8f9d)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.30.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-02 15:08:29 -04:00
dependabot[bot] 790189df18 Bump github/codeql-action in /.github/workflows in the actions group (#453)
Bumps the actions group in /.github/workflows with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.29.10 to 3.29.11
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/96f518a34f7a870018057716cc4d7a5c014bd61c...3c3833e0f8c1c83d449a7478aa59c036a9165498)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.29.11
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-26 15:05:44 -04:00
dependabot[bot] 8e0af0340e Bump the actions group with 2 updates (#451)
Bumps the actions group with 2 updates: [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) and [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `@babel/preset-env` from 7.28.0 to 7.28.3
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.28.3/packages/babel-preset-env)

Updates `@types/node` from 24.2.1 to 24.3.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-version: 7.28.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: "@types/node"
  dependency-version: 24.3.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: David Gamero <david340804@gmail.com>
2025-08-19 19:08:05 +00:00
dependabot[bot] 16365ba04f Bump github/codeql-action in /.github/workflows in the actions group (#452)
Bumps the actions group in /.github/workflows with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.29.8 to 3.29.10
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/76621b61decf072c1cee8dd1ce2d2a82d33c17ed...96f518a34f7a870018057716cc4d7a5c014bd61c)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.29.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-19 15:02:49 -04:00
dependabot[bot] 233b2737fd Bump @types/node from 24.2.0 to 24.2.1 in the actions group (#449)
Bumps the actions group with 1 update: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `@types/node` from 24.2.0 to 24.2.1
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 24.2.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: David Gamero <david340804@gmail.com>
2025-08-12 19:09:58 +00:00
dependabot[bot] a4659bf19e Bump the actions group in /.github/workflows with 2 updates (#450)
Bumps the actions group in /.github/workflows with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 4.2.2 to 5.0.0
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/11bd71901bbe5b1630ceea73d27597364c9af683...08c6903cd8c0fde910a37f88322edcfb5dd907a8)

Updates `github/codeql-action` from 3.29.7 to 3.29.8
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/51f77329afa6477de8c49fc9c7046c15b9a4e79d...76621b61decf072c1cee8dd1ce2d2a82d33c17ed)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: github/codeql-action
  dependency-version: 3.29.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-12 15:05:54 -04:00
Suneha Bose e73e618811 chore(release): bump version to 5.0.4 (#448) 2025-08-06 17:03:53 -07:00
82 changed files with 32458 additions and 10531 deletions
+53
View File
@@ -0,0 +1,53 @@
name: 'Setup Minikube Test Environment'
description: 'Common setup steps for minikube integration tests'
inputs:
install-smi:
description: 'Install Linkerd SMI for service mesh tests'
required: false
default: 'false'
runs:
using: 'composite'
steps:
- name: Install dependencies
shell: bash
run: |
rm -rf node_modules/
npm install
- name: Build
shell: bash
run: npm run build
- name: Install conntrack
shell: bash
run: sudo apt-get install -y conntrack
- uses: Azure/setup-kubectl@776406bce94f63e41d621b960d78ee25c8b76ede # v4.0.1
name: Install Kubectl
- id: setup-minikube
name: Setup Minikube
uses: medyagh/setup-minikube@e9e035a86bbc3caea26a450bd4dbf9d0c453682e # v0.0.21
with:
minikube-version: 1.37.0
kubernetes-version: 1.31.0
driver: 'docker'
- name: Install Linkerd and SMI
if: inputs.install-smi == 'true'
shell: bash
run: |
curl --proto '=https' --tlsv1.2 -sSfL https://run.linkerd.io/install-edge | sh
export PATH=$PATH:/home/runner/.linkerd2/bin
curl -sL https://linkerd.github.io/linkerd-smi/install | sh
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.2.0/standard-install.yaml
linkerd install --crds | kubectl apply -f -
linkerd install --set proxyInit.runAsRoot=true | kubectl apply -f -
linkerd smi install | kubectl apply -f -
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # 6.1.0
name: Install Python
with:
python-version: '3.x'
+4 -4
View File
@@ -16,7 +16,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
@@ -24,7 +24,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@51f77329afa6477de8c49fc9c7046c15b9a4e79d #v3.29.5
uses: github/codeql-action/init@c793b717bc78562f491db7b0e93a3a178b099162 #v3.29.5
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java
@@ -32,7 +32,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@51f77329afa6477de8c49fc9c7046c15b9a4e79d #v3.29.5
uses: github/codeql-action/autobuild@c793b717bc78562f491db7b0e93a3a178b099162 #v3.29.5
# ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@@ -46,4 +46,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@51f77329afa6477de8c49fc9c7046c15b9a4e79d #v3.29.5
uses: github/codeql-action/analyze@c793b717bc78562f491db7b0e93a3a178b099162 #v3.29.5
+2 -2
View File
@@ -13,7 +13,7 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
- uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0
name: Setting issue as idle
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
@@ -24,7 +24,7 @@ jobs:
operations-per-run: 100
exempt-issue-labels: 'backlog'
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
- uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0
name: Setting PR as idle
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
+1 -1
View File
@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: install deps
run: npm install
@@ -18,39 +18,15 @@ jobs:
KUBECONFIG: /home/runner/.kube/config
NAMESPACE: test-${{ github.run_id }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install dependencies
run: |
rm -rf node_modules/
npm install
- name: Install ncc
run: npm i -g @vercel/ncc
- name: Install conntrack
run: sudo apt-get install -y conntrack
- name: Build
run: ncc build src/run.ts -o lib
- uses: Azure/setup-kubectl@776406bce94f63e41d621b960d78ee25c8b76ede # v4.0.1
name: Install Kubectl
- id: setup-minikube
name: Setup Minikube
uses: medyagh/setup-minikube@e3c7f79eb1e997eabccc536a6cf318a2b0fe19d9 # v0.0.20
with:
minikube-version: 1.34.0
kubernetes-version: 1.31.0
driver: 'none'
timeout-minutes: 3
- uses: ./.github/actions/minikube-setup
name: Setup Minikube Environment
timeout-minutes: 5
- name: Create namespace to run tests
run: kubectl create ns ${{ env.NAMESPACE }}
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # 5.6.0
name: Install Python
with:
python-version: '3.x'
- name: Cleaning any previously created items
run: |
python test/integration/k8s-deploy-delete.py 'Service' 'all' ${{ env.NAMESPACE }}
@@ -12,45 +12,21 @@ on:
jobs:
run-integration-test:
name: Run Minikube Integration Tests
name: Blue-Green Ingress Tests
runs-on: ubuntu-22.04
env:
KUBECONFIG: /home/runner/.kube/config
NAMESPACE: test-${{ github.run_id }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install dependencies
run: |
rm -rf node_modules/
npm install
- name: Install ncc
run: npm i -g @vercel/ncc
- name: Install conntrack
run: sudo apt-get install -y conntrack
- name: Build
run: ncc build src/run.ts -o lib
- uses: Azure/setup-kubectl@776406bce94f63e41d621b960d78ee25c8b76ede # v4.0.1
name: Install Kubectl
- id: setup-minikube
name: Setup Minikube
uses: medyagh/setup-minikube@e3c7f79eb1e997eabccc536a6cf318a2b0fe19d9 # v0.0.20
with:
minikube-version: 1.34.0
kubernetes-version: 1.31.0
driver: 'none'
timeout-minutes: 3
- uses: ./.github/actions/minikube-setup
name: Setup Minikube Environment
timeout-minutes: 5
- name: Create namespace to run tests
run: kubectl create ns ${{ env.NAMESPACE }}
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # 5.6.0
name: Install Python
with:
python-version: '3.x'
- name: Cleaning any previously created items
run: |
python test/integration/k8s-deploy-delete.py 'Service' 'nginx-service' ${{ env.NAMESPACE }}
@@ -12,45 +12,21 @@ on:
jobs:
run-integration-test:
name: Run Minikube Integration Tests
name: Blue-Green Service Tests
runs-on: ubuntu-22.04
env:
KUBECONFIG: /home/runner/.kube/config
NAMESPACE: test-${{ github.run_id }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install dependencies
run: |
rm -rf node_modules/
npm install
- name: Install ncc
run: npm i -g @vercel/ncc
- name: Install conntrack
run: sudo apt-get install -y conntrack
- name: Build
run: ncc build src/run.ts -o lib
- uses: Azure/setup-kubectl@776406bce94f63e41d621b960d78ee25c8b76ede # v4.0.1
name: Install Kubectl
- id: setup-minikube
name: Setup Minikube
uses: medyagh/setup-minikube@e3c7f79eb1e997eabccc536a6cf318a2b0fe19d9 # v0.0.20
with:
minikube-version: 1.34.0
kubernetes-version: 1.31.0
driver: 'none'
timeout-minutes: 3
- uses: ./.github/actions/minikube-setup
name: Setup Minikube Environment
timeout-minutes: 5
- name: Create namespace to run tests
run: kubectl create ns ${{ env.NAMESPACE }}
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # 5.6.0
name: Install Python
with:
python-version: '3.x'
- name: Cleaning any previously created items
run: |
python test/integration/k8s-deploy-delete.py 'Service' 'all' ${{ env.NAMESPACE }}
@@ -12,56 +12,23 @@ on:
jobs:
run-integration-test:
name: Run Minikube Integration Tests
name: Blue-Green SMI Tests
runs-on: ubuntu-22.04
env:
KUBECONFIG: /home/runner/.kube/config
NAMESPACE: test-${{ github.run_id }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install dependencies
run: |
rm -rf node_modules/
npm install
- name: Install ncc
run: npm i -g @vercel/ncc
- name: Install conntrack
run: sudo apt-get install -y conntrack
- name: Build
run: ncc build src/run.ts -o lib
- uses: Azure/setup-kubectl@776406bce94f63e41d621b960d78ee25c8b76ede # v4.0.1
name: Install Kubectl
- id: setup-minikube
name: Setup Minikube
uses: medyagh/setup-minikube@e3c7f79eb1e997eabccc536a6cf318a2b0fe19d9 # v0.0.20
- uses: ./.github/actions/minikube-setup
name: Setup Minikube Environment
timeout-minutes: 5
with:
minikube-version: 1.34.0
kubernetes-version: 1.31.0
driver: 'none'
timeout-minutes: 3
- name: Install linkerd and add controlplane to cluster
run: |
curl --proto '=https' --tlsv1.2 -sSfL https://run.linkerd.io/install-edge | sh
export PATH=$PATH:/home/runner/.linkerd2/bin
curl -sL https://linkerd.github.io/linkerd-smi/install | sh
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.2.0/standard-install.yaml
linkerd install --crds | kubectl apply -f -
linkerd install --set proxyInit.runAsRoot=true | kubectl apply -f -
linkerd smi install | kubectl apply -f -
install-smi: 'true'
- name: Create namespace to run tests
run: kubectl create ns ${{ env.NAMESPACE }}
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # 5.6.0
name: Install Python
with:
python-version: '3.x'
- name: Cleaning any previously created items
run: |
python test/integration/k8s-deploy-delete.py 'Service' 'all' ${{ env.NAMESPACE }}
@@ -12,45 +12,21 @@ on:
jobs:
run-integration-test:
name: Run Minikube Integration Tests
name: Canary Pod Tests
runs-on: ubuntu-22.04
env:
KUBECONFIG: /home/runner/.kube/config
NAMESPACE: test-${{ github.run_id }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install dependencies
run: |
rm -rf node_modules/
npm install
- name: Install ncc
run: npm i -g @vercel/ncc
- name: Install conntrack
run: sudo apt-get install -y conntrack
- name: Build
run: ncc build src/run.ts -o lib
- uses: Azure/setup-kubectl@776406bce94f63e41d621b960d78ee25c8b76ede # v4.0.1
name: Install Kubectl
- id: setup-minikube
name: Setup Minikube
uses: medyagh/setup-minikube@e3c7f79eb1e997eabccc536a6cf318a2b0fe19d9 # v0.0.20
with:
minikube-version: 1.34.0
kubernetes-version: 1.31.0
driver: 'none'
timeout-minutes: 3
- uses: ./.github/actions/minikube-setup
name: Setup Minikube Environment
timeout-minutes: 5
- name: Create namespace to run tests
run: kubectl create ns ${{ env.NAMESPACE }}
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # 5.6.0
name: Install Python
with:
python-version: '3.x'
- name: Cleaning any previously created items
run: |
python test/integration/k8s-deploy-delete.py 'Service' 'all' ${{ env.NAMESPACE }}
@@ -12,56 +12,23 @@ on:
jobs:
run-integration-test:
name: Run Minikube Integration Tests
name: Canary SMI Tests
runs-on: ubuntu-22.04
env:
KUBECONFIG: /home/runner/.kube/config
NAMESPACE: test-${{ github.run_id }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install dependencies
run: |
rm -rf node_modules/
npm install
- name: Install ncc
run: npm i -g @vercel/ncc
- name: Install conntrack
run: sudo apt-get install -y conntrack
- name: Build
run: ncc build src/run.ts -o lib
- uses: Azure/setup-kubectl@776406bce94f63e41d621b960d78ee25c8b76ede # v4.0.1
name: Install Kubectl
- id: setup-minikube
name: Setup Minikube
uses: medyagh/setup-minikube@e3c7f79eb1e997eabccc536a6cf318a2b0fe19d9 # v0.0.20
- uses: ./.github/actions/minikube-setup
name: Setup Minikube Environment
timeout-minutes: 5
with:
minikube-version: 1.34.0
kubernetes-version: 1.31.0
driver: 'none'
timeout-minutes: 3
- name: Install Linkerd and SMI
run: |
curl --proto '=https' --tlsv1.2 -sSfL https://run.linkerd.io/install-edge | sh
export PATH=$PATH:/home/runner/.linkerd2/bin
curl -sL https://linkerd.github.io/linkerd-smi/install | sh
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.2.0/standard-install.yaml
linkerd install --crds | kubectl apply -f -
linkerd install --set proxyInit.runAsRoot=true | kubectl apply -f -
linkerd smi install | kubectl apply -f -
install-smi: 'true'
- name: Create namespace to run tests
run: kubectl create ns ${{ env.NAMESPACE }}
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # 5.6.0
name: Install Python
with:
python-version: '3.x'
- name: Cleaning any previously created items
run: |
python test/integration/k8s-deploy-delete.py 'Service' 'all' ${{ env.NAMESPACE }}
@@ -14,37 +14,18 @@ on:
jobs:
run-integration-test:
name: Run Namespace Optional Integration Tests
name: Namespace Optional Tests
runs-on: ubuntu-22.04
env:
KUBECONFIG: /home/runner/.kube/config
NAMESPACE1: integration-test-namespace1-${{ github.run_id }}
NAMESPACE2: integration-test-namespace2-${{ github.run_id }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install dependencies
run: |
rm -rf node_modules/
npm install
- name: Install ncc
run: npm i -g @vercel/ncc
- name: Install conntrack
run: sudo apt-get install -y conntrack
- name: Build
run: ncc build src/run.ts -o lib
- uses: Azure/setup-kubectl@776406bce94f63e41d621b960d78ee25c8b76ede # v4.0.1
name: Install Kubectl
- id: setup-minikube
name: Setup Minikube
uses: medyagh/setup-minikube@e3c7f79eb1e997eabccc536a6cf318a2b0fe19d9 # v0.0.20
with:
minikube-version: 1.34.0
kubernetes-version: 1.31.0
driver: 'none'
timeout-minutes: 3
- uses: ./.github/actions/minikube-setup
name: Setup Minikube Environment
timeout-minutes: 5
- name: Create namespaces for tests
run: |
@@ -52,11 +33,6 @@ jobs:
kubectl create ns ${{ env.NAMESPACE2 }}
kubectl create ns test-namespace
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # 5.6.0
name: Install Python
with:
python-version: '3.x'
- name: Cleaning any previously created items
run: |
python test/integration/k8s-deploy-delete.py 'Deployment' 'all' ${{ env.NAMESPACE1 }}
@@ -19,16 +19,16 @@ jobs:
contents: read
id-token: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install dependencies
run: |
rm -rf node_modules/
npm install
- name: Install ncc
run: npm i -g @vercel/ncc
- name: Build
run: ncc build src/run.ts -o lib
run: npm run build
- name: Azure login
uses: azure/login@v2.3.0
with:
@@ -51,7 +51,7 @@ jobs:
run: |
az aks command invoke --resource-group ${{ env.NAMESPACE }} --name ${{ env.NAMESPACE }} --command "kubectl create ns ${{ env.NAMESPACE }}"
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # 5.6.0
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # 6.2.0
name: Install Python
with:
python-version: '3.x'
@@ -12,45 +12,21 @@ on:
jobs:
run-integration-test:
name: Run Minikube Integration Tests
name: Resource Annotation Tests
runs-on: ubuntu-22.04
env:
KUBECONFIG: /home/runner/.kube/config
NAMESPACE: test-${{ github.run_id }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install dependencies
run: |
rm -rf node_modules/
npm install
- name: Install ncc
run: npm i -g @vercel/ncc
- name: Install conntrack
run: sudo apt-get install -y conntrack
- name: Build
run: ncc build src/run.ts -o lib
- uses: Azure/setup-kubectl@776406bce94f63e41d621b960d78ee25c8b76ede # v4.0.1
name: Install Kubectl
- id: setup-minikube
name: Setup Minikube
uses: medyagh/setup-minikube@e3c7f79eb1e997eabccc536a6cf318a2b0fe19d9 # v0.0.20
with:
minikube-version: 1.34.0
kubernetes-version: 1.31.0
driver: 'none'
timeout-minutes: 3
- uses: ./.github/actions/minikube-setup
name: Setup Minikube Environment
timeout-minutes: 5
- name: Create namespace to run tests
run: kubectl create ns ${{ env.NAMESPACE }}
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # 5.6.0
name: Install Python
with:
python-version: '3.x'
- name: Cleaning any previously created items
run: |
python test/integration/k8s-deploy-delete.py 'Service' 'all' ${{ env.NAMESPACE }}
+1 -1
View File
@@ -14,7 +14,7 @@ jobs:
name: Run Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- run: |
npm install
npm test
-1
View File
@@ -2,6 +2,5 @@ node_modules
.DS_Store
.idea
lib/
coverage/
+6
View File
@@ -1,3 +1,9 @@
npm run typecheck || {
echo ""
echo "❌ Type check failed."
echo "💡 Run 'npm run typecheck' to see errors."
exit 1
}
npm test
npm run format-check || {
echo ""
+9
View File
@@ -1,5 +1,14 @@
# Changelog
## [5.1.0] - 2026-03-03
### Added
- #458 [Ensure error messages display the correct namespace](https://github.com/Azure/k8s-deploy/pull/458)
- #482 [docker driver](https://github.com/Azure/k8s-deploy/pull/482)
- #492 [Migrate to esbuild/Vitest and upgrade @actions/\* to ESM-only versions](https://github.com/Azure/k8s-deploy/pull/492)
- #498 [Add typecheck to build script](https://github.com/Azure/k8s-deploy/pull/498)
## [5.0.4] - 2025-08-05
### Added
-20
View File
@@ -1,20 +0,0 @@
module.exports = {
moduleFileExtensions: ['js', 'ts'],
testEnvironment: 'node',
testMatch: ['**/*.test.ts'],
transform: {
'\\.[jt]sx?$': 'babel-jest'
},
transformIgnorePatterns: [
'node_modules/(?!' +
[
'@octokit',
'universal-user-agent',
'before-after-hook',
'minimist'
].join('|') +
')'
],
verbose: true,
testTimeout: 9000
}
+30274
View File
File diff suppressed because one or more lines are too long
+1303 -9626
View File
File diff suppressed because it is too large Load Diff
+19 -23
View File
@@ -1,40 +1,36 @@
{
"name": "k8s-deploy-action",
"version": "5.0.0",
"version": "5.1.0",
"author": "Deepak Sattiraju",
"license": "MIT",
"type": "module",
"scripts": {
"prebuild": "npm i @vercel/ncc",
"build": "ncc build src/run.ts -o lib",
"test": "jest",
"coverage": "jest --coverage=true",
"build": "tsc --noEmit && esbuild src/run.ts --bundle --platform=node --target=node20 --format=esm --outfile=lib/index.js --banner:js=\"import { createRequire } from 'module';const require = createRequire(import.meta.url);\"",
"typecheck": "tsc --noEmit",
"test": "vitest run",
"coverage": "vitest run --coverage",
"format": "prettier --write .",
"format-check": "prettier --check .",
"prepare": "husky"
},
"dependencies": {
"@actions/core": "^1.11.1",
"@actions/exec": "^1.0.0",
"@actions/io": "^1.1.3",
"@actions/tool-cache": "2.0.2",
"@babel/preset-env": "^7.28.0",
"@babel/preset-typescript": "^7.27.1",
"@octokit/core": "^7.0.3",
"@octokit/plugin-retry": "^8.0.1",
"@types/minipass": "^3.3.5",
"husky": "^9.1.7",
"js-yaml": "4.1.0",
"@actions/core": "^3.0.0",
"@actions/exec": "^3.0.0",
"@actions/io": "^3.0.2",
"@actions/tool-cache": "4.0.0",
"@octokit/core": "^7.0.6",
"@octokit/plugin-retry": "^8.1.0",
"js-yaml": "4.1.1",
"minimist": "^1.2.8"
},
"devDependencies": {
"@types/jest": "^30.0.0",
"@types/js-yaml": "^4.0.9",
"@types/minimist": "^1.2.5",
"@types/node": "^24.2.0",
"@vercel/ncc": "^0.38.3",
"jest": "^30.0.5",
"prettier": "^3.6.2",
"ts-jest": "^29.4.1",
"typescript": "5.9.2"
"@types/node": "^25.3.3",
"esbuild": "^0.27",
"husky": "^9.1.7",
"prettier": "^3.8.1",
"typescript": "5.9.3",
"vitest": "^4"
}
}
+8 -8
View File
@@ -1,19 +1,19 @@
import * as core from '@actions/core'
import * as models from '../types/kubernetesTypes'
import * as KubernetesConstants from '../types/kubernetesTypes'
import {Kubectl, Resource} from '../types/kubectl'
import * as models from '../types/kubernetesTypes.js'
import * as KubernetesConstants from '../types/kubernetesTypes.js'
import {Kubectl, Resource} from '../types/kubectl.js'
import {
getResources,
updateManifestFiles
} from '../utilities/manifestUpdateUtils'
} from '../utilities/manifestUpdateUtils.js'
import {
annotateAndLabelResources,
checkManifestStability,
deployManifests
} from '../strategyHelpers/deploymentHelper'
import {DeploymentStrategy} from '../types/deploymentStrategy'
import {parseTrafficSplitMethod} from '../types/trafficSplitMethod'
import {ClusterType} from '../inputUtils'
} from '../strategyHelpers/deploymentHelper.js'
import {DeploymentStrategy} from '../types/deploymentStrategy.js'
import {parseTrafficSplitMethod} from '../types/trafficSplitMethod.js'
import {ClusterType} from '../inputUtils.js'
export const ResourceTypeManagedCluster =
'Microsoft.ContainerService/managedClusters'
export const ResourceTypeFleet = 'Microsoft.ContainerService/fleets'
+18 -18
View File
@@ -1,44 +1,44 @@
import * as core from '@actions/core'
import * as canaryDeploymentHelper from '../strategyHelpers/canary/canaryHelper'
import * as SMICanaryDeploymentHelper from '../strategyHelpers/canary/smiCanaryHelper'
import * as PodCanaryHelper from '../strategyHelpers/canary/podCanaryHelper'
import * as canaryDeploymentHelper from '../strategyHelpers/canary/canaryHelper.js'
import * as SMICanaryDeploymentHelper from '../strategyHelpers/canary/smiCanaryHelper.js'
import * as PodCanaryHelper from '../strategyHelpers/canary/podCanaryHelper.js'
import {
getResources,
updateManifestFiles
} from '../utilities/manifestUpdateUtils'
import {annotateAndLabelResources} from '../strategyHelpers/deploymentHelper'
import * as models from '../types/kubernetesTypes'
import * as KubernetesManifestUtility from '../utilities/manifestStabilityUtils'
} from '../utilities/manifestUpdateUtils.js'
import {annotateAndLabelResources} from '../strategyHelpers/deploymentHelper.js'
import * as models from '../types/kubernetesTypes.js'
import * as KubernetesManifestUtility from '../utilities/manifestStabilityUtils.js'
import {
deleteGreenObjects,
getManifestObjects,
NONE_LABEL_VALUE
} from '../strategyHelpers/blueGreen/blueGreenHelper'
} from '../strategyHelpers/blueGreen/blueGreenHelper.js'
import {BlueGreenManifests} from '../types/blueGreenTypes'
import {DeployResult} from '../types/deployResult'
import {BlueGreenManifests} from '../types/blueGreenTypes.js'
import {DeployResult} from '../types/deployResult.js'
import {
promoteBlueGreenIngress,
promoteBlueGreenService,
promoteBlueGreenSMI
} from '../strategyHelpers/blueGreen/promote'
} from '../strategyHelpers/blueGreen/promote.js'
import {
routeBlueGreenService,
routeBlueGreenIngressUnchanged,
routeBlueGreenSMI
} from '../strategyHelpers/blueGreen/route'
} from '../strategyHelpers/blueGreen/route.js'
import {cleanupSMI} from '../strategyHelpers/blueGreen/smiBlueGreenHelper'
import {Kubectl, Resource} from '../types/kubectl'
import {DeploymentStrategy} from '../types/deploymentStrategy'
import {cleanupSMI} from '../strategyHelpers/blueGreen/smiBlueGreenHelper.js'
import {Kubectl, Resource} from '../types/kubectl.js'
import {DeploymentStrategy} from '../types/deploymentStrategy.js'
import {
parseTrafficSplitMethod,
TrafficSplitMethod
} from '../types/trafficSplitMethod'
import {parseRouteStrategy, RouteStrategy} from '../types/routeStrategy'
import {ClusterType} from '../inputUtils'
} from '../types/trafficSplitMethod.js'
import {parseRouteStrategy, RouteStrategy} from '../types/routeStrategy.js'
import {ClusterType} from '../inputUtils.js'
export async function promote(
kubectl: Kubectl,
+9 -9
View File
@@ -1,20 +1,20 @@
import * as core from '@actions/core'
import * as canaryDeploymentHelper from '../strategyHelpers/canary/canaryHelper'
import * as SMICanaryDeploymentHelper from '../strategyHelpers/canary/smiCanaryHelper'
import {Kubectl} from '../types/kubectl'
import {BlueGreenManifests} from '../types/blueGreenTypes'
import * as canaryDeploymentHelper from '../strategyHelpers/canary/canaryHelper.js'
import * as SMICanaryDeploymentHelper from '../strategyHelpers/canary/smiCanaryHelper.js'
import {Kubectl} from '../types/kubectl.js'
import {BlueGreenManifests} from '../types/blueGreenTypes.js'
import {
rejectBlueGreenIngress,
rejectBlueGreenService,
rejectBlueGreenSMI
} from '../strategyHelpers/blueGreen/reject'
import {getManifestObjects} from '../strategyHelpers/blueGreen/blueGreenHelper'
import {DeploymentStrategy} from '../types/deploymentStrategy'
} from '../strategyHelpers/blueGreen/reject.js'
import {getManifestObjects} from '../strategyHelpers/blueGreen/blueGreenHelper.js'
import {DeploymentStrategy} from '../types/deploymentStrategy.js'
import {
parseTrafficSplitMethod,
TrafficSplitMethod
} from '../types/trafficSplitMethod'
import {parseRouteStrategy, RouteStrategy} from '../types/routeStrategy'
} from '../types/trafficSplitMethod.js'
import {parseRouteStrategy, RouteStrategy} from '../types/routeStrategy.js'
export async function reject(
kubectl: Kubectl,
+5 -2
View File
@@ -1,5 +1,8 @@
import {parseResourceTypeInput} from './inputUtils'
import {ResourceTypeFleet, ResourceTypeManagedCluster} from './actions/deploy'
import {parseResourceTypeInput} from './inputUtils.js'
import {
ResourceTypeFleet,
ResourceTypeManagedCluster
} from './actions/deploy.js'
describe('InputUtils', () => {
describe('parseResourceTypeInput', () => {
+5 -2
View File
@@ -1,6 +1,9 @@
import * as core from '@actions/core'
import {parseAnnotations} from './types/annotations'
import {ResourceTypeFleet, ResourceTypeManagedCluster} from './actions/deploy'
import {parseAnnotations} from './types/annotations.js'
import {
ResourceTypeFleet,
ResourceTypeManagedCluster
} from './actions/deploy.js'
export const inputAnnotations = parseAnnotations(
core.getInput('annotations', {required: false})
+11 -11
View File
@@ -1,19 +1,19 @@
import * as core from '@actions/core'
import {getKubectlPath, Kubectl} from './types/kubectl'
import {getKubectlPath, Kubectl} from './types/kubectl.js'
import {
deploy,
ResourceTypeFleet,
ResourceTypeManagedCluster
} from './actions/deploy'
import {ClusterType} from './inputUtils'
import {promote} from './actions/promote'
import {reject} from './actions/reject'
import {Action, parseAction} from './types/action'
import {parseDeploymentStrategy} from './types/deploymentStrategy'
import {getFilesFromDirectoriesAndURLs} from './utilities/fileUtils'
import {PrivateKubectl} from './types/privatekubectl'
import {parseResourceTypeInput} from './inputUtils'
import {parseDuration} from './utilities/durationUtils'
} from './actions/deploy.js'
import {ClusterType} from './inputUtils.js'
import {promote} from './actions/promote.js'
import {reject} from './actions/reject.js'
import {Action, parseAction} from './types/action.js'
import {parseDeploymentStrategy} from './types/deploymentStrategy.js'
import {getFilesFromDirectoriesAndURLs} from './utilities/fileUtils.js'
import {PrivateKubectl} from './types/privatekubectl.js'
import {parseResourceTypeInput} from './inputUtils.js'
import {parseDuration} from './utilities/durationUtils.js'
export async function run() {
// verify kubeconfig is set
@@ -1,3 +1,5 @@
import {vi} from 'vitest'
import type {MockInstance} from 'vitest'
import {
deployWithLabel,
deleteGreenObjects,
@@ -8,16 +10,16 @@ import {
getNewBlueGreenObject,
GREEN_LABEL_VALUE,
isServiceRouted
} from './blueGreenHelper'
import {BlueGreenDeployment} from '../../types/blueGreenTypes'
import * as bgHelper from './blueGreenHelper'
import {Kubectl} from '../../types/kubectl'
import * as fileHelper from '../../utilities/fileUtils'
import {K8sObject} from '../../types/k8sObject'
import * as manifestUpdateUtils from '../../utilities/manifestUpdateUtils'
} from './blueGreenHelper.js'
import {BlueGreenDeployment} from '../../types/blueGreenTypes.js'
import * as bgHelper from './blueGreenHelper.js'
import {Kubectl} from '../../types/kubectl.js'
import * as fileHelper from '../../utilities/fileUtils.js'
import {K8sObject} from '../../types/k8sObject.js'
import * as manifestUpdateUtils from '../../utilities/manifestUpdateUtils.js'
import {ExecOutput} from '@actions/exec'
jest.mock('../../types/kubectl')
vi.mock('../../types/kubectl')
const kubectl = new Kubectl('')
const TEST_TIMEOUT = '60s'
@@ -37,17 +39,17 @@ const MOCK_EXEC_OUTPUT = {
describe('bluegreenhelper functions', () => {
let testObjects
beforeEach(() => {
//@ts-ignore
Kubectl.mockClear()
vi.restoreAllMocks()
vi.mocked(Kubectl).mockClear()
testObjects = getManifestObjects(['test/unit/manifests/test-ingress.yml'])
jest
.spyOn(fileHelper, 'writeObjectsToFile')
.mockImplementationOnce(() => [''])
vi.spyOn(fileHelper, 'writeObjectsToFile').mockImplementationOnce(() => [
''
])
})
test('correctly deletes services and workloads according to label', async () => {
jest.spyOn(bgHelper, 'deleteObjects').mockReturnValue({} as Promise<void>)
vi.spyOn(bgHelper, 'deleteObjects').mockReturnValue({} as Promise<void>)
const value = await deleteGreenObjects(
kubectl,
@@ -65,21 +67,16 @@ describe('bluegreenhelper functions', () => {
})
test('handles timeout when deleting objects', async () => {
// Mock deleteObjects to prevent actual execution
const deleteSpy = jest
.spyOn(kubectl, 'delete')
.mockResolvedValue(MOCK_EXEC_OUTPUT)
const deleteMock = vi.fn().mockResolvedValue(MOCK_EXEC_OUTPUT)
kubectl.delete = deleteMock
await bgHelper.deleteObjects(
kubectl,
EXPECTED_GREEN_OBJECTS,
TEST_TIMEOUT
)
const deleteList = EXPECTED_GREEN_OBJECTS
// Verify kubectl.delete is called with timeout for each object in deleteList
expect(deleteSpy).toHaveBeenCalledTimes(EXPECTED_GREEN_OBJECTS.length)
EXPECTED_GREEN_OBJECTS.forEach(({name, kind}) => {
expect(deleteSpy).toHaveBeenCalledWith(
await bgHelper.deleteObjects(kubectl, deleteList, TEST_TIMEOUT)
expect(deleteMock).toHaveBeenCalledTimes(deleteList.length)
deleteList.forEach(({name, kind}) => {
expect(deleteMock).toHaveBeenCalledWith(
[kind, name],
undefined,
TEST_TIMEOUT
@@ -135,7 +132,7 @@ describe('bluegreenhelper functions', () => {
})
test('correctly makes labeled workloads', async () => {
const kubectlApplySpy = jest.spyOn(kubectl, 'apply').mockResolvedValue({
const kubectlApplySpy = vi.spyOn(kubectl, 'apply').mockResolvedValue({
stdout: 'deployment.apps/nginx-deployment created',
stderr: '',
exitCode: 0
@@ -179,9 +176,9 @@ describe('bluegreenhelper functions', () => {
exitCode: 0
}
jest
.spyOn(kubectl, 'getResource')
.mockImplementation(() => Promise.resolve(mockExecOutput))
vi.spyOn(kubectl, 'getResource').mockImplementation(() =>
Promise.resolve(mockExecOutput)
)
const fetched = await fetchResource(
kubectl,
'nginx-deployment',
@@ -209,12 +206,12 @@ describe('bluegreenhelper functions', () => {
]
for (const testCase of errorTestCases) {
const spy = jest.spyOn(kubectl, 'getResource')
const spy = vi.spyOn(kubectl, 'getResource')
if (testCase.mockOutput) {
spy.mockImplementation(() => Promise.resolve(testCase.mockOutput))
} else {
spy.mockImplementation()
spy.mockResolvedValue(null)
}
const fetched = await fetchResource(
@@ -235,12 +232,13 @@ describe('bluegreenhelper functions', () => {
stderr: ''
} as ExecOutput
jest.spyOn(kubectl, 'getResource').mockResolvedValue(mockExecOutput)
jest
.spyOn(manifestUpdateUtils, 'UnsetClusterSpecificDetails')
.mockImplementation(() => {
throw new Error('test error')
})
vi.spyOn(kubectl, 'getResource').mockResolvedValue(mockExecOutput)
vi.spyOn(
manifestUpdateUtils,
'UnsetClusterSpecificDetails'
).mockImplementation(() => {
throw new Error('test error')
})
expect(
await fetchResource(kubectl, 'nginx-deployment', 'Deployment')
@@ -267,7 +265,7 @@ describe('bluegreenhelper functions', () => {
describe('deployObjects', () => {
let mockObjects: any[]
let kubectlApplySpy: jest.SpyInstance
let kubectlApplySpy: MockInstance
const mockSuccessResult: ExecOutput = {
stdout: 'deployment.apps/nginx-deployment created',
@@ -285,11 +283,11 @@ describe('bluegreenhelper functions', () => {
// //@ts-ignore
// Kubectl.mockClear()
mockObjects = [testObjects.deploymentEntityList[0]]
kubectlApplySpy = jest.spyOn(kubectl, 'apply')
kubectlApplySpy = vi.spyOn(kubectl, 'apply')
})
afterEach(() => {
jest.clearAllMocks()
vi.clearAllMocks()
})
it('should return execution result and manifest files when kubectl apply succeeds', async () => {
@@ -2,27 +2,27 @@ import * as core from '@actions/core'
import * as fs from 'fs'
import * as yaml from 'js-yaml'
import {DeployResult} from '../../types/deployResult'
import {K8sObject, K8sDeleteObject} from '../../types/k8sObject'
import {Kubectl} from '../../types/kubectl'
import {DeployResult} from '../../types/deployResult.js'
import {K8sObject, K8sDeleteObject} from '../../types/k8sObject.js'
import {Kubectl} from '../../types/kubectl.js'
import {
isDeploymentEntity,
isIngressEntity,
isServiceEntity,
KubernetesWorkload
} from '../../types/kubernetesTypes'
} from '../../types/kubernetesTypes.js'
import {
BlueGreenDeployment,
BlueGreenManifests
} from '../../types/blueGreenTypes'
import * as fileHelper from '../../utilities/fileUtils'
import {updateSpecLabels} from '../../utilities/manifestSpecLabelUtils'
import {checkForErrors} from '../../utilities/kubectlUtils'
} from '../../types/blueGreenTypes.js'
import * as fileHelper from '../../utilities/fileUtils.js'
import {updateSpecLabels} from '../../utilities/manifestSpecLabelUtils.js'
import {checkForErrors} from '../../utilities/kubectlUtils.js'
import {
UnsetClusterSpecificDetails,
updateObjectLabels,
updateSelectorLabels
} from '../../utilities/manifestUpdateUtils'
} from '../../utilities/manifestUpdateUtils.js'
export const GREEN_LABEL_VALUE = 'green'
export const NONE_LABEL_VALUE = 'None'
+52 -52
View File
@@ -1,21 +1,23 @@
import {BlueGreenDeployment} from '../../types/blueGreenTypes'
import {vi} from 'vitest'
import type {MockInstance} from 'vitest'
import {BlueGreenDeployment} from '../../types/blueGreenTypes.js'
import {
deployBlueGreen,
deployBlueGreenIngress,
deployBlueGreenService,
deployBlueGreenSMI
} from './deploy'
import * as routeTester from './route'
import {Kubectl} from '../../types/kubectl'
import {RouteStrategy} from '../../types/routeStrategy'
import * as TSutils from '../../utilities/trafficSplitUtils'
import * as bgHelper from './blueGreenHelper'
import * as smiHelper from './smiBlueGreenHelper'
} from './deploy.js'
import * as routeTester from './route.js'
import {Kubectl} from '../../types/kubectl.js'
import {RouteStrategy} from '../../types/routeStrategy.js'
import * as TSutils from '../../utilities/trafficSplitUtils.js'
import * as bgHelper from './blueGreenHelper.js'
import * as smiHelper from './smiBlueGreenHelper.js'
import {ExecOutput} from '@actions/exec'
const ingressFilepath = ['test/unit/manifests/test-ingress-new.yml']
jest.mock('../../types/kubectl')
vi.mock('../../types/kubectl')
// Shared variables and mock objects used across all test suites
const mockDeployResult = {
@@ -30,7 +32,7 @@ const mockBgDeployment: BlueGreenDeployment = {
describe('deploy tests', () => {
let kubectl: Kubectl
let kubectlApplySpy: jest.SpyInstance
let kubectlApplySpy: MockInstance
const mockSuccessResult: ExecOutput = {
stdout: 'deployment.apps/nginx-deployment created',
@@ -45,21 +47,20 @@ describe('deploy tests', () => {
}
beforeEach(() => {
//@ts-ignore
Kubectl.mockClear()
vi.mocked(Kubectl).mockClear()
kubectl = new Kubectl('')
kubectlApplySpy = jest.spyOn(kubectl, 'apply')
kubectlApplySpy = vi.spyOn(kubectl, 'apply')
})
test('correctly determines deploy type and acts accordingly', async () => {
kubectlApplySpy.mockResolvedValue(mockSuccessResult)
jest
.spyOn(routeTester, 'routeBlueGreenForDeploy')
.mockImplementation(() => Promise.resolve(mockBgDeployment))
jest
.spyOn(TSutils, 'getTrafficSplitAPIVersion')
.mockImplementation(() => Promise.resolve('v1alpha3'))
vi.spyOn(routeTester, 'routeBlueGreenForDeploy').mockImplementation(() =>
Promise.resolve(mockBgDeployment)
)
vi.spyOn(TSutils, 'getTrafficSplitAPIVersion').mockImplementation(() =>
Promise.resolve('v1alpha3')
)
const ingressResult = await deployBlueGreen(
kubectl,
@@ -112,12 +113,12 @@ describe('deploy tests', () => {
fn: () =>
deployBlueGreen(kubectl, ingressFilepath, RouteStrategy.INGRESS),
setup: () => {
jest
.spyOn(routeTester, 'routeBlueGreenForDeploy')
.mockImplementation(() => Promise.resolve(mockBgDeployment))
jest
.spyOn(TSutils, 'getTrafficSplitAPIVersion')
.mockImplementation(() => Promise.resolve('v1alpha3'))
vi.spyOn(routeTester, 'routeBlueGreenForDeploy').mockImplementation(
() => Promise.resolve(mockBgDeployment)
)
vi.spyOn(TSutils, 'getTrafficSplitAPIVersion').mockImplementation(
() => Promise.resolve('v1alpha3')
)
}
},
{
@@ -125,24 +126,24 @@ describe('deploy tests', () => {
fn: () =>
deployBlueGreen(kubectl, ingressFilepath, RouteStrategy.SERVICE),
setup: () => {
jest
.spyOn(routeTester, 'routeBlueGreenForDeploy')
.mockImplementation(() => Promise.resolve(mockBgDeployment))
jest
.spyOn(TSutils, 'getTrafficSplitAPIVersion')
.mockImplementation(() => Promise.resolve('v1alpha3'))
vi.spyOn(routeTester, 'routeBlueGreenForDeploy').mockImplementation(
() => Promise.resolve(mockBgDeployment)
)
vi.spyOn(TSutils, 'getTrafficSplitAPIVersion').mockImplementation(
() => Promise.resolve('v1alpha3')
)
}
},
{
name: 'should throw error when kubectl apply fails during blue/green deployment with SMI strategy',
fn: () => deployBlueGreen(kubectl, ingressFilepath, RouteStrategy.SMI),
setup: () => {
jest
.spyOn(routeTester, 'routeBlueGreenForDeploy')
.mockImplementation(() => Promise.resolve(mockBgDeployment))
jest
.spyOn(TSutils, 'getTrafficSplitAPIVersion')
.mockImplementation(() => Promise.resolve('v1alpha3'))
vi.spyOn(routeTester, 'routeBlueGreenForDeploy').mockImplementation(
() => Promise.resolve(mockBgDeployment)
)
vi.spyOn(TSutils, 'getTrafficSplitAPIVersion').mockImplementation(
() => Promise.resolve('v1alpha3')
)
}
},
{
@@ -181,8 +182,7 @@ describe('deploy timeout tests', () => {
let kubectl: Kubectl
beforeEach(() => {
//@ts-ignore
Kubectl.mockClear()
vi.mocked(Kubectl).mockClear()
kubectl = new Kubectl('')
})
@@ -190,16 +190,16 @@ describe('deploy timeout tests', () => {
const timeout = '300s'
// Mock the helper functions that are actually called
const deployWithLabelSpy = jest
const deployWithLabelSpy = vi
.spyOn(bgHelper, 'deployWithLabel')
.mockResolvedValue(mockBgDeployment)
const deployObjectsSpy = jest
const deployObjectsSpy = vi
.spyOn(bgHelper, 'deployObjects')
.mockResolvedValue(mockDeployResult)
const setupSMISpy = jest
const setupSMISpy = vi
.spyOn(smiHelper, 'setupSMI')
.mockResolvedValue(mockBgDeployment)
const routeSpy = jest
const routeSpy = vi
.spyOn(routeTester, 'routeBlueGreenForDeploy')
.mockResolvedValue(mockBgDeployment)
@@ -258,10 +258,10 @@ describe('deploy timeout tests', () => {
const timeout = '240s'
// Mock the dependencies
const deployWithLabelSpy = jest
const deployWithLabelSpy = vi
.spyOn(bgHelper, 'deployWithLabel')
.mockResolvedValue(mockBgDeployment)
const deployObjectsSpy = jest
const deployObjectsSpy = vi
.spyOn(bgHelper, 'deployObjects')
.mockResolvedValue(mockDeployResult)
@@ -290,10 +290,10 @@ describe('deploy timeout tests', () => {
const timeout = '180s'
// Mock the dependencies
const deployWithLabelSpy = jest
const deployWithLabelSpy = vi
.spyOn(bgHelper, 'deployWithLabel')
.mockResolvedValue(mockBgDeployment)
const deployObjectsSpy = jest
const deployObjectsSpy = vi
.spyOn(bgHelper, 'deployObjects')
.mockResolvedValue(mockDeployResult)
@@ -322,13 +322,13 @@ describe('deploy timeout tests', () => {
const timeout = '360s'
// Mock the dependencies
const setupSMISpy = jest
const setupSMISpy = vi
.spyOn(smiHelper, 'setupSMI')
.mockResolvedValue(mockBgDeployment)
const deployObjectsSpy = jest
const deployObjectsSpy = vi
.spyOn(bgHelper, 'deployObjects')
.mockResolvedValue(mockDeployResult)
const deployWithLabelSpy = jest
const deployWithLabelSpy = vi
.spyOn(bgHelper, 'deployWithLabel')
.mockResolvedValue(mockBgDeployment)
@@ -354,10 +354,10 @@ describe('deploy timeout tests', () => {
})
test('deploy functions without timeout should pass undefined', async () => {
const deployWithLabelSpy = jest
const deployWithLabelSpy = vi
.spyOn(bgHelper, 'deployWithLabel')
.mockResolvedValue(mockBgDeployment)
const deployObjectsSpy = jest
const deployObjectsSpy = vi
.spyOn(bgHelper, 'deployObjects')
.mockResolvedValue(mockDeployResult)
+7 -7
View File
@@ -1,23 +1,23 @@
import * as core from '@actions/core'
import {Kubectl} from '../../types/kubectl'
import {Kubectl} from '../../types/kubectl.js'
import {
BlueGreenDeployment,
BlueGreenManifests
} from '../../types/blueGreenTypes'
} from '../../types/blueGreenTypes.js'
import {RouteStrategy} from '../../types/routeStrategy'
import {RouteStrategy} from '../../types/routeStrategy.js'
import {
deployWithLabel,
getManifestObjects,
GREEN_LABEL_VALUE,
deployObjects
} from './blueGreenHelper'
import {setupSMI} from './smiBlueGreenHelper'
} from './blueGreenHelper.js'
import {setupSMI} from './smiBlueGreenHelper.js'
import {routeBlueGreenForDeploy} from './route'
import {DeployResult} from '../../types/deployResult'
import {routeBlueGreenForDeploy} from './route.js'
import {DeployResult} from '../../types/deployResult.js'
export async function deployBlueGreen(
kubectl: Kubectl,
@@ -1,27 +1,27 @@
import {getManifestObjects, GREEN_LABEL_VALUE} from './blueGreenHelper'
import * as bgHelper from './blueGreenHelper'
import {vi} from 'vitest'
import {getManifestObjects, GREEN_LABEL_VALUE} from './blueGreenHelper.js'
import * as bgHelper from './blueGreenHelper.js'
import {
getUpdatedBlueGreenIngress,
isIngressRouted,
validateIngresses
} from './ingressBlueGreenHelper'
import {Kubectl} from '../../types/kubectl'
import * as fileHelper from '../../utilities/fileUtils'
} from './ingressBlueGreenHelper.js'
import {Kubectl} from '../../types/kubectl.js'
import * as fileHelper from '../../utilities/fileUtils.js'
const betaFilepath = ['test/unit/manifests/test-ingress.yml']
const ingressFilepath = ['test/unit/manifests/test-ingress-new.yml']
const kubectl = new Kubectl('')
jest.mock('../../types/kubectl')
vi.mock('../../types/kubectl')
describe('ingress blue green helpers', () => {
let testObjects
beforeEach(() => {
//@ts-ignore
Kubectl.mockClear()
vi.mocked(Kubectl).mockClear()
testObjects = getManifestObjects(ingressFilepath)
jest
.spyOn(fileHelper, 'writeObjectsToFile')
.mockImplementationOnce(() => [''])
vi.spyOn(fileHelper, 'writeObjectsToFile').mockImplementationOnce(() => [
''
])
})
test('it should correctly classify ingresses', () => {
@@ -72,7 +72,7 @@ describe('ingress blue green helpers', () => {
test('it should validate ingresses', async () => {
// what if nothing gets returned from fetchResource?
jest.spyOn(bgHelper, 'fetchResource').mockImplementation()
vi.spyOn(bgHelper, 'fetchResource').mockResolvedValue(null)
let validResponse = await validateIngresses(
kubectl,
testObjects.ingressEntityList,
@@ -89,9 +89,9 @@ describe('ingress blue green helpers', () => {
const mockLabels = new Map<string, string>()
mockLabels[bgHelper.BLUE_GREEN_VERSION_LABEL] = GREEN_LABEL_VALUE
mockIngress.metadata.labels = mockLabels
jest
.spyOn(bgHelper, 'fetchResource')
.mockImplementation(() => Promise.resolve(mockIngress))
vi.spyOn(bgHelper, 'fetchResource').mockImplementation(() =>
Promise.resolve(mockIngress)
)
validResponse = await validateIngresses(
kubectl,
testObjects.ingressEntityList,
@@ -1,12 +1,12 @@
import * as core from '@actions/core'
import {K8sIngress} from '../../types/k8sObject'
import {K8sIngress} from '../../types/k8sObject.js'
import {
addBlueGreenLabelsAndAnnotations,
BLUE_GREEN_VERSION_LABEL,
GREEN_LABEL_VALUE,
fetchResource
} from './blueGreenHelper'
import {Kubectl} from '../../types/kubectl'
} from './blueGreenHelper.js'
import {Kubectl} from '../../types/kubectl.js'
const BACKEND = 'backend'
+47 -53
View File
@@ -1,20 +1,22 @@
import {getManifestObjects} from './blueGreenHelper'
import {vi} from 'vitest'
import type {MockInstance} from 'vitest'
import {getManifestObjects} from './blueGreenHelper.js'
import {
promoteBlueGreenIngress,
promoteBlueGreenService,
promoteBlueGreenSMI
} from './promote'
import {TrafficSplitObject} from '../../types/k8sObject'
import * as servicesTester from './serviceBlueGreenHelper'
import {Kubectl} from '../../types/kubectl'
import {MAX_VAL, MIN_VAL, TRAFFIC_SPLIT_OBJECT} from './smiBlueGreenHelper'
import * as smiTester from './smiBlueGreenHelper'
import * as bgHelper from './blueGreenHelper'
} from './promote.js'
import {TrafficSplitObject} from '../../types/k8sObject.js'
import * as servicesTester from './serviceBlueGreenHelper.js'
import {Kubectl} from '../../types/kubectl.js'
import {MAX_VAL, MIN_VAL, TRAFFIC_SPLIT_OBJECT} from './smiBlueGreenHelper.js'
import * as smiTester from './smiBlueGreenHelper.js'
import * as bgHelper from './blueGreenHelper.js'
import {ExecOutput} from '@actions/exec'
const ingressFilepath = ['test/unit/manifests/test-ingress-new.yml']
jest.mock('../../types/kubectl')
vi.mock('../../types/kubectl')
// Shared variables used across all test suites
let testObjects: any
@@ -42,13 +44,12 @@ const mockBgDeployment = {
}
describe('promote tests', () => {
let kubectlApplySpy: jest.SpyInstance
let kubectlApplySpy: MockInstance
beforeEach(() => {
//@ts-ignore
Kubectl.mockClear()
vi.mocked(Kubectl).mockClear()
testObjects = getManifestObjects(ingressFilepath)
kubectlApplySpy = jest.spyOn(kubectl, 'apply')
kubectlApplySpy = vi.spyOn(kubectl, 'apply')
})
test('promote blue/green ingress', async () => {
@@ -57,7 +58,7 @@ describe('promote tests', () => {
const mockLabels = new Map<string, string>()
mockLabels[bgHelper.BLUE_GREEN_VERSION_LABEL] = bgHelper.GREEN_LABEL_VALUE
jest.spyOn(bgHelper, 'fetchResource').mockImplementation(() =>
vi.spyOn(bgHelper, 'fetchResource').mockImplementation(() =>
Promise.resolve({
kind: 'Ingress',
spec: {},
@@ -82,7 +83,7 @@ describe('promote tests', () => {
test('fail to promote invalid blue/green ingress', async () => {
const mockLabels = new Map<string, string>()
mockLabels[bgHelper.BLUE_GREEN_VERSION_LABEL] = bgHelper.NONE_LABEL_VALUE
jest.spyOn(bgHelper, 'fetchResource').mockImplementation(() =>
vi.spyOn(bgHelper, 'fetchResource').mockImplementation(() =>
Promise.resolve({
kind: 'Ingress',
spec: {},
@@ -100,7 +101,7 @@ describe('promote tests', () => {
const mockLabels = new Map<string, string>()
mockLabels[bgHelper.BLUE_GREEN_VERSION_LABEL] = bgHelper.GREEN_LABEL_VALUE
jest.spyOn(bgHelper, 'fetchResource').mockImplementation(() =>
vi.spyOn(bgHelper, 'fetchResource').mockImplementation(() =>
Promise.resolve({
kind: 'Service',
spec: {selector: mockLabels},
@@ -120,16 +121,16 @@ describe('promote tests', () => {
test('fail to promote invalid blue/green service', async () => {
const mockLabels = new Map<string, string>()
mockLabels[bgHelper.BLUE_GREEN_VERSION_LABEL] = bgHelper.NONE_LABEL_VALUE
jest.spyOn(bgHelper, 'fetchResource').mockImplementation(() =>
vi.spyOn(bgHelper, 'fetchResource').mockImplementation(() =>
Promise.resolve({
kind: 'Service',
spec: {},
metadata: {labels: mockLabels, name: 'nginx-ingress-green'}
})
)
jest
.spyOn(servicesTester, 'validateServicesState')
.mockImplementationOnce(() => Promise.resolve(false))
vi.spyOn(servicesTester, 'validateServicesState').mockImplementationOnce(
() => Promise.resolve(false)
)
await expect(
promoteBlueGreenService(kubectl, testObjects)
@@ -164,9 +165,9 @@ describe('promote tests', () => {
]
}
}
jest
.spyOn(bgHelper, 'fetchResource')
.mockImplementation(() => Promise.resolve(mockTsObject))
vi.spyOn(bgHelper, 'fetchResource').mockImplementation(() =>
Promise.resolve(mockTsObject)
)
const deployResult = await promoteBlueGreenSMI(kubectl, testObjects)
@@ -182,11 +183,11 @@ describe('promote tests', () => {
test('promote blue/green SMI with bad trafficsplit', async () => {
const mockLabels = new Map<string, string>()
mockLabels[bgHelper.BLUE_GREEN_VERSION_LABEL] = bgHelper.NONE_LABEL_VALUE
jest
.spyOn(smiTester, 'validateTrafficSplitsState')
.mockImplementation(() => Promise.resolve(false))
vi.spyOn(smiTester, 'validateTrafficSplitsState').mockImplementation(() =>
Promise.resolve(false)
)
expect(promoteBlueGreenSMI(kubectl, testObjects)).rejects.toThrow()
await expect(promoteBlueGreenSMI(kubectl, testObjects)).rejects.toThrow()
})
// Consolidated error tests
@@ -198,7 +199,7 @@ describe('promote tests', () => {
const mockLabels = new Map<string, string>()
mockLabels[bgHelper.BLUE_GREEN_VERSION_LABEL] =
bgHelper.GREEN_LABEL_VALUE
jest.spyOn(bgHelper, 'fetchResource').mockImplementation(() =>
vi.spyOn(bgHelper, 'fetchResource').mockImplementation(() =>
Promise.resolve({
kind: 'Ingress',
spec: {},
@@ -214,16 +215,16 @@ describe('promote tests', () => {
const mockLabels = new Map<string, string>()
mockLabels[bgHelper.BLUE_GREEN_VERSION_LABEL] =
bgHelper.GREEN_LABEL_VALUE
jest.spyOn(bgHelper, 'fetchResource').mockImplementation(() =>
vi.spyOn(bgHelper, 'fetchResource').mockImplementation(() =>
Promise.resolve({
kind: 'Service',
spec: {selector: mockLabels},
metadata: {labels: mockLabels, name: 'nginx-service-green'}
})
)
jest
.spyOn(servicesTester, 'validateServicesState')
.mockResolvedValue(true)
vi.spyOn(servicesTester, 'validateServicesState').mockResolvedValue(
true
)
}
},
{
@@ -246,12 +247,10 @@ describe('promote tests', () => {
]
}
}
jest
.spyOn(bgHelper, 'fetchResource')
.mockResolvedValue(mockTsObject)
jest
.spyOn(smiTester, 'validateTrafficSplitsState')
.mockResolvedValue(true)
vi.spyOn(bgHelper, 'fetchResource').mockResolvedValue(mockTsObject)
vi.spyOn(smiTester, 'validateTrafficSplitsState').mockResolvedValue(
true
)
}
}
])('$name', async ({fn, setup}) => {
@@ -279,15 +278,12 @@ describe('promote tests', () => {
// Timeout tests
describe('promote timeout tests', () => {
beforeEach(() => {
// @ts-ignore
Kubectl.mockClear()
vi.mocked(Kubectl).mockClear()
testObjects = getManifestObjects(ingressFilepath)
})
const mockDeployWithLabel = () =>
jest
.spyOn(bgHelper, 'deployWithLabel')
.mockResolvedValue(mockBgDeployment)
vi.spyOn(bgHelper, 'deployWithLabel').mockResolvedValue(mockBgDeployment)
const setupFetchResource = (
kind: string,
@@ -297,7 +293,7 @@ describe('promote timeout tests', () => {
const mockLabels = new Map<string, string>()
mockLabels[bgHelper.BLUE_GREEN_VERSION_LABEL] = labelValue
jest.spyOn(bgHelper, 'fetchResource').mockResolvedValue({
vi.spyOn(bgHelper, 'fetchResource').mockResolvedValue({
kind,
spec: {},
metadata: {labels: mockLabels, name}
@@ -330,9 +326,9 @@ describe('promote timeout tests', () => {
'nginx-service-green',
bgHelper.GREEN_LABEL_VALUE
)
jest
.spyOn(servicesTester, 'validateServicesState')
.mockResolvedValue(true)
vi.spyOn(servicesTester, 'validateServicesState').mockResolvedValue(
true
)
}
},
{
@@ -359,12 +355,10 @@ describe('promote timeout tests', () => {
}
}
jest
.spyOn(bgHelper, 'fetchResource')
.mockResolvedValue(mockTsObject)
jest
.spyOn(smiTester, 'validateTrafficSplitsState')
.mockResolvedValue(true)
vi.spyOn(bgHelper, 'fetchResource').mockResolvedValue(mockTsObject)
vi.spyOn(smiTester, 'validateTrafficSplitsState').mockResolvedValue(
true
)
}
}
])('$name', async ({fn, timeout, setup}) => {
+6 -6
View File
@@ -1,13 +1,13 @@
import * as core from '@actions/core'
import {Kubectl} from '../../types/kubectl'
import {Kubectl} from '../../types/kubectl.js'
import {BlueGreenDeployment} from '../../types/blueGreenTypes'
import {deployWithLabel, NONE_LABEL_VALUE} from './blueGreenHelper'
import {BlueGreenDeployment} from '../../types/blueGreenTypes.js'
import {deployWithLabel, NONE_LABEL_VALUE} from './blueGreenHelper.js'
import {validateIngresses} from './ingressBlueGreenHelper'
import {validateServicesState} from './serviceBlueGreenHelper'
import {validateTrafficSplitsState} from './smiBlueGreenHelper'
import {validateIngresses} from './ingressBlueGreenHelper.js'
import {validateServicesState} from './serviceBlueGreenHelper.js'
import {validateTrafficSplitsState} from './smiBlueGreenHelper.js'
export async function promoteBlueGreenIngress(
kubectl: Kubectl,
+38 -39
View File
@@ -1,21 +1,23 @@
import {getManifestObjects} from './blueGreenHelper'
import {Kubectl} from '../../types/kubectl'
import {vi} from 'vitest'
import type {MockInstance} from 'vitest'
import {getManifestObjects} from './blueGreenHelper.js'
import {Kubectl} from '../../types/kubectl.js'
import * as TSutils from '../../utilities/trafficSplitUtils'
import * as TSutils from '../../utilities/trafficSplitUtils.js'
import {
rejectBlueGreenIngress,
rejectBlueGreenService,
rejectBlueGreenSMI
} from './reject'
import * as bgHelper from './blueGreenHelper'
import * as routeHelper from './route'
} from './reject.js'
import * as bgHelper from './blueGreenHelper.js'
import * as routeHelper from './route.js'
const ingressFilepath = ['test/unit/manifests/test-ingress-new.yml']
const kubectl = new Kubectl('')
const TEST_TIMEOUT_SHORT = '60s'
const TEST_TIMEOUT_LONG = '120s'
jest.mock('../../types/kubectl')
vi.mock('../../types/kubectl')
// Shared mock objects following DRY principle
const mockSuccessResult = {
@@ -54,14 +56,13 @@ const mockDeleteResult = [
describe('reject tests', () => {
let testObjects: any
let kubectlApplySpy: jest.SpyInstance
let kubectlApplySpy: MockInstance
beforeEach(() => {
//@ts-ignore
Kubectl.mockClear()
jest.restoreAllMocks()
vi.mocked(Kubectl).mockClear()
vi.restoreAllMocks()
testObjects = getManifestObjects(ingressFilepath)
kubectlApplySpy = jest.spyOn(kubectl, 'apply')
kubectlApplySpy = vi.spyOn(kubectl, 'apply')
})
test('reject blue/green ingress', async () => {
@@ -89,13 +90,13 @@ describe('reject tests', () => {
test('reject blue/green ingress with timeout', async () => {
// Mock routeBlueGreenIngressUnchanged and deleteGreenObjects
jest
.spyOn(routeHelper, 'routeBlueGreenIngressUnchanged')
.mockResolvedValue(mockBgDeployment)
vi.spyOn(routeHelper, 'routeBlueGreenIngressUnchanged').mockResolvedValue(
mockBgDeployment
)
jest
.spyOn(bgHelper, 'deleteGreenObjects')
.mockResolvedValue(mockDeleteResult)
vi.spyOn(bgHelper, 'deleteGreenObjects').mockResolvedValue(
mockDeleteResult
)
const value = await rejectBlueGreenIngress(
kubectl,
@@ -138,9 +139,9 @@ describe('reject tests', () => {
test('reject blue/green service', async () => {
kubectlApplySpy.mockResolvedValue(mockSuccessResult)
jest
.spyOn(bgHelper, 'deleteGreenObjects')
.mockResolvedValue(mockDeleteResult)
vi.spyOn(bgHelper, 'deleteGreenObjects').mockResolvedValue(
mockDeleteResult
)
const value = await rejectBlueGreenService(
kubectl,
@@ -163,7 +164,7 @@ describe('reject tests', () => {
test('reject blue/green service with timeout', async () => {
// Mock routeBlueGreenService and deleteGreenObjects
jest.spyOn(routeHelper, 'routeBlueGreenService').mockResolvedValue({
vi.spyOn(routeHelper, 'routeBlueGreenService').mockResolvedValue({
deployResult: {
execResult: {stdout: '', stderr: '', exitCode: 0},
manifestFiles: []
@@ -180,11 +181,9 @@ describe('reject tests', () => {
]
})
jest
.spyOn(bgHelper, 'deleteGreenObjects')
.mockResolvedValue([
{name: 'nginx-deployment-green', kind: 'Deployment'}
])
vi.spyOn(bgHelper, 'deleteGreenObjects').mockResolvedValue([
{name: 'nginx-deployment-green', kind: 'Deployment'}
])
const value = await rejectBlueGreenService(
kubectl,
@@ -213,9 +212,9 @@ describe('reject tests', () => {
// Mock kubectl.apply to return successful result
kubectlApplySpy.mockResolvedValue(mockSuccessResult)
jest
.spyOn(TSutils, 'getTrafficSplitAPIVersion')
.mockImplementation(() => Promise.resolve('v1alpha3'))
vi.spyOn(TSutils, 'getTrafficSplitAPIVersion').mockImplementation(() =>
Promise.resolve('v1alpha3')
)
const rejectResult = await rejectBlueGreenSMI(kubectl, testObjects)
expect(rejectResult.deleteResult).toHaveLength(2)
})
@@ -226,27 +225,27 @@ describe('reject tests', () => {
name: 'should throw error when kubectl apply fails during blue/green ingress rejection',
fn: () => rejectBlueGreenIngress(kubectl, testObjects),
setup: () => {
jest
.spyOn(bgHelper, 'deleteGreenObjects')
.mockResolvedValue(mockDeleteResult)
vi.spyOn(bgHelper, 'deleteGreenObjects').mockResolvedValue(
mockDeleteResult
)
}
},
{
name: 'should throw error when kubectl apply fails during blue/green service rejection',
fn: () => rejectBlueGreenService(kubectl, testObjects),
setup: () => {
jest
.spyOn(bgHelper, 'deleteGreenObjects')
.mockResolvedValue(mockDeleteResult)
vi.spyOn(bgHelper, 'deleteGreenObjects').mockResolvedValue(
mockDeleteResult
)
}
},
{
name: 'should throw error when kubectl apply fails during blue/green SMI rejection',
fn: () => rejectBlueGreenSMI(kubectl, testObjects),
setup: () => {
jest
.spyOn(TSutils, 'getTrafficSplitAPIVersion')
.mockImplementation(() => Promise.resolve('v1alpha3'))
vi.spyOn(TSutils, 'getTrafficSplitAPIVersion').mockImplementation(
() => Promise.resolve('v1alpha3')
)
}
}
])('$name', async ({fn, setup}) => {
+7 -7
View File
@@ -1,14 +1,14 @@
import {K8sDeleteObject} from '../../types/k8sObject'
import {Kubectl} from '../../types/kubectl'
import {K8sDeleteObject} from '../../types/k8sObject.js'
import {Kubectl} from '../../types/kubectl.js'
import {
BlueGreenDeployment,
BlueGreenManifests,
BlueGreenRejectResult
} from '../../types/blueGreenTypes'
import {deleteGreenObjects, NONE_LABEL_VALUE} from './blueGreenHelper'
import {routeBlueGreenSMI} from './route'
import {cleanupSMI} from './smiBlueGreenHelper'
import {routeBlueGreenIngressUnchanged, routeBlueGreenService} from './route'
} from '../../types/blueGreenTypes.js'
import {deleteGreenObjects, NONE_LABEL_VALUE} from './blueGreenHelper.js'
import {routeBlueGreenSMI} from './route.js'
import {cleanupSMI} from './smiBlueGreenHelper.js'
import {routeBlueGreenIngressUnchanged, routeBlueGreenService} from './route.js'
export async function rejectBlueGreenIngress(
kubectl: Kubectl,
+51 -43
View File
@@ -1,24 +1,28 @@
import {K8sIngress, TrafficSplitObject} from '../../types/k8sObject'
import {Kubectl} from '../../types/kubectl'
import * as fileHelper from '../../utilities/fileUtils'
import * as TSutils from '../../utilities/trafficSplitUtils'
import {RouteStrategy} from '../../types/routeStrategy'
import {BlueGreenManifests} from '../../types/blueGreenTypes'
import {vi} from 'vitest'
import type {MockInstance} from 'vitest'
import {K8sIngress, TrafficSplitObject} from '../../types/k8sObject.js'
import {Kubectl} from '../../types/kubectl.js'
import * as fileHelper from '../../utilities/fileUtils.js'
import * as TSutils from '../../utilities/trafficSplitUtils.js'
import {RouteStrategy} from '../../types/routeStrategy.js'
import {BlueGreenManifests} from '../../types/blueGreenTypes.js'
import {
BLUE_GREEN_VERSION_LABEL,
getManifestObjects,
GREEN_LABEL_VALUE
} from './blueGreenHelper'
} from './blueGreenHelper.js'
import * as bgHelper from './blueGreenHelper.js'
import * as smiHelper from './smiBlueGreenHelper.js'
import {
routeBlueGreenIngress,
routeBlueGreenService,
routeBlueGreenForDeploy,
routeBlueGreenSMI,
routeBlueGreenIngressUnchanged
} from './route'
} from './route.js'
jest.mock('../../types/kubectl')
vi.mock('../../types/kubectl')
const ingressFilepath = ['test/unit/manifests/test-ingress-new.yml']
const kc = new Kubectl('')
@@ -37,16 +41,15 @@ const mockFailureResult = {
describe('route function tests', () => {
let testObjects: BlueGreenManifests
let kubectlApplySpy: jest.SpyInstance
let kubectlApplySpy: MockInstance
beforeEach(() => {
//@ts-ignore
Kubectl.mockClear()
vi.mocked(Kubectl).mockClear()
testObjects = getManifestObjects(ingressFilepath)
kubectlApplySpy = jest.spyOn(kc, 'apply')
jest
.spyOn(fileHelper, 'writeObjectsToFile')
.mockImplementationOnce(() => [''])
kubectlApplySpy = vi.spyOn(kc, 'apply')
vi.spyOn(fileHelper, 'writeObjectsToFile').mockImplementationOnce(() => [
''
])
})
test('correctly prepares blue/green ingresses for deployment', async () => {
@@ -96,9 +99,9 @@ describe('route function tests', () => {
})
test('correctly identifies route pattern and acts accordingly', async () => {
jest
.spyOn(TSutils, 'getTrafficSplitAPIVersion')
.mockImplementation(() => Promise.resolve('v1alpha3'))
vi.spyOn(TSutils, 'getTrafficSplitAPIVersion').mockImplementation(() =>
Promise.resolve('v1alpha3')
)
const ingressResult = await routeBlueGreenForDeploy(
kc,
@@ -164,9 +167,9 @@ describe('route function tests', () => {
testObjects.serviceEntityList
),
setup: () => {
jest
.spyOn(TSutils, 'getTrafficSplitAPIVersion')
.mockImplementation(() => Promise.resolve('v1alpha3'))
vi.spyOn(TSutils, 'getTrafficSplitAPIVersion').mockImplementation(
() => Promise.resolve('v1alpha3')
)
}
},
{
@@ -194,24 +197,23 @@ describe('route timeout tests', () => {
let testObjects: BlueGreenManifests
beforeEach(() => {
//@ts-ignore
Kubectl.mockClear()
vi.mocked(Kubectl).mockClear()
testObjects = getManifestObjects(ingressFilepath)
jest
.spyOn(fileHelper, 'writeObjectsToFile')
.mockImplementationOnce(() => [''])
vi.spyOn(fileHelper, 'writeObjectsToFile').mockImplementationOnce(() => [
''
])
})
afterEach(() => {
jest.restoreAllMocks()
vi.restoreAllMocks()
})
test('routeBlueGreenService with timeout', async () => {
const timeout = '240s'
// Mock deployObjects to capture timeout parameter
const deployObjectsSpy = jest
.spyOn(require('./blueGreenHelper'), 'deployObjects')
const deployObjectsSpy = vi
.spyOn(bgHelper, 'deployObjects')
.mockResolvedValue({
execResult: mockSuccessResult,
manifestFiles: []
@@ -237,23 +239,29 @@ describe('route timeout tests', () => {
test('routeBlueGreenSMI with timeout', async () => {
const timeout = '300s'
jest
.spyOn(TSutils, 'getTrafficSplitAPIVersion')
.mockImplementation(() => Promise.resolve('v1alpha3'))
vi.spyOn(TSutils, 'getTrafficSplitAPIVersion').mockImplementation(() =>
Promise.resolve('v1alpha3')
)
// Mock deployObjects and createTrafficSplitObject to capture timeout parameter
const deployObjectsSpy = jest
.spyOn(require('./blueGreenHelper'), 'deployObjects')
const deployObjectsSpy = vi
.spyOn(bgHelper, 'deployObjects')
.mockResolvedValue({
execResult: mockSuccessResult,
manifestFiles: []
})
const createTrafficSplitSpy = jest
.spyOn(require('./smiBlueGreenHelper'), 'createTrafficSplitObject')
const createTrafficSplitSpy = vi
.spyOn(smiHelper, 'createTrafficSplitObject')
.mockResolvedValue({
metadata: {name: 'nginx-service-trafficsplit'},
spec: {backends: []}
apiVersion: 'split.smi-spec.io/v1alpha3',
kind: 'TrafficSplit',
metadata: {
name: 'nginx-service-trafficsplit',
labels: new Map(),
annotations: new Map()
},
spec: {service: 'nginx-service', backends: []}
})
const value = await routeBlueGreenSMI(
@@ -284,8 +292,8 @@ describe('route timeout tests', () => {
const timeout = '180s'
// Mock deployObjects to capture timeout parameter
const deployObjectsSpy = jest
.spyOn(require('./blueGreenHelper'), 'deployObjects')
const deployObjectsSpy = vi
.spyOn(bgHelper, 'deployObjects')
.mockResolvedValue({
execResult: mockSuccessResult,
manifestFiles: []
@@ -309,8 +317,8 @@ describe('route timeout tests', () => {
})
test('route functions without timeout should pass undefined', async () => {
const deployObjectsSpy = jest
.spyOn(require('./blueGreenHelper'), 'deployObjects')
const deployObjectsSpy = vi
.spyOn(bgHelper, 'deployObjects')
.mockResolvedValue({
execResult: mockSuccessResult,
manifestFiles: []
+10 -10
View File
@@ -1,26 +1,26 @@
import {sleep} from '../../utilities/timeUtils'
import {RouteStrategy} from '../../types/routeStrategy'
import {Kubectl} from '../../types/kubectl'
import {sleep} from '../../utilities/timeUtils.js'
import {RouteStrategy} from '../../types/routeStrategy.js'
import {Kubectl} from '../../types/kubectl.js'
import {
BlueGreenDeployment,
BlueGreenManifests
} from '../../types/blueGreenTypes'
} from '../../types/blueGreenTypes.js'
import {
getManifestObjects,
GREEN_LABEL_VALUE,
deployObjects
} from './blueGreenHelper'
} from './blueGreenHelper.js'
import {
getUpdatedBlueGreenIngress,
isIngressRouted
} from './ingressBlueGreenHelper'
import {getUpdatedBlueGreenService} from './serviceBlueGreenHelper'
import {createTrafficSplitObject} from './smiBlueGreenHelper'
} from './ingressBlueGreenHelper.js'
import {getUpdatedBlueGreenService} from './serviceBlueGreenHelper.js'
import {createTrafficSplitObject} from './smiBlueGreenHelper.js'
import * as core from '@actions/core'
import {K8sObject, TrafficSplitObject} from '../../types/k8sObject'
import {getBufferTime} from '../../inputUtils'
import {K8sObject, TrafficSplitObject} from '../../types/k8sObject.js'
import {getBufferTime} from '../../inputUtils.js'
export async function routeBlueGreenForDeploy(
kubectl: Kubectl,
@@ -1,26 +1,26 @@
import {vi} from 'vitest'
import * as core from '@actions/core'
import {
BLUE_GREEN_VERSION_LABEL,
getManifestObjects,
GREEN_LABEL_VALUE
} from './blueGreenHelper'
import * as bgHelper from './blueGreenHelper'
import {Kubectl} from '../../types/kubectl'
} from './blueGreenHelper.js'
import * as bgHelper from './blueGreenHelper.js'
import {Kubectl} from '../../types/kubectl.js'
import {
getServiceSpecLabel,
getUpdatedBlueGreenService,
validateServicesState
} from './serviceBlueGreenHelper'
} from './serviceBlueGreenHelper.js'
let testObjects
const ingressFilepath = ['test/unit/manifests/test-ingress-new.yml']
jest.mock('../../types/kubectl')
vi.mock('../../types/kubectl')
const kubectl = new Kubectl('')
describe('blue/green service helper tests', () => {
beforeEach(() => {
//@ts-ignore
Kubectl.mockClear()
vi.mocked(Kubectl).mockClear()
testObjects = getManifestObjects(ingressFilepath)
})
@@ -42,7 +42,7 @@ describe('blue/green service helper tests', () => {
mockLabels[BLUE_GREEN_VERSION_LABEL] = bgHelper.GREEN_LABEL_VALUE
const mockSelectors = new Map<string, string>()
mockSelectors[BLUE_GREEN_VERSION_LABEL] = GREEN_LABEL_VALUE
jest.spyOn(bgHelper, 'fetchResource').mockImplementation(() =>
vi.spyOn(bgHelper, 'fetchResource').mockImplementation(() =>
Promise.resolve({
kind: 'Service',
spec: {selector: mockSelectors},
@@ -1,12 +1,12 @@
import * as core from '@actions/core'
import {K8sServiceObject} from '../../types/k8sObject'
import {Kubectl} from '../../types/kubectl'
import {K8sServiceObject} from '../../types/k8sObject.js'
import {Kubectl} from '../../types/kubectl.js'
import {
addBlueGreenLabelsAndAnnotations,
BLUE_GREEN_VERSION_LABEL,
fetchResource,
GREEN_LABEL_VALUE
} from './blueGreenHelper'
} from './blueGreenHelper.js'
// add green labels to configure existing service
export function getUpdatedBlueGreenService(
@@ -1,15 +1,16 @@
import {TrafficSplitObject} from '../../types/k8sObject'
import {Kubectl} from '../../types/kubectl'
import * as fileHelper from '../../utilities/fileUtils'
import * as TSutils from '../../utilities/trafficSplitUtils'
import {vi} from 'vitest'
import {TrafficSplitObject} from '../../types/k8sObject.js'
import {Kubectl} from '../../types/kubectl.js'
import * as fileHelper from '../../utilities/fileUtils.js'
import * as TSutils from '../../utilities/trafficSplitUtils.js'
import {BlueGreenManifests} from '../../types/blueGreenTypes'
import {BlueGreenManifests} from '../../types/blueGreenTypes.js'
import {
BLUE_GREEN_VERSION_LABEL,
getManifestObjects,
GREEN_LABEL_VALUE,
NONE_LABEL_VALUE
} from './blueGreenHelper'
} from './blueGreenHelper.js'
import {
cleanupSMI,
@@ -21,10 +22,10 @@ import {
setupSMI,
TRAFFIC_SPLIT_OBJECT,
validateTrafficSplitsState
} from './smiBlueGreenHelper'
import * as bgHelper from './blueGreenHelper'
} from './smiBlueGreenHelper.js'
import * as bgHelper from './blueGreenHelper.js'
jest.mock('../../types/kubectl')
vi.mock('../../types/kubectl')
const kc = new Kubectl('')
const ingressFilepath = ['test/unit/manifests/test-ingress-new.yml']
@@ -68,21 +69,20 @@ const mockTsObject: TrafficSplitObject = {
describe('SMI Helper tests', () => {
let testObjects: BlueGreenManifests
beforeEach(() => {
//@ts-ignore
Kubectl.mockClear()
vi.mocked(Kubectl).mockClear()
jest
.spyOn(TSutils, 'getTrafficSplitAPIVersion')
.mockImplementation(() => Promise.resolve(''))
vi.spyOn(TSutils, 'getTrafficSplitAPIVersion').mockImplementation(() =>
Promise.resolve('')
)
testObjects = getManifestObjects(ingressFilepath)
jest
.spyOn(fileHelper, 'writeObjectsToFile')
.mockImplementationOnce(() => [''])
vi.spyOn(fileHelper, 'writeObjectsToFile').mockImplementationOnce(() => [
''
])
})
test('setupSMI tests', async () => {
jest.spyOn(kc, 'apply').mockResolvedValue(mockSuccessResult)
vi.spyOn(kc, 'apply').mockResolvedValue(mockSuccessResult)
const smiResults = await setupSMI(kc, testObjects.serviceEntityList)
@@ -174,9 +174,9 @@ describe('SMI Helper tests', () => {
})
test('validateTrafficSplitsState', async () => {
jest
.spyOn(bgHelper, 'fetchResource')
.mockImplementation(() => Promise.resolve(mockTsObject))
vi.spyOn(bgHelper, 'fetchResource').mockImplementation(() =>
Promise.resolve(mockTsObject)
)
let valResult = await validateTrafficSplitsState(
kc,
@@ -187,9 +187,9 @@ describe('SMI Helper tests', () => {
const mockTsCopy = JSON.parse(JSON.stringify(mockTsObject))
mockTsCopy.spec.backends[0].weight = MAX_VAL
jest
.spyOn(bgHelper, 'fetchResource')
.mockImplementation(() => Promise.resolve(mockTsCopy))
vi.spyOn(bgHelper, 'fetchResource').mockImplementation(() =>
Promise.resolve(mockTsCopy)
)
valResult = await validateTrafficSplitsState(
kc,
@@ -197,7 +197,7 @@ describe('SMI Helper tests', () => {
)
expect(valResult).toBe(false)
jest.spyOn(bgHelper, 'fetchResource').mockImplementation()
vi.spyOn(bgHelper, 'fetchResource').mockResolvedValue(null)
valResult = await validateTrafficSplitsState(
kc,
testObjects.serviceEntityList
@@ -218,7 +218,7 @@ describe('SMI Helper tests', () => {
name: 'should throw error when kubectl apply fails during SMI setup',
fn: () => setupSMI(kc, testObjects.serviceEntityList),
setup: () => {
jest.spyOn(kc, 'apply').mockResolvedValue(mockFailureResult)
vi.spyOn(kc, 'apply').mockResolvedValue(mockFailureResult)
}
}
])('$name', async ({fn, setup}) => {
@@ -229,7 +229,7 @@ describe('SMI Helper tests', () => {
// Timeout-specific tests
test('setupSMI with timeout test', async () => {
const deployObjectsSpy = jest
const deployObjectsSpy = vi
.spyOn(bgHelper, 'deployObjects')
.mockResolvedValue({
execResult: mockSuccessResult,
@@ -257,7 +257,7 @@ describe('SMI Helper tests', () => {
})
test('createTrafficSplitObject with timeout test', async () => {
const deleteObjectsSpy = jest
const deleteObjectsSpy = vi
.spyOn(bgHelper, 'deleteObjects')
.mockResolvedValue()
@@ -288,7 +288,7 @@ describe('SMI Helper tests', () => {
})
test('createTrafficSplitObject with GREEN_LABEL_VALUE and timeout test', async () => {
const deleteObjectsSpy = jest
const deleteObjectsSpy = vi
.spyOn(bgHelper, 'deleteObjects')
.mockResolvedValue()
@@ -321,7 +321,7 @@ describe('SMI Helper tests', () => {
})
test('cleanupSMI with timeout test', async () => {
const deleteObjectsSpy = jest
const deleteObjectsSpy = vi
.spyOn(bgHelper, 'deleteObjects')
.mockResolvedValue()
@@ -352,7 +352,7 @@ describe('SMI Helper tests', () => {
})
test('setupSMI without timeout test', async () => {
const deployObjectsSpy = jest
const deployObjectsSpy = vi
.spyOn(bgHelper, 'deployObjects')
.mockResolvedValue({
execResult: mockSuccessResult,
@@ -375,7 +375,7 @@ describe('SMI Helper tests', () => {
})
test('createTrafficSplitObject without timeout test', async () => {
const deleteObjectsSpy = jest
const deleteObjectsSpy = vi
.spyOn(bgHelper, 'deleteObjects')
.mockResolvedValue()
@@ -398,7 +398,7 @@ describe('SMI Helper tests', () => {
})
test('cleanupSMI without timeout test', async () => {
const deleteObjectsSpy = jest
const deleteObjectsSpy = vi
.spyOn(bgHelper, 'deleteObjects')
.mockResolvedValue()
@@ -1,6 +1,6 @@
import * as core from '@actions/core'
import {Kubectl} from '../../types/kubectl'
import * as kubectlUtils from '../../utilities/trafficSplitUtils'
import {Kubectl} from '../../types/kubectl.js'
import * as kubectlUtils from '../../utilities/trafficSplitUtils.js'
import {
deleteObjects,
deployObjects,
@@ -11,15 +11,15 @@ import {
GREEN_SUFFIX,
NONE_LABEL_VALUE,
STABLE_SUFFIX
} from './blueGreenHelper'
import {BlueGreenDeployment} from '../../types/blueGreenTypes'
} from './blueGreenHelper.js'
import {BlueGreenDeployment} from '../../types/blueGreenTypes.js'
import {
K8sDeleteObject,
K8sObject,
TrafficSplitObject
} from '../../types/k8sObject'
import {DeployResult} from '../../types/deployResult'
import {inputAnnotations} from '../../inputUtils'
} from '../../types/k8sObject.js'
import {DeployResult} from '../../types/deployResult.js'
import {inputAnnotations} from '../../inputUtils.js'
export const TRAFFIC_SPLIT_OBJECT_NAME_SUFFIX = '-trafficsplit'
export const TRAFFIC_SPLIT_OBJECT = 'TrafficSplit'
+6 -6
View File
@@ -1,4 +1,4 @@
import {Kubectl} from '../../types/kubectl'
import {Kubectl} from '../../types/kubectl.js'
import * as fs from 'fs'
import * as yaml from 'js-yaml'
import * as core from '@actions/core'
@@ -7,15 +7,15 @@ import {
isDeploymentEntity,
isServiceEntity,
KubernetesWorkload
} from '../../types/kubernetesTypes'
import * as utils from '../../utilities/manifestUpdateUtils'
} from '../../types/kubernetesTypes.js'
import * as utils from '../../utilities/manifestUpdateUtils.js'
import {
updateObjectAnnotations,
updateObjectLabels,
updateSelectorLabels
} from '../../utilities/manifestUpdateUtils'
import {updateSpecLabels} from '../../utilities/manifestSpecLabelUtils'
import {checkForErrors} from '../../utilities/kubectlUtils'
} from '../../utilities/manifestUpdateUtils.js'
import {updateSpecLabels} from '../../utilities/manifestSpecLabelUtils.js'
import {checkForErrors} from '../../utilities/kubectlUtils.js'
export const CANARY_VERSION_LABEL = 'workflow/version'
const BASELINE_SUFFIX = '-baseline'
@@ -1,11 +1,15 @@
import {vi} from 'vitest'
import type {MockInstance} from 'vitest'
vi.mock('@actions/core')
import * as core from '@actions/core'
import {Kubectl} from '../../types/kubectl'
import {Kubectl} from '../../types/kubectl.js'
import {
deployPodCanary,
calculateReplicaCountForCanary
} from './podCanaryHelper'
} from './podCanaryHelper.js'
jest.mock('../../types/kubectl')
vi.mock('../../types/kubectl')
const kc = new Kubectl('')
@@ -35,18 +39,17 @@ const TIMEOUT_300S = '300s'
describe('Pod Canary Helper tests', () => {
let mockFilePaths: string[]
let kubectlApplySpy: jest.SpyInstance
let kubectlApplySpy: MockInstance
beforeEach(() => {
//@ts-ignore
Kubectl.mockClear()
jest.restoreAllMocks()
vi.mocked(Kubectl).mockClear()
vi.restoreAllMocks()
mockFilePaths = testManifestFiles
kubectlApplySpy = jest.spyOn(kc, 'apply')
kubectlApplySpy = vi.spyOn(kc, 'apply')
// Mock core.getInput with default values
jest.spyOn(core, 'getInput').mockImplementation((name: string) => {
vi.spyOn(core, 'getInput').mockImplementation((name: string) => {
switch (name) {
case 'percentage':
return VALID_PERCENTAGE.toString()
@@ -61,7 +64,7 @@ describe('Pod Canary Helper tests', () => {
})
afterEach(() => {
jest.restoreAllMocks()
vi.restoreAllMocks()
kubectlApplySpy.mockClear()
})
@@ -114,7 +117,7 @@ describe('Pod Canary Helper tests', () => {
})
test('should throw error for invalid low percentage', async () => {
jest.spyOn(core, 'getInput').mockImplementation((name: string) => {
vi.spyOn(core, 'getInput').mockImplementation((name: string) => {
if (name === 'percentage') return INVALID_LOW_PERCENTAGE.toString()
return ''
})
@@ -127,7 +130,7 @@ describe('Pod Canary Helper tests', () => {
})
test('should throw error for invalid high percentage', async () => {
jest.spyOn(core, 'getInput').mockImplementation((name: string) => {
vi.spyOn(core, 'getInput').mockImplementation((name: string) => {
if (name === 'percentage') return INVALID_HIGH_PERCENTAGE.toString()
return ''
})
@@ -143,7 +146,7 @@ describe('Pod Canary Helper tests', () => {
kubectlApplySpy.mockResolvedValue(mockSuccessResult)
// Test minimum valid percentage
jest.spyOn(core, 'getInput').mockImplementation((name: string) => {
vi.spyOn(core, 'getInput').mockImplementation((name: string) => {
if (name === 'percentage') return MIN_PERCENTAGE.toString()
return ''
})
@@ -152,7 +155,7 @@ describe('Pod Canary Helper tests', () => {
expect(resultMin.execResult).toEqual(mockSuccessResult)
// Test maximum valid percentage
jest.spyOn(core, 'getInput').mockImplementation((name: string) => {
vi.spyOn(core, 'getInput').mockImplementation((name: string) => {
if (name === 'percentage') return MAX_PERCENTAGE.toString()
return ''
})
@@ -162,7 +165,7 @@ describe('Pod Canary Helper tests', () => {
})
test('should handle force deployment option', async () => {
jest.spyOn(core, 'getInput').mockImplementation((name: string) => {
vi.spyOn(core, 'getInput').mockImplementation((name: string) => {
switch (name) {
case 'percentage':
return VALID_PERCENTAGE.toString()
@@ -186,7 +189,7 @@ describe('Pod Canary Helper tests', () => {
})
test('should handle server-side apply option', async () => {
jest.spyOn(core, 'getInput').mockImplementation((name: string) => {
vi.spyOn(core, 'getInput').mockImplementation((name: string) => {
switch (name) {
case 'percentage':
return VALID_PERCENTAGE.toString()
@@ -1,15 +1,15 @@
import {Kubectl} from '../../types/kubectl'
import {Kubectl} from '../../types/kubectl.js'
import * as core from '@actions/core'
import * as fs from 'fs'
import * as yaml from 'js-yaml'
import * as fileHelper from '../../utilities/fileUtils'
import * as canaryDeploymentHelper from './canaryHelper'
import {isDeploymentEntity} from '../../types/kubernetesTypes'
import {getReplicaCount} from '../../utilities/manifestUpdateUtils'
import {DeployResult} from '../../types/deployResult'
import {K8sObject} from '../../types/k8sObject'
import {checkForErrors} from '../../utilities/kubectlUtils'
import * as fileHelper from '../../utilities/fileUtils.js'
import * as canaryDeploymentHelper from './canaryHelper.js'
import {isDeploymentEntity} from '../../types/kubernetesTypes.js'
import {getReplicaCount} from '../../utilities/manifestUpdateUtils.js'
import {DeployResult} from '../../types/deployResult.js'
import {K8sObject} from '../../types/k8sObject.js'
import {checkForErrors} from '../../utilities/kubectlUtils.js'
export async function deployPodCanary(
filePaths: string[],
@@ -1,13 +1,34 @@
import {vi} from 'vitest'
import type {MockInstance} from 'vitest'
vi.mock('@actions/core', async (importOriginal) => {
const actual: any = await importOriginal()
return {
...actual,
getInput: vi.fn().mockReturnValue(''),
debug: vi.fn(),
info: vi.fn(),
warning: vi.fn(),
error: vi.fn(),
setFailed: vi.fn(),
setOutput: vi.fn(),
group: vi
.fn()
.mockImplementation(
async (_name: string, fn: () => Promise<void>) => await fn()
)
}
})
import * as core from '@actions/core'
import * as fs from 'fs'
import {Kubectl} from '../../types/kubectl'
import {Kubectl} from '../../types/kubectl.js'
import {
deploySMICanary,
redirectTrafficToCanaryDeployment,
redirectTrafficToStableDeployment
} from './smiCanaryHelper'
} from './smiCanaryHelper.js'
jest.mock('../../types/kubectl')
vi.mock('../../types/kubectl')
const kc = new Kubectl('')
@@ -40,22 +61,21 @@ const TIMEOUT_240S = '240s'
describe('SMI Canary Helper tests', () => {
let mockFilePaths: string[]
let kubectlApplySpy: jest.SpyInstance
let kubectlExecuteCommandSpy: jest.SpyInstance
let kubectlApplySpy: MockInstance
let kubectlExecuteCommandSpy: MockInstance
beforeEach(() => {
//@ts-ignore
Kubectl.mockClear()
jest.restoreAllMocks()
vi.mocked(Kubectl).mockClear()
vi.restoreAllMocks()
mockFilePaths = testManifestFiles
kubectlApplySpy = jest.spyOn(kc, 'apply')
kubectlExecuteCommandSpy = jest
kubectlApplySpy = vi.spyOn(kc, 'apply')
kubectlExecuteCommandSpy = vi
.spyOn(kc, 'executeCommand')
.mockResolvedValue(mockExecuteCommandResult)
// Mock core.getInput with default values
jest.spyOn(core, 'getInput').mockImplementation((name: string) => {
vi.spyOn(core, 'getInput').mockImplementation((name: string) => {
switch (name) {
case 'percentage':
return '50'
@@ -72,7 +92,7 @@ describe('SMI Canary Helper tests', () => {
})
afterEach(() => {
jest.restoreAllMocks()
vi.restoreAllMocks()
kubectlApplySpy.mockClear()
})
@@ -106,7 +126,7 @@ describe('SMI Canary Helper tests', () => {
})
test('should handle custom replica count from input', async () => {
jest.spyOn(core, 'getInput').mockImplementation((name: string) => {
vi.spyOn(core, 'getInput').mockImplementation((name: string) => {
switch (name) {
case 'baseline-and-canary-replicas':
return VALID_REPLICA_COUNT.toString()
+13 -10
View File
@@ -1,17 +1,20 @@
import {Kubectl} from '../../types/kubectl'
import {Kubectl} from '../../types/kubectl.js'
import * as core from '@actions/core'
import * as fs from 'fs'
import * as yaml from 'js-yaml'
import * as fileHelper from '../../utilities/fileUtils'
import * as kubectlUtils from '../../utilities/trafficSplitUtils'
import * as canaryDeploymentHelper from './canaryHelper'
import * as podCanaryHelper from './podCanaryHelper'
import {isDeploymentEntity, isServiceEntity} from '../../types/kubernetesTypes'
import {checkForErrors} from '../../utilities/kubectlUtils'
import {inputAnnotations} from '../../inputUtils'
import {DeployResult} from '../../types/deployResult'
import {K8sObject} from '../../types/k8sObject'
import * as fileHelper from '../../utilities/fileUtils.js'
import * as kubectlUtils from '../../utilities/trafficSplitUtils.js'
import * as canaryDeploymentHelper from './canaryHelper.js'
import * as podCanaryHelper from './podCanaryHelper.js'
import {
isDeploymentEntity,
isServiceEntity
} from '../../types/kubernetesTypes.js'
import {checkForErrors} from '../../utilities/kubectlUtils.js'
import {inputAnnotations} from '../../inputUtils.js'
import {DeployResult} from '../../types/deployResult.js'
import {K8sObject} from '../../types/k8sObject.js'
const TRAFFIC_SPLIT_OBJECT_NAME_SUFFIX = '-workflow-rollout'
const TRAFFIC_SPLIT_OBJECT = 'TrafficSplit'
+19 -19
View File
@@ -1,41 +1,41 @@
import * as fs from 'fs'
import * as yaml from 'js-yaml'
import * as canaryDeploymentHelper from './canary/canaryHelper'
import * as models from '../types/kubernetesTypes'
import {isDeploymentEntity} from '../types/kubernetesTypes'
import * as fileHelper from '../utilities/fileUtils'
import * as KubernetesManifestUtility from '../utilities/manifestStabilityUtils'
import {Kubectl, Resource} from '../types/kubectl'
import * as canaryDeploymentHelper from './canary/canaryHelper.js'
import * as models from '../types/kubernetesTypes.js'
import {isDeploymentEntity} from '../types/kubernetesTypes.js'
import * as fileHelper from '../utilities/fileUtils.js'
import * as KubernetesManifestUtility from '../utilities/manifestStabilityUtils.js'
import {Kubectl, Resource} from '../types/kubectl.js'
import {deployPodCanary} from './canary/podCanaryHelper'
import {deploySMICanary} from './canary/smiCanaryHelper'
import {DeploymentConfig} from '../types/deploymentConfig'
import {deployBlueGreen} from './blueGreen/deploy'
import {DeploymentStrategy} from '../types/deploymentStrategy'
import {deployPodCanary} from './canary/podCanaryHelper.js'
import {deploySMICanary} from './canary/smiCanaryHelper.js'
import {DeploymentConfig} from '../types/deploymentConfig.js'
import {deployBlueGreen} from './blueGreen/deploy.js'
import {DeploymentStrategy} from '../types/deploymentStrategy.js'
import * as core from '@actions/core'
import {
parseTrafficSplitMethod,
TrafficSplitMethod
} from '../types/trafficSplitMethod'
import {parseRouteStrategy} from '../types/routeStrategy'
} from '../types/trafficSplitMethod.js'
import {parseRouteStrategy} from '../types/routeStrategy.js'
import {ExecOutput} from '@actions/exec'
import {
getWorkflowAnnotationKeyLabel,
getWorkflowAnnotations,
cleanLabel
} from '../utilities/workflowAnnotationUtils'
} from '../utilities/workflowAnnotationUtils.js'
import {
annotateChildPods,
checkForErrors,
getLastSuccessfulRunSha
} from '../utilities/kubectlUtils'
} from '../utilities/kubectlUtils.js'
import {
getWorkflowFilePath,
normalizeWorkflowStrLabel
} from '../utilities/githubUtils'
import {getDeploymentConfig} from '../utilities/dockerUtils'
import {DeployResult} from '../types/deployResult'
import {ClusterType} from '../inputUtils'
} from '../utilities/githubUtils.js'
import {getDeploymentConfig} from '../utilities/dockerUtils.js'
import {DeployResult} from '../types/deployResult.js'
import {ClusterType} from '../inputUtils.js'
export async function deployManifests(
files: string[],
+1 -1
View File
@@ -1,4 +1,4 @@
import {Action, parseAction} from './action'
import {Action, parseAction} from './action.js'
describe('Action type', () => {
test('it has required values', () => {
+2 -2
View File
@@ -1,5 +1,5 @@
import {DeployResult} from './deployResult'
import {K8sObject, K8sDeleteObject} from './k8sObject'
import {DeployResult} from './deployResult.js'
import {K8sObject, K8sDeleteObject} from './k8sObject.js'
export interface BlueGreenDeployment {
deployResult: DeployResult
+4 -1
View File
@@ -1,4 +1,7 @@
import {DeploymentStrategy, parseDeploymentStrategy} from './deploymentStrategy'
import {
DeploymentStrategy,
parseDeploymentStrategy
} from './deploymentStrategy.js'
describe('Deployment strategy type', () => {
test('it has required values', () => {
+7 -4
View File
@@ -1,4 +1,7 @@
import {DockerExec} from './docker'
import {vi} from 'vitest'
vi.mock('@actions/exec')
import {DockerExec} from './docker.js'
import * as actions from '@actions/exec'
const dockerPath = 'dockerPath'
@@ -12,7 +15,7 @@ describe('Docker class', () => {
const execReturn = {exitCode: 0, stdout: 'Output', stderr: ''}
beforeEach(() => {
jest.spyOn(actions, 'getExecOutput').mockImplementation(async () => {
vi.spyOn(actions, 'getExecOutput').mockImplementation(async () => {
return execReturn
})
})
@@ -60,7 +63,7 @@ describe('Docker class', () => {
const execReturn = {exitCode: 3, stdout: '', stderr: ''}
beforeEach(() => {
jest.spyOn(actions, 'getExecOutput').mockImplementation(async () => {
vi.spyOn(actions, 'getExecOutput').mockImplementation(async () => {
return execReturn
})
})
@@ -80,7 +83,7 @@ describe('Docker class', () => {
const execReturn = {exitCode: 0, stdout: '', stderr: 'Output'}
beforeEach(() => {
jest.spyOn(actions, 'getExecOutput').mockImplementation(async () => {
vi.spyOn(actions, 'getExecOutput').mockImplementation(async () => {
return execReturn
})
})
+18 -12
View File
@@ -1,4 +1,10 @@
import {getKubectlPath, Kubectl} from './kubectl'
import {vi} from 'vitest'
vi.mock('@actions/exec')
vi.mock('@actions/io')
vi.mock('@actions/core')
vi.mock('@actions/tool-cache')
import {getKubectlPath, Kubectl} from './kubectl.js'
import * as exec from '@actions/exec'
import * as io from '@actions/io'
import * as core from '@actions/core'
@@ -9,27 +15,27 @@ describe('Kubectl path', () => {
const path = 'path'
it('gets the kubectl path', async () => {
jest.spyOn(core, 'getInput').mockImplementationOnce(() => '')
jest.spyOn(io, 'which').mockImplementationOnce(async () => path)
vi.spyOn(core, 'getInput').mockImplementationOnce(() => '')
vi.spyOn(io, 'which').mockImplementationOnce(async () => path)
expect(await getKubectlPath()).toBe(path)
})
it('gets the kubectl path with version', async () => {
jest.spyOn(core, 'getInput').mockImplementationOnce(() => version)
jest.spyOn(toolCache, 'find').mockImplementationOnce(() => path)
vi.spyOn(core, 'getInput').mockImplementationOnce(() => version)
vi.spyOn(toolCache, 'find').mockImplementationOnce(() => path)
expect(await getKubectlPath()).toBe(path)
})
it('throws if kubectl not found', async () => {
// without version
jest.spyOn(io, 'which').mockImplementationOnce(async () => '')
vi.spyOn(io, 'which').mockImplementationOnce(async () => '')
await expect(() => getKubectlPath()).rejects.toThrow()
// with verision
jest.spyOn(core, 'getInput').mockImplementationOnce(() => '')
jest.spyOn(io, 'which').mockImplementationOnce(async () => '')
vi.spyOn(core, 'getInput').mockImplementationOnce(() => '')
vi.spyOn(io, 'which').mockImplementationOnce(async () => '')
await expect(() => getKubectlPath()).rejects.toThrow()
})
})
@@ -46,7 +52,7 @@ describe('Kubectl class', () => {
const mockExecReturn = {exitCode: 0, stdout: 'Output', stderr: ''}
beforeEach(() => {
jest.spyOn(exec, 'getExecOutput').mockImplementation(async () => {
vi.spyOn(exec, 'getExecOutput').mockImplementation(async () => {
return mockExecReturn
})
})
@@ -637,7 +643,7 @@ describe('Kubectl class', () => {
stderr: ''
}
jest.spyOn(exec, 'getExecOutput').mockImplementationOnce(async () => {
vi.spyOn(exec, 'getExecOutput').mockImplementationOnce(async () => {
return describeReturn
})
@@ -650,7 +656,7 @@ describe('Kubectl class', () => {
const skipTls = true
const kubectl = new Kubectl(kubectlPath, testNamespace, skipTls)
jest.spyOn(exec, 'getExecOutput').mockImplementation(async () => {
vi.spyOn(exec, 'getExecOutput').mockImplementation(async () => {
return {exitCode: 0, stderr: '', stdout: ''}
})
@@ -677,7 +683,7 @@ describe('Kubectl namespace handling', () => {
const execReturn = {exitCode: 0, stdout: 'Output', stderr: ''}
beforeEach(() => {
jest.spyOn(exec, 'getExecOutput').mockResolvedValue(execReturn)
vi.spyOn(exec, 'getExecOutput').mockResolvedValue(execReturn)
})
const runApply = async (namespace?: string) => {
+6 -2
View File
@@ -1,5 +1,5 @@
import {ExecOutput, getExecOutput} from '@actions/exec'
import {createInlineArray} from '../utilities/arrayUtils'
import {createInlineArray} from '../utilities/arrayUtils.js'
import * as core from '@actions/core'
import * as toolCache from '@actions/tool-cache'
import * as io from '@actions/io'
@@ -238,13 +238,17 @@ export class Kubectl {
})
}
public getNamespace(namespaceOverride?: string): string {
return namespaceOverride || this.namespace
}
protected getFlags(namespaceOverride?: string): string[] {
const flags = []
if (this.ignoreSSLErrors) {
flags.push('--insecure-skip-tls-verify')
}
const ns = namespaceOverride || this.namespace
const ns = this.getNamespace(namespaceOverride)
if (ns) {
flags.push('--namespace', ns)
}
+1 -1
View File
@@ -10,7 +10,7 @@ import {
ServiceTypes,
WORKLOAD_TYPES,
WORKLOAD_TYPES_WITH_ROLLOUT_STATUS
} from './kubernetesTypes'
} from './kubernetesTypes.js'
describe('Kubernetes types', () => {
it('contains kubernetes workloads', () => {
+9 -6
View File
@@ -1,10 +1,13 @@
import * as fileUtils from '../utilities/fileUtils'
import {vi} from 'vitest'
vi.mock('@actions/exec')
import * as fileUtils from '../utilities/fileUtils.js'
import fs from 'node:fs'
import {
PrivateKubectl,
extractFileNames,
replaceFileNamesWithShallowNamesRelativeToTemp
} from './privatekubectl'
} from './privatekubectl.js'
import * as exec from '@actions/exec'
describe('Private kubectl', () => {
@@ -17,14 +20,14 @@ describe('Private kubectl', () => {
'resourceName'
)
const spy = jest
const spy = vi
.spyOn(fileUtils, 'getTempDirectory')
.mockImplementation(() => {
return '/tmp'
})
jest.spyOn(fs, 'writeFileSync').mockImplementation(() => {})
jest.spyOn(fs, 'readFileSync').mockImplementation((filename) => {
vi.spyOn(fs, 'writeFileSync').mockImplementation(() => {})
vi.spyOn(fs, 'readFileSync').mockImplementation((filename) => {
return 'test contents'
})
@@ -48,7 +51,7 @@ describe('Private kubectl', () => {
test('Should throw well defined Error on error from Azure', async () => {
const errorMsg = 'An error message'
jest.spyOn(exec, 'getExecOutput').mockImplementation(async () => {
vi.spyOn(exec, 'getExecOutput').mockImplementation(async () => {
return {exitCode: 1, stdout: '', stderr: errorMsg}
})
+2 -2
View File
@@ -1,10 +1,10 @@
import {Kubectl} from './kubectl'
import {Kubectl} from './kubectl.js'
import minimist from 'minimist'
import {ExecOptions, ExecOutput, getExecOutput} from '@actions/exec'
import * as core from '@actions/core'
import fs from 'node:fs'
import * as path from 'path'
import {getTempDirectory} from '../utilities/fileUtils'
import {getTempDirectory} from '../utilities/fileUtils.js'
export class PrivateKubectl extends Kubectl {
protected async execute(args: string[], silent: boolean = false) {
+1 -1
View File
@@ -1,4 +1,4 @@
import {parseRouteStrategy, RouteStrategy} from './routeStrategy'
import {parseRouteStrategy, RouteStrategy} from './routeStrategy.js'
describe('Route strategy type', () => {
test('it has required values', () => {
+4 -1
View File
@@ -1,4 +1,7 @@
import {parseTrafficSplitMethod, TrafficSplitMethod} from './trafficSplitMethod'
import {
parseTrafficSplitMethod,
TrafficSplitMethod
} from './trafficSplitMethod.js'
describe('Traffic split method type', () => {
test('it has required values', () => {
+1 -1
View File
@@ -1,4 +1,4 @@
import {createInlineArray} from './arrayUtils'
import {createInlineArray} from './arrayUtils.js'
describe('array utilities', () => {
it('creates an inline array', () => {
+6 -3
View File
@@ -1,15 +1,18 @@
import {vi} from 'vitest'
vi.mock('@actions/io')
import * as io from '@actions/io'
import {checkDockerPath} from './dockerUtils'
import {checkDockerPath} from './dockerUtils.js'
describe('docker utilities', () => {
it('checks if docker is installed', async () => {
// docker installed
const path = 'path'
jest.spyOn(io, 'which').mockImplementationOnce(async () => path)
vi.spyOn(io, 'which').mockImplementationOnce(async () => path)
expect(() => checkDockerPath()).not.toThrow()
// docker not installed
jest.spyOn(io, 'which').mockImplementationOnce(async () => {
vi.spyOn(io, 'which').mockImplementationOnce(async () => {
throw new Error('not found')
})
await expect(() => checkDockerPath()).rejects.toThrow()
+3 -3
View File
@@ -1,8 +1,8 @@
import * as io from '@actions/io'
import {DeploymentConfig} from '../types/deploymentConfig'
import {DeploymentConfig} from '../types/deploymentConfig.js'
import * as core from '@actions/core'
import {DockerExec} from '../types/docker'
import {getNormalizedPath} from './githubUtils'
import {DockerExec} from '../types/docker.js'
import {getNormalizedPath} from './githubUtils.js'
export async function getDeploymentConfig(): Promise<DeploymentConfig> {
let helmChartPaths: string[] =
+6 -5
View File
@@ -1,9 +1,10 @@
import {parseDuration} from './durationUtils'
import {vi, type Mocked} from 'vitest'
import {parseDuration} from './durationUtils.js'
import * as core from '@actions/core'
// Mock core.debug
jest.mock('@actions/core')
const mockCore = core as jest.Mocked<typeof core>
vi.mock('@actions/core')
const mockCore = core as Mocked<typeof core>
// Test data constants
const VALID_TIMEOUTS = {
@@ -46,7 +47,7 @@ const expectInvalidTimeout = (input: string, expectedError: string) => {
describe('validateTimeoutDuration', () => {
beforeEach(() => {
jest.clearAllMocks()
vi.clearAllMocks()
})
describe('valid timeout formats', () => {
@@ -90,7 +91,7 @@ describe('validateTimeoutDuration', () => {
'No unit specified for timeout "5", assuming minutes'
)
jest.clearAllMocks()
vi.clearAllMocks()
parseDuration('30s')
expect(mockCore.debug).not.toHaveBeenCalled()
+6 -5
View File
@@ -1,9 +1,10 @@
import * as fileUtils from './fileUtils'
import {vi} from 'vitest'
import * as fileUtils from './fileUtils.js'
import * as yaml from 'js-yaml'
import fs from 'node:fs'
import * as path from 'path'
import {K8sObject} from '../types/k8sObject'
import {K8sObject} from '../types/k8sObject.js'
const sampleYamlUrl =
'https://raw.githubusercontent.com/kubernetes/website/main/content/en/examples/controllers/nginx-deployment.yaml'
@@ -69,7 +70,7 @@ describe('File utils', () => {
'manifest_test_dir'
)
expect(
await expect(
fileUtils.getFilesFromDirectoriesAndURLs([badPath, goodPath])
).rejects.toThrow()
})
@@ -108,8 +109,8 @@ describe('File utils', () => {
describe('moving files to temp', () => {
it('correctly moves the contents of a file to the temporary directory', () => {
jest.spyOn(fs, 'writeFileSync').mockImplementation(() => {})
jest.spyOn(fs, 'readFileSync').mockImplementation((filename) => {
vi.spyOn(fs, 'writeFileSync').mockImplementation(() => {})
vi.spyOn(fs, 'readFileSync').mockImplementation((filename) => {
return 'test contents'
})
const originalFilePath = path.join('path', 'in', 'repo')
+4 -4
View File
@@ -4,10 +4,10 @@ import * as path from 'path'
import * as core from '@actions/core'
import * as os from 'os'
import * as yaml from 'js-yaml'
import {Errorable, succeeded, failed, Failed} from '../types/errorable'
import {getCurrentTime} from './timeUtils'
import {isHttpUrl} from './githubUtils'
import {K8sObject} from '../types/k8sObject'
import {Errorable, succeeded, failed, Failed} from '../types/errorable.js'
import {getCurrentTime} from './timeUtils.js'
import {isHttpUrl} from './githubUtils.js'
import {K8sObject} from '../types/k8sObject.js'
export const urlFileKind = 'urlfile'
+1 -1
View File
@@ -2,7 +2,7 @@ import {
getNormalizedPath,
isHttpUrl,
normalizeWorkflowStrLabel
} from './githubUtils'
} from './githubUtils.js'
describe('Github utils', () => {
it('normalizes workflow string labels', () => {
+1 -1
View File
@@ -1,4 +1,4 @@
import {GitHubClient, OkStatusCode} from '../types/githubClient'
import {GitHubClient, OkStatusCode} from '../types/githubClient.js'
import * as core from '@actions/core'
export async function getWorkflowFilePath(
+6 -2
View File
@@ -1,6 +1,9 @@
import {vi} from 'vitest'
vi.mock('@actions/core')
import * as core from '@actions/core'
import {ExecOutput} from '@actions/exec'
import {checkForErrors} from './kubectlUtils'
import {checkForErrors} from './kubectlUtils.js'
describe('Kubectl utils', () => {
it('checks for errors', () => {
@@ -39,7 +42,8 @@ describe('Kubectl utils', () => {
).toThrow()
// with warn behavior
jest.spyOn(core, 'warning').mockImplementation(() => {})
const warnSpy = vi.spyOn(core, 'warning').mockImplementation(() => {})
warnSpy.mockClear()
let warningCalls = 0
expect(() => checkForErrors([success], true)).not.toThrow()
expect(core.warning).toHaveBeenCalledTimes(warningCalls)
+1 -1
View File
@@ -1,6 +1,6 @@
import * as core from '@actions/core'
import {ExecOutput} from '@actions/exec'
import {Kubectl} from '../types/kubectl'
import {Kubectl} from '../types/kubectl.js'
const NAMESPACE = 'namespace'
+1 -1
View File
@@ -1,4 +1,4 @@
import {KubernetesWorkload} from '../types/kubernetesTypes'
import {KubernetesWorkload} from '../types/kubernetesTypes.js'
export function getImagePullSecrets(inputObject: any) {
const kind = inputObject?.kind?.toLowerCase()
+1 -1
View File
@@ -3,7 +3,7 @@ import {
isServiceEntity,
KubernetesWorkload,
NullInputObjectError
} from '../types/kubernetesTypes'
} from '../types/kubernetesTypes.js'
export function updateSpecLabels(
inputObject: any,
+106 -45
View File
@@ -1,10 +1,29 @@
import * as manifestStabilityUtils from './manifestStabilityUtils'
import {Kubectl} from '../types/kubectl'
import {ResourceTypeFleet, ResourceTypeManagedCluster} from '../actions/deploy'
import {vi} from 'vitest'
import type {MockInstance} from 'vitest'
vi.mock('@actions/core', async (importOriginal) => {
const actual: any = await importOriginal()
return {
...actual,
getInput: vi.fn().mockReturnValue(''),
debug: vi.fn(),
info: vi.fn(),
warning: vi.fn(),
error: vi.fn(),
setFailed: vi.fn(),
setOutput: vi.fn()
}
})
import * as manifestStabilityUtils from './manifestStabilityUtils.js'
import {Kubectl} from '../types/kubectl.js'
import {
ResourceTypeFleet,
ResourceTypeManagedCluster
} from '../actions/deploy.js'
import {ExecOutput} from '@actions/exec'
import {exitCode, stdout} from 'process'
import * as core from '@actions/core'
import * as timeUtils from './timeUtils'
import * as timeUtils from './timeUtils.js'
describe('manifestStabilityUtils', () => {
const kc = new Kubectl('')
@@ -17,8 +36,8 @@ describe('manifestStabilityUtils', () => {
]
it('should return immediately if the resource type is fleet', async () => {
const spy = jest.spyOn(manifestStabilityUtils, 'checkManifestStability')
const checkRolloutStatusSpy = jest.spyOn(kc, 'checkRolloutStatus')
const spy = vi.spyOn(manifestStabilityUtils, 'checkManifestStability')
const checkRolloutStatusSpy = vi.spyOn(kc, 'checkRolloutStatus')
await manifestStabilityUtils.checkManifestStability(
kc,
resources,
@@ -30,8 +49,8 @@ describe('manifestStabilityUtils', () => {
})
it('should run fully if the resource type is managedCluster', async () => {
const spy = jest.spyOn(manifestStabilityUtils, 'checkManifestStability')
const checkRolloutStatusSpy = jest
const spy = vi.spyOn(manifestStabilityUtils, 'checkManifestStability')
const checkRolloutStatusSpy = vi
.spyOn(kc, 'checkRolloutStatus')
.mockImplementation(() => {
return new Promise<ExecOutput>((resolve, reject) => {
@@ -54,7 +73,7 @@ describe('manifestStabilityUtils', () => {
it('should pass timeout to checkRolloutStatus when provided', async () => {
const timeout = '300s'
const checkRolloutStatusSpy = jest
const checkRolloutStatusSpy = vi
.spyOn(kc, 'checkRolloutStatus')
.mockImplementation(() => {
return new Promise<ExecOutput>((resolve, reject) => {
@@ -82,7 +101,7 @@ describe('manifestStabilityUtils', () => {
})
it('should call checkRolloutStatus without timeout when not provided', async () => {
const checkRolloutStatusSpy = jest
const checkRolloutStatusSpy = vi
.spyOn(kc, 'checkRolloutStatus')
.mockImplementation(() => {
return new Promise<ExecOutput>((resolve, reject) => {
@@ -111,34 +130,76 @@ describe('manifestStabilityUtils', () => {
describe('checkManifestStability failure and resource-specific scenarios', () => {
let kc: Kubectl
let coreErrorSpy: jest.SpyInstance
let coreInfoSpy: jest.SpyInstance
let coreWarningSpy: jest.SpyInstance
let coreErrorSpy: MockInstance
let coreInfoSpy: MockInstance
let coreWarningSpy: MockInstance
beforeEach(() => {
kc = new Kubectl('')
coreErrorSpy = jest.spyOn(core, 'error').mockImplementation()
coreInfoSpy = jest.spyOn(core, 'info').mockImplementation()
coreWarningSpy = jest.spyOn(core, 'warning').mockImplementation()
kc = new Kubectl('', 'default')
coreErrorSpy = vi.spyOn(core, 'error').mockImplementation(() => {})
coreInfoSpy = vi.spyOn(core, 'info').mockImplementation(() => {})
coreWarningSpy = vi.spyOn(core, 'warning').mockImplementation(() => {})
})
afterEach(() => {
jest.restoreAllMocks()
vi.restoreAllMocks()
})
it('should call describe and collect errors when a rollout fails', async () => {
const resources = [
{type: 'deployment', name: 'failing-app', namespace: 'default'}
{type: 'deployment', name: 'failing-app', namespace: 'app-ns-123'}
]
const rolloutError = new Error('Progress deadline exceeded')
const describeOutput =
'Events:\n Type\tReason\tMessage\n Normal\tScalingReplicaSet\tScaled up replica set failing-app-123 to 1'
// Arrange: Mock rollout to fail and describe to succeed
const checkRolloutStatusSpy = jest
const checkRolloutStatusSpy = vi
.spyOn(kc, 'checkRolloutStatus')
.mockRejectedValue(rolloutError)
const describeSpy = jest.spyOn(kc, 'describe').mockResolvedValue({
const describeSpy = vi.spyOn(kc, 'describe').mockResolvedValue({
stdout: describeOutput,
stderr: '',
exitCode: 0
})
// Act & Assert: Expect the function to throw the final aggregated error
const expectedErrorMessage = `Rollout failed for deployment/failing-app in namespace app-ns-123: ${rolloutError.message}`
await expect(
manifestStabilityUtils.checkManifestStability(
kc,
resources,
ResourceTypeManagedCluster
)
).rejects.toThrow(
`Rollout status failed for the following resources:\n${expectedErrorMessage}`
)
// Assert that the correct functions were called
expect(checkRolloutStatusSpy).toHaveBeenCalledTimes(1)
expect(coreErrorSpy).toHaveBeenCalledWith(expectedErrorMessage)
expect(describeSpy).toHaveBeenCalledWith(
'deployment',
'failing-app',
false,
'app-ns-123'
)
expect(coreInfoSpy).toHaveBeenCalledWith(
`Describe output for deployment/failing-app:\n${describeOutput}`
)
})
it('should use the default kubectl namespace when none is provided', async () => {
const resources = [{type: 'deployment', name: 'failing-app'}]
const rolloutError = new Error('Progress deadline exceeded')
const describeOutput =
'Events:\n Type\tReason\tMessage\n Normal\tScalingReplicaSet\tScaled up replica set failing-app-123 to 1'
// Arrange: Mock rollout to fail and describe to succeed
const checkRolloutStatusSpy = vi
.spyOn(kc, 'checkRolloutStatus')
.mockRejectedValue(rolloutError)
const describeSpy = vi.spyOn(kc, 'describe').mockResolvedValue({
stdout: describeOutput,
stderr: '',
exitCode: 0
@@ -163,7 +224,7 @@ describe('checkManifestStability failure and resource-specific scenarios', () =>
'deployment',
'failing-app',
false,
'default'
undefined
)
expect(coreInfoSpy).toHaveBeenCalledWith(
`Describe output for deployment/failing-app:\n${describeOutput}`
@@ -174,10 +235,10 @@ describe('checkManifestStability failure and resource-specific scenarios', () =>
const resources = [{type: 'Pod', name: 'test-pod', namespace: 'default'}]
// Arrange: Spy on checkPodStatus and checkRolloutStatus
const checkPodStatusSpy = jest
const checkPodStatusSpy = vi
.spyOn(manifestStabilityUtils, 'checkPodStatus')
.mockResolvedValue() // Assume pod becomes ready
const checkRolloutStatusSpy = jest.spyOn(kc, 'checkRolloutStatus')
const checkRolloutStatusSpy = vi.spyOn(kc, 'checkRolloutStatus')
// Act
await manifestStabilityUtils.checkManifestStability(
@@ -198,10 +259,10 @@ describe('checkManifestStability failure and resource-specific scenarios', () =>
const podError = new Error('Pod rollout failed')
// Arrange: Mock checkPodStatus to fail
const checkPodStatusSpy = jest
const checkPodStatusSpy = vi
.spyOn(manifestStabilityUtils, 'checkPodStatus')
.mockRejectedValue(podError)
const describeSpy = jest.spyOn(kc, 'describe').mockResolvedValue({
const describeSpy = vi.spyOn(kc, 'describe').mockResolvedValue({
stdout: 'describe output',
stderr: '',
exitCode: 0
@@ -229,7 +290,7 @@ describe('checkManifestStability failure and resource-specific scenarios', () =>
it('should wait for external IP for a LoadBalancer service', async () => {
//Spying on sleep to avoid actual delays in tests
jest.spyOn(timeUtils, 'sleep').mockResolvedValue(undefined)
vi.spyOn(timeUtils, 'sleep').mockResolvedValue(undefined)
const resources = [
{type: 'service', name: 'test-svc', namespace: 'default'}
]
@@ -243,7 +304,7 @@ describe('checkManifestStability failure and resource-specific scenarios', () =>
}
// Arrange: Mock getResource to simulate the IP being assigned on the second poll
const getResourceSpy = jest
const getResourceSpy = vi
.spyOn(kc, 'getResource')
// First call: Initial service check
.mockResolvedValueOnce({
@@ -286,10 +347,10 @@ describe('checkManifestStability failure and resource-specific scenarios', () =>
// Arrange: Mock getService to fail, and describe to succeed
// Note: We mock getResource because getService is a private helper
const getResourceSpy = jest
const getResourceSpy = vi
.spyOn(kc, 'getResource')
.mockRejectedValue(getServiceError)
const describeSpy = jest.spyOn(kc, 'describe').mockResolvedValue({
const describeSpy = vi.spyOn(kc, 'describe').mockResolvedValue({
stdout: 'describe output',
stderr: '',
exitCode: 0
@@ -327,7 +388,7 @@ describe('checkManifestStability failure and resource-specific scenarios', () =>
}
// Arrange
const getResourceSpy = jest.spyOn(kc, 'getResource').mockResolvedValue({
const getResourceSpy = vi.spyOn(kc, 'getResource').mockResolvedValue({
stdout: JSON.stringify(clusterIpService),
stderr: '',
exitCode: 0
@@ -350,19 +411,19 @@ describe('checkManifestStability failure and resource-specific scenarios', () =>
describe('checkManifestStability additional scenarios', () => {
let kc: Kubectl
let coreErrorSpy: jest.SpyInstance
let coreInfoSpy: jest.SpyInstance
let coreWarningSpy: jest.SpyInstance
let coreErrorSpy: MockInstance
let coreInfoSpy: MockInstance
let coreWarningSpy: MockInstance
beforeEach(() => {
kc = new Kubectl('')
coreErrorSpy = jest.spyOn(core, 'error').mockImplementation()
coreInfoSpy = jest.spyOn(core, 'info').mockImplementation()
coreWarningSpy = jest.spyOn(core, 'warning').mockImplementation()
coreErrorSpy = vi.spyOn(core, 'error').mockImplementation(() => {})
coreInfoSpy = vi.spyOn(core, 'info').mockImplementation(() => {})
coreWarningSpy = vi.spyOn(core, 'warning').mockImplementation(() => {})
})
afterEach(() => {
jest.restoreAllMocks()
vi.restoreAllMocks()
})
it('should aggregate errors from deployment and pod failures', async () => {
@@ -374,15 +435,15 @@ describe('checkManifestStability additional scenarios', () => {
const podError = new Error('Pod not ready in time')
// Arrange: Mock failures
const checkRolloutStatusSpy = jest
const checkRolloutStatusSpy = vi
.spyOn(kc, 'checkRolloutStatus')
.mockRejectedValue(deploymentError)
// For pod: simulate a pod check failure
const checkPodStatusSpy = jest
const checkPodStatusSpy = vi
.spyOn(manifestStabilityUtils, 'checkPodStatus')
.mockRejectedValue(podError)
// For both, simulate a successful describe call to provide additional details
const describeSpy = jest.spyOn(kc, 'describe').mockResolvedValue({
const describeSpy = vi.spyOn(kc, 'describe').mockResolvedValue({
stdout: 'describe aggregated output',
stderr: '',
exitCode: 0
@@ -421,25 +482,25 @@ describe('checkManifestStability additional scenarios', () => {
// Arrange:
// Deployment rollout succeeds
jest.spyOn(kc, 'checkRolloutStatus').mockResolvedValue({
vi.spyOn(kc, 'checkRolloutStatus').mockResolvedValue({
exitCode: 0,
stderr: '',
stdout: ''
})
// Pod becomes ready
jest.spyOn(manifestStabilityUtils, 'checkPodStatus').mockResolvedValue()
vi.spyOn(manifestStabilityUtils, 'checkPodStatus').mockResolvedValue()
// Simulate a LoadBalancer service that already has an external IP
const stableService = {
spec: {type: 'LoadBalancer'},
status: {loadBalancer: {ingress: [{ip: '1.2.3.4'}]}}
}
jest.spyOn(kc, 'getResource').mockResolvedValue({
vi.spyOn(kc, 'getResource').mockResolvedValue({
stdout: JSON.stringify(stableService),
stderr: '',
exitCode: 0
})
// Provide a describe result to avoid warnings
jest.spyOn(kc, 'describe').mockResolvedValue({
vi.spyOn(kc, 'describe').mockResolvedValue({
stdout: 'describe output stable',
stderr: '',
exitCode: 0
+8 -8
View File
@@ -1,10 +1,10 @@
import * as core from '@actions/core'
import * as KubernetesConstants from '../types/kubernetesTypes'
import {Kubectl, Resource} from '../types/kubectl'
import {checkForErrors} from './kubectlUtils'
import {sleep} from './timeUtils'
import {ResourceTypeFleet} from '../actions/deploy'
import {ClusterType} from '../inputUtils'
import * as KubernetesConstants from '../types/kubernetesTypes.js'
import {Kubectl, Resource} from '../types/kubectl.js'
import {checkForErrors} from './kubectlUtils.js'
import {sleep} from './timeUtils.js'
import {ResourceTypeFleet} from '../actions/deploy.js'
import {ClusterType} from '../inputUtils.js'
const IS_SILENT = false
const POD = 'pod'
@@ -46,7 +46,7 @@ export async function checkManifestStability(
)
checkForErrors([result])
} catch (ex) {
const errorMessage = `Rollout failed for ${resource.type}/${resource.name} in namespace ${resource.namespace}: ${ex.message || ex}`
const errorMessage = `Rollout failed for ${resource.type}/${resource.name} in namespace ${kubectl.getNamespace(resource.namespace)}: ${ex.message || ex}`
core.error(errorMessage)
rolloutErrors.push(errorMessage)
@@ -106,7 +106,7 @@ export async function checkManifestStability(
}
}
} catch (ex) {
const errorMessage = `Could not determine service status of: ${resource.name} in namespace ${resource.namespace}. Error: ${ex.message || ex}`
const errorMessage = `Could not determine service status of: ${resource.name} in namespace ${kubectl.getNamespace(resource.namespace)}. Error: ${ex.message || ex}`
core.warning(errorMessage)
try {
+8 -5
View File
@@ -1,14 +1,17 @@
import * as fileUtils from './fileUtils'
import * as manifestUpdateUtils from './manifestUpdateUtils'
import {vi} from 'vitest'
vi.mock('fs')
import * as fileUtils from './fileUtils.js'
import * as manifestUpdateUtils from './manifestUpdateUtils.js'
import * as path from 'path'
import * as fs from 'fs'
describe('manifestUpdateUtils', () => {
jest.spyOn(fileUtils, 'moveFileToTmpDir').mockImplementation((filename) => {
vi.spyOn(fileUtils, 'moveFileToTmpDir').mockImplementation((filename) => {
return path.join('/tmp', filename)
})
jest.spyOn(fs, 'writeFileSync').mockImplementation(() => {})
jest.spyOn(fs, 'readFileSync').mockImplementation((filename) => {
vi.spyOn(fs, 'writeFileSync').mockImplementation(() => {})
vi.spyOn(fs, 'readFileSync').mockImplementation((filename) => {
return 'test contents'
})
+7 -7
View File
@@ -2,25 +2,25 @@ import * as core from '@actions/core'
import * as fs from 'fs'
import * as yaml from 'js-yaml'
import * as path from 'path'
import * as fileHelper from './fileUtils'
import {moveFileToTmpDir} from './fileUtils'
import * as fileHelper from './fileUtils.js'
import {moveFileToTmpDir} from './fileUtils.js'
import {
InputObjectKindNotDefinedError,
InputObjectMetadataNotDefinedError,
isWorkloadEntity,
KubernetesWorkload,
NullInputObjectError
} from '../types/kubernetesTypes'
} from '../types/kubernetesTypes.js'
import {
getSpecSelectorLabels,
setSpecSelectorLabels
} from './manifestSpecLabelUtils'
} from './manifestSpecLabelUtils.js'
import {
getImagePullSecrets,
setImagePullSecrets
} from './manifestPullSecretUtils'
import {Resource} from '../types/kubectl'
import {K8sObject} from '../types/k8sObject'
} from './manifestPullSecretUtils.js'
import {Resource} from '../types/kubectl.js'
import {K8sObject} from '../types/k8sObject.js'
export function updateManifestFiles(manifestFilePaths: string[]) {
if (manifestFilePaths?.length === 0) {
+4 -5
View File
@@ -1,11 +1,12 @@
import {
getImagePullSecrets,
setImagePullSecrets
} from './manifestPullSecretUtils'
import {updateSpecLabels} from './manifestSpecLabelUtils'
import {getReplicaCount} from './manifestUpdateUtils'
} from './manifestPullSecretUtils.js'
import {updateSpecLabels} from './manifestSpecLabelUtils.js'
import {getReplicaCount} from './manifestUpdateUtils.js'
import * as yaml from 'js-yaml'
import * as fs from 'fs'
import {isWorkloadEntity, isDeploymentEntity} from '../types/kubernetesTypes.js'
describe('ScaledJob Support', () => {
let scaledJobObject: any
@@ -57,13 +58,11 @@ describe('ScaledJob Support', () => {
describe('Workload Classification', () => {
it('should classify ScaledJob as workload entity', () => {
const {isWorkloadEntity} = require('../types/kubernetesTypes')
expect(isWorkloadEntity('ScaledJob')).toBe(true)
expect(isWorkloadEntity('scaledjob')).toBe(true)
})
it('should not classify ScaledJob as deployment entity', () => {
const {isDeploymentEntity} = require('../types/kubernetesTypes')
expect(isDeploymentEntity('scaledjob')).toBe(false)
expect(isDeploymentEntity('ScaledJob')).toBe(false)
})
+1 -1
View File
@@ -1,4 +1,4 @@
import {Kubectl} from '../types/kubectl'
import {Kubectl} from '../types/kubectl.js'
const trafficSplitAPIVersionPrefix = 'split.smi-spec.io'
@@ -2,7 +2,7 @@ import {
cleanLabel,
removeInvalidLabelCharacters,
VALID_LABEL_REGEX
} from '../utilities/workflowAnnotationUtils'
} from '../utilities/workflowAnnotationUtils.js'
describe('WorkflowAnnotationUtils', () => {
describe('cleanLabel', () => {
+1 -1
View File
@@ -1,4 +1,4 @@
import {DeploymentConfig} from '../types/deploymentConfig'
import {DeploymentConfig} from '../types/deploymentConfig.js'
const ANNOTATION_PREFIX = 'actions.github.com'
+11 -4
View File
@@ -1,8 +1,15 @@
{
"compilerOptions": {
"target": "ES6",
"module": "commonjs",
"esModuleInterop": true
"target": "ES2020",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"types": ["vitest/globals"],
"esModuleInterop": true,
"strict": false,
"skipLibCheck": true,
"resolveJsonModule": true,
"declaration": false,
"sourceMap": true
},
"exclude": ["node_modules", "test", "src/**/*.test.ts"]
"exclude": ["node_modules", "test", "lib"]
}
+11
View File
@@ -0,0 +1,11 @@
import {defineConfig} from 'vitest/config'
export default defineConfig({
test: {
globals: true,
environment: 'node',
include: ['**/*.test.ts'],
testTimeout: 9000,
clearMocks: true
}
})