Skip to content

Commit

Permalink
Update dependencies version (#36)
Browse files Browse the repository at this point in the history
* Update deno to 1.38.3

* Update github workflows dependencies

* Update tools dependencies

* Add udd for e2e-tests folder

* Update dependencies in typescript code and fix formatting

* Fix e2e tests after update helm

In helm before version 3.13.0 helm lint check that template dir exists
in chart dir
https://github.com/helm/helm/blob/3a31588ad33fe3b89af5a2a54ee1d25bfe6eaa5e/pkg/lint/rules/template.go#L190-L197

But in helm version 3.13.0 this check were changed
https://github.com/helm/helm/blob/825e86f6a7a38cef1112bfa606e4127a706749b1/pkg/lint/rules/template.go#L190-L197
so now there is now warning message about template dir.

* Add folders to ignore list in editorconfig check

* Change setup Kind github workflow
  • Loading branch information
verdel authored Nov 29, 2023
1 parent 8326cbf commit 42ee284
Show file tree
Hide file tree
Showing 24 changed files with 642 additions and 509 deletions.
4 changes: 3 additions & 1 deletion .ecrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"exclude": [
"^LICENSE$"
"^LICENSE$",
"node_modules/",
".git/"
]
}
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

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

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install dependencies
run: make install-tools
Expand All @@ -16,4 +16,4 @@ jobs:
run: make lint

- name: Run editorconfig linter
uses: docker://mstruebing/editorconfig-checker:2.4.0
uses: docker://mstruebing/editorconfig-checker:2.7.2
18 changes: 9 additions & 9 deletions .github/workflows/test-all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,40 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: denoland/setup-deno@v1
with:
deno-version: v1.27.x
deno-version: v1.38.x

- name: Install Age Encryption Tool
run: |
wget https://github.com/FiloSottile/age/releases/download/v1.0.0/age-v1.0.0-linux-amd64.tar.gz -O age.tar.gz
wget https://github.com/FiloSottile/age/releases/download/v1.1.1/age-v1.1.1-linux-amd64.tar.gz -O age.tar.gz
tar xvf age.tar.gz age/age age/age-keygen
echo "$PWD/age" >> $GITHUB_PATH
- name: Install sops
uses: mdgreenwald/mozilla-sops-action@v1.2.0
uses: mdgreenwald/mozilla-sops-action@v1.5.0
with:
version: 3.7.3
version: 3.8.1

- name: Install helm-diff
run: |
helm plugin install https://github.com/databus23/helm-diff --version v3.6.0
helm plugin install https://github.com/databus23/helm-diff --version v3.8.1
- name: Install helm-secrets
run: |
helm plugin install https://github.com/jkroepke/helm-secrets --version v4.1.1
helm plugin install https://github.com/jkroepke/helm-secrets --version v4.5.1
- name: Install helm-push
run: |
helm plugin install https://github.com/chartmuseum/helm-push --version v0.10.3
helm plugin install https://github.com/chartmuseum/helm-push --version v0.10.4
- name: Install plugin
run: make install-plugin

- name: Start local kubernetes cluster
uses: engineerd/setup-kind@v0.5.0
uses: helm/kind-action@v1.8.0

- name: Run tests
run: make test-all
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: denoland/setup-deno@v1
with:
deno-version: v1.27.x
deno-version: v1.38.x

- name: Install plugin
run: make install-plugin
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
deno 1.27.0
deno 1.38.3
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ install-tools:
@ yarn --frozen-lockfile

install-plugin:
@ HELM_PLUGIN_DIR="$$PWD" ./scripts/install.sh "v$${DENO_VERSION:-1.27.0}"
@ HELM_PLUGIN_DIR="$$PWD" ./scripts/install.sh "v$${DENO_VERSION:-1.38.3}"

lint:
@ yarn prettier --check .
Expand Down Expand Up @@ -40,3 +40,4 @@ test-all:
update-deps:
deno run -A https://deno.land/x/udd@0.8.1/main.ts src/*.ts
deno run -A https://deno.land/x/udd@0.8.1/main.ts src/**/*.ts
deno run -A https://deno.land/x/udd@0.8.1/main.ts e2e-tests/**/*.ts
36 changes: 14 additions & 22 deletions e2e-tests/e2e.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Use fork until https://github.com/piyush-bhatt/deno-port/pull/1 is merged
import { getAvailablePort } from "https://raw.githubusercontent.com/Nitive/deno-port/fix-getting-random-port/mod.ts"
import { exists } from "https://deno.land/std@0.160.0/fs/exists.ts"
import * as path from "https://deno.land/std@0.160.0/path/mod.ts"
import * as yaml from "https://deno.land/std@0.160.0/encoding/yaml.ts"
import { exists } from "https://deno.land/std@0.208.0/fs/exists.ts"
import * as path from "https://deno.land/std@0.208.0/path/mod.ts"
import {
assertEquals,
assertStringIncludes,
} from "https://deno.land/std@0.160.0/testing/asserts.ts"
} from "https://deno.land/std@0.208.0/testing/asserts.ts"
import * as yaml from "https://deno.land/std@0.208.0/yaml/mod.ts"
import { getAvailablePort } from "https://raw.githubusercontent.com/Nitive/deno-port/fix-getting-random-port/mod.ts"
import { ignoreNotFoundError } from "../src/utils/ignore-not-found-error.ts"
import { waitForProcess } from "../src/utils/process.ts"

Expand Down Expand Up @@ -139,7 +139,6 @@ Deno.test(
stdout.replaceAll(helmPluginDir, ""),
`\
==> Linting /e2e-tests/charts/one-service
[WARNING] templates/: directory not found
1 chart(s) linted, 0 chart(s) failed
`
Expand Down Expand Up @@ -579,6 +578,7 @@ Deno.test({
const fetchResult = await runHelmDeno([
"fetch",
`${ociRegistry.url}/one-service`,
"--plain-http",
"--untar",
"--untardir",
fetchDirectory,
Expand Down Expand Up @@ -635,8 +635,7 @@ Deno.test({
})

Deno.test({
name:
"should clean deno-bundle.js and helm package if push wasn't successful",
name: "should clean deno-bundle.js and helm package if push wasn't successful",
ignore: !runAllTests,
async fn() {
const chartPath = path.join(chartsBin, "one-service")
Expand Down Expand Up @@ -702,8 +701,7 @@ Deno.test({
})

Deno.test({
name:
"should use deno-bundle.js if `--deno-bundle prefer` have been passed and deno-bundle.js exists",
name: "should use deno-bundle.js if `--deno-bundle prefer` have been passed and deno-bundle.js exists",
async fn() {
const chartPath = path.join(chartsBin, "prebundled")

Expand All @@ -730,8 +728,7 @@ Deno.test({
})

Deno.test({
name:
"should use deno-templates/index.ts if `--deno-bundle ignore` have been passed",
name: "should use deno-templates/index.ts if `--deno-bundle ignore` have been passed",
async fn() {
const chartPath = path.join(chartsBin, "prebundled")

Expand All @@ -758,8 +755,7 @@ Deno.test({
})

Deno.test({
name:
"should use deno-templates/index.ts if --deno-bundle have not been passed",
name: "should use deno-templates/index.ts if --deno-bundle have not been passed",
async fn() {
const chartPath = path.join(chartsBin, "prebundled")

Expand All @@ -784,8 +780,7 @@ Deno.test({
})

Deno.test({
name:
"should throw error if `--deno-bundle require` have been passed but deno-bundle.js do not exist",
name: "should throw error if `--deno-bundle require` have been passed but deno-bundle.js do not exist",
async fn() {
const chartPath = path.join(chartsBin, "one-service")

Expand All @@ -803,8 +798,7 @@ Deno.test({
})

Deno.test({
name:
"should not throw error if `--deno-bundle prefer` have been passed and deno-bundle.js do not exist",
name: "should not throw error if `--deno-bundle prefer` have been passed and deno-bundle.js do not exist",
async fn() {
const chartPath = path.join(chartsBin, "one-service")

Expand Down Expand Up @@ -890,8 +884,7 @@ Deno.test({
})

Deno.test({
name:
"should successfuly run `helm deno template` with remote deno chart (with --repo option)",
name: "should successfuly run `helm deno template` with remote deno chart (with --repo option)",
ignore: !runAllTests,
async fn() {
const { status, stdout, stderr } = await runHelmDeno([
Expand Down Expand Up @@ -932,8 +925,7 @@ async function addStableRepo() {
}

Deno.test({
name:
"should successfuly run `helm deno template` with remote chart (with helm repo add)",
name: "should successfuly run `helm deno template` with remote chart (with helm repo add)",
ignore: !runAllTests,
async fn() {
const tmpRepo = await addStableRepo()
Expand Down
16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
"name": "helm-deno",
"license": "MIT",
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.14.1",
"@typescript-eslint/parser": "^4.14.1",
"eslint": "^7.19.0",
"eslint-plugin-prettier": "^3.3.1",
"prettier": "2.2.1",
"typescript": "~4.1.5"
"@typescript-eslint/eslint-plugin": "^6.13.1",
"@typescript-eslint/parser": "^6.13.1",
"eslint": "^8.54.0",
"eslint-plugin-prettier": "^5.0.1",
"prettier": "3.1.0",
"prettier-plugin-organize-imports": "^3.2.2",
"typescript": "^5.3.2"
},
"prettier": {
"semi": false
"semi": false,
"trailingComma": "es5"
}
}
6 changes: 3 additions & 3 deletions plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: "deno"
version: "0.3.0-alpha.1"
version: "0.3.0-alpha.2"
usage: "Helm charts with Deno"
description: |-
This plugin allows to use Deno to prepare kubernetes manifests
hooks:
install: "$HELM_PLUGIN_DIR/scripts/install.sh v1.27.0"
update: "$HELM_PLUGIN_DIR/scripts/install.sh v1.27.0"
install: "$HELM_PLUGIN_DIR/scripts/install.sh v1.38.3"
update: "$HELM_PLUGIN_DIR/scripts/install.sh v1.38.3"
command: "$HELM_PLUGIN_DIR/scripts/run.sh"
2 changes: 1 addition & 1 deletion src/args/__tests__/parse-args.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from "https://deno.land/std@0.107.0/testing/asserts.ts"
import { assertEquals } from "https://deno.land/std@0.208.0/testing/asserts.ts"
import { parseArgs } from "../parse-helm-deno-args.ts"

Deno.test("Should parse --deno-* flags", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/args/__tests__/parse-helm-args.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from "https://deno.land/std@0.160.0/testing/asserts.ts"
import { assertEquals } from "https://deno.land/std@0.208.0/testing/asserts.ts"
import { parseHelmArgs } from "../parse-helm-args.ts"

Deno.test("Should parse helm template args for `helm upgrade`", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/args/__tests__/parse-helm-fetch-args.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from "https://deno.land/std@0.107.0/testing/asserts.ts"
import { assertEquals } from "https://deno.land/std@0.208.0/testing/asserts.ts"
import { parseHelmFetchArgs } from "../parse-helm-fetch-args.ts"

Deno.test("Should parse helm fetch args", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/args/__tests__/parse-helm-template-args.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from "https://deno.land/std@0.107.0/testing/asserts.ts"
import { assertEquals } from "https://deno.land/std@0.208.0/testing/asserts.ts"
import { parseHelmTemplateArgs } from "../parse-helm-template-args.ts"

Deno.test("Should parse helm template args", () => {
Expand Down
4 changes: 1 addition & 3 deletions src/args/parse-helm-args.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
export const supportedCommands = ["upgrade", "template", "install"]

export function parseHelmArgs(
args: readonly string[]
): {
export function parseHelmArgs(args: readonly string[]): {
readonly command: readonly string[]
readonly releaseName: string
readonly chartLocation: string
Expand Down
4 changes: 2 additions & 2 deletions src/args/parse-helm-deno-args.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import args from "https://deno.land/x/args@2.1.1/wrapper.ts"
import {
PartialOption,
BinaryFlag,
PartialOption,
} from "https://deno.land/x/args@2.1.1/flag-types.ts"
import { Choice, Text } from "https://deno.land/x/args@2.1.1/value-types.ts"
import args from "https://deno.land/x/args@2.1.1/wrapper.ts"

type LogLevel = "info" | "debug"

Expand Down
4 changes: 2 additions & 2 deletions src/args/parse-helm-fetch-args.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import args from "https://deno.land/x/args@2.1.1/wrapper.ts"
import {
PartialOption,
BinaryFlag,
PartialOption,
} from "https://deno.land/x/args@2.1.1/flag-types.ts"
import { Text } from "https://deno.land/x/args@2.1.1/value-types.ts"
import args from "https://deno.land/x/args@2.1.1/wrapper.ts"

const textOption = (flag: string) =>
PartialOption(flag, {
Expand Down
2 changes: 1 addition & 1 deletion src/args/parse-helm-template-args.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import args from "https://deno.land/x/args@2.1.1/wrapper.ts"
import { CollectOption } from "https://deno.land/x/args@2.1.1/flag-types.ts"
import { Text } from "https://deno.land/x/args@2.1.1/value-types.ts"
import args from "https://deno.land/x/args@2.1.1/wrapper.ts"

const textOption = (flag: string, alias?: readonly string[]) =>
CollectOption(flag, {
Expand Down
19 changes: 7 additions & 12 deletions src/deno/render-chart.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { ChartContext } from "../std/mod.ts"
import { ensureDir } from "https://deno.land/std@0.208.0/fs/ensure_dir.ts"
import { exists } from "https://deno.land/std@0.208.0/fs/exists.ts"
import * as path from "https://deno.land/std@0.208.0/path/mod.ts"
import * as yaml from "https://deno.land/std@0.208.0/yaml/mod.ts"
import type { HelmDenoOptions } from "../args/parse-helm-deno-args.ts"
import * as yaml from "https://deno.land/std@0.160.0/encoding/yaml.ts"
import { exists } from "https://deno.land/std@0.160.0/fs/exists.ts"
import { ensureDir } from "https://deno.land/std@0.160.0/fs/ensure_dir.ts"
import * as path from "https://deno.land/std@0.160.0/path/mod.ts"
import type { ChartContext } from "../std/mod.ts"
import { ignoreNotFoundError } from "../utils/ignore-not-found-error.ts"
import { waitForProcess } from "../utils/process.ts"

Expand Down Expand Up @@ -106,13 +106,8 @@ export async function renderDenoChart(
chartPath: string,
denoOptions: HelmDenoOptions
): Promise<{ debug: string } | undefined> {
const {
deno,
importer,
templateFolderPath,
bundlePath,
indexFilePath,
} = getPaths(chartPath)
const { deno, importer, templateFolderPath, bundlePath, indexFilePath } =
getPaths(chartPath)
await ensureDir(templateFolderPath)

const isDenoChart =
Expand Down
10 changes: 5 additions & 5 deletions src/helm/chart-utils.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { exists } from "https://deno.land/std@0.160.0/fs/exists.ts"
import { copy } from "https://deno.land/std@0.160.0/fs/copy.ts"
import * as yaml from "https://deno.land/std@0.160.0/encoding/yaml.ts"
import * as path from "https://deno.land/std@0.160.0/path/mod.ts"
import { Chart } from "./chart-types.ts"
import { copy } from "https://deno.land/std@0.208.0/fs/copy.ts"
import { exists } from "https://deno.land/std@0.208.0/fs/exists.ts"
import * as path from "https://deno.land/std@0.208.0/path/mod.ts"
import * as yaml from "https://deno.land/std@0.208.0/yaml/mod.ts"
import { withErrorMsg } from "../std/mod.ts"
import { ignoreNotFoundError } from "../utils/ignore-not-found-error.ts"
import { Chart } from "./chart-types.ts"

export async function copyChart(chartPath: string, destination: string) {
const destinationExists = await exists(chartPath)
Expand Down
8 changes: 4 additions & 4 deletions src/helm/fetch.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { exists } from "https://deno.land/std@0.160.0/fs/exists.ts"
import { copy } from "https://deno.land/std@0.160.0/fs/copy.ts"
import { expandGlob } from "https://deno.land/std@0.160.0/fs/expand_glob.ts"
import * as path from "https://deno.land/std@0.160.0/path/mod.ts"
import { copy } from "https://deno.land/std@0.208.0/fs/copy.ts"
import { exists } from "https://deno.land/std@0.208.0/fs/exists.ts"
import { expandGlob } from "https://deno.land/std@0.208.0/fs/expand_glob.ts"
import * as path from "https://deno.land/std@0.208.0/path/mod.ts"
import { parseHelmFetchArgs } from "../args/parse-helm-fetch-args.ts"
import { withErrorMsg } from "../std/mod.ts"
import { waitForProcess } from "../utils/process.ts"
Expand Down
Loading

0 comments on commit 42ee284

Please sign in to comment.