Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies version #36

Merged
merged 8 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 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[email protected].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/[email protected]/main.ts src/*.ts
deno run -A https://deno.land/x/[email protected]/main.ts src/**/*.ts
deno run -A https://deno.land/x/[email protected]/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/[email protected]/fs/exists.ts"
import * as path from "https://deno.land/[email protected]/path/mod.ts"
import * as yaml from "https://deno.land/[email protected]/encoding/yaml.ts"
import { exists } from "https://deno.land/[email protected]/fs/exists.ts"
import * as path from "https://deno.land/[email protected]/path/mod.ts"
import {
assertEquals,
assertStringIncludes,
} from "https://deno.land/[email protected]/testing/asserts.ts"
} from "https://deno.land/[email protected]/testing/asserts.ts"
import * as yaml from "https://deno.land/[email protected]/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/[email protected]/wrapper.ts"
import {
PartialOption,
BinaryFlag,
PartialOption,
} from "https://deno.land/x/[email protected]/flag-types.ts"
import { Choice, Text } from "https://deno.land/x/[email protected]/value-types.ts"
import args from "https://deno.land/x/[email protected]/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/[email protected]/wrapper.ts"
import {
PartialOption,
BinaryFlag,
PartialOption,
} from "https://deno.land/x/[email protected]/flag-types.ts"
import { Text } from "https://deno.land/x/[email protected]/value-types.ts"
import args from "https://deno.land/x/[email protected]/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/[email protected]/wrapper.ts"
import { CollectOption } from "https://deno.land/x/[email protected]/flag-types.ts"
import { Text } from "https://deno.land/x/[email protected]/value-types.ts"
import args from "https://deno.land/x/[email protected]/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/[email protected]/fs/ensure_dir.ts"
import { exists } from "https://deno.land/[email protected]/fs/exists.ts"
import * as path from "https://deno.land/[email protected]/path/mod.ts"
import * as yaml from "https://deno.land/[email protected]/yaml/mod.ts"
import type { HelmDenoOptions } from "../args/parse-helm-deno-args.ts"
import * as yaml from "https://deno.land/[email protected]/encoding/yaml.ts"
import { exists } from "https://deno.land/[email protected]/fs/exists.ts"
import { ensureDir } from "https://deno.land/[email protected]/fs/ensure_dir.ts"
import * as path from "https://deno.land/[email protected]/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/[email protected]/fs/exists.ts"
import { copy } from "https://deno.land/[email protected]/fs/copy.ts"
import * as yaml from "https://deno.land/[email protected]/encoding/yaml.ts"
import * as path from "https://deno.land/[email protected]/path/mod.ts"
import { Chart } from "./chart-types.ts"
import { copy } from "https://deno.land/[email protected]/fs/copy.ts"
import { exists } from "https://deno.land/[email protected]/fs/exists.ts"
import * as path from "https://deno.land/[email protected]/path/mod.ts"
import * as yaml from "https://deno.land/[email protected]/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