From 893dae7e14e4b97b879673497672497e9bdd1558 Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Sun, 2 Feb 2025 20:50:00 +0100 Subject: [PATCH 01/39] ci: add helper for running spell checks --- Justfile | 7 +++++++ configs/typos.toml | 12 ++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 Justfile create mode 100644 configs/typos.toml diff --git a/Justfile b/Justfile new file mode 100644 index 0000000..131d014 --- /dev/null +++ b/Justfile @@ -0,0 +1,7 @@ +config_dir := "./configs" + +### HELPERS ################################################################### + +# Run spell checker +spellcheck: + typos --config "{{ config_dir }}/typos.toml" diff --git a/configs/typos.toml b/configs/typos.toml new file mode 100644 index 0000000..8d38a84 --- /dev/null +++ b/configs/typos.toml @@ -0,0 +1,12 @@ +# typos configuration (https://github.com/crate-ci/typos) + +[default] +extend-ignore-re = [ + # ignore lines with trailing "spellchecker:disable-line" + "(?Rm)^.*(#|//)\\s*spellchecker:disable-line$", + # ignore blocks with "spellchecker:" + "(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on", +] + +[default.extend-words] +eaasi = "eaasi" From 8055c06c020d5ce1e3a9ba2c213f2a34a6f14cf4 Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Tue, 4 Feb 2025 14:03:07 +0100 Subject: [PATCH 02/39] chore: add initial `.gitignore` --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..03bd412 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.env From c0b1e8adc0d172525149f890cce6a6894b0abf58 Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Tue, 4 Feb 2025 14:05:04 +0100 Subject: [PATCH 03/39] ci: add helper for generating changelogs --- Justfile | 11 +++++++++++ cliff.toml | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 cliff.toml diff --git a/Justfile b/Justfile index 131d014..58f9769 100644 --- a/Justfile +++ b/Justfile @@ -1,3 +1,4 @@ +chart_dir := "./charts" config_dir := "./configs" ### HELPERS ################################################################### @@ -5,3 +6,13 @@ config_dir := "./configs" # Run spell checker spellcheck: typos --config "{{ config_dir }}/typos.toml" + +# Update chart's changelog +update-changelog chart version="" dir=(chart_dir / chart): + #!/usr/bin/env -S sh -eu -o allexport + test -f cliff.env && . ./cliff.env + git cliff --unreleased \ + {{ if version == "" { "--bump" } else { "--tag " + chart + "-" + version } }} \ + --tag-pattern "{{ chart }}-.+" \ + --include-path "{{ dir }}/**" \ + --prepend "{{ dir }}/CHANGELOG.md" diff --git a/cliff.toml b/cliff.toml new file mode 100644 index 0000000..0093668 --- /dev/null +++ b/cliff.toml @@ -0,0 +1,57 @@ +# git-cliff configuration (https://github.com/orhun/git-cliff) + +[changelog] +trim = false + +header = """ +# Changelog +""" + +body = """ +{% if version %} +## {{ version | split(pat="-") | last }} - *{{ timestamp | date(format="%Y-%m-%d") }}* +{% else -%} +## Unreleased +{% endif -%} +{% for group, commits in commits | group_by(attribute="group") %} +### {{ group | split(pat=":") | last | trim }} + +{% for commit in commits -%} +{% set message = commit.message | upper_first -%} +{% if commit.breaking -%} +{% set message = "(**!**) " ~ message -%} +{% endif -%} +{% set short_sha = commit.id | truncate(length=7, end="") -%} +{% set commit_url = "/commit/" ~ commit.id -%} +{% set ref = "[`" ~ short_sha ~ "`](" ~ commit_url ~ ")" -%} +- {{ message }} - ({{ ref }}) +{% endfor -%} +{% endfor -%} +""" + +postprocessors = [ + # Replace repository placeholder with the real URL + { pattern = "", replace = "https://github.com/eaasi/helm-charts" }, +] + +[git] +conventional_commits = true +filter_unconventional = true +filter_commits = false +split_commits = false +sort_commits = "oldest" +topo_order = false + +commit_parsers = [ + { message = "^feat", group = "1: Features" }, + { message = "^fix", group = "2: Bug Fixes" }, + { message = "^refactor", group = "3: Refactoring" }, + { message = "^test", group = "4: Testing" }, + { message = "^ci", group = "5: Continuous Integration" }, + { message = "^docs", group = "6: Documentation" }, + { message = ".*", group = "7: Miscellaneous" }, +] + +[remote.github] +owner = "eaasi" +repo = "helm-charts" From 26e2a100707204e94dca0e96f5141702b249c209 Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Tue, 4 Feb 2025 14:09:51 +0100 Subject: [PATCH 04/39] ci: include commit authors in changelogs --- cliff.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cliff.toml b/cliff.toml index 0093668..54e3fb4 100644 --- a/cliff.toml +++ b/cliff.toml @@ -24,6 +24,9 @@ body = """ {% set short_sha = commit.id | truncate(length=7, end="") -%} {% set commit_url = "/commit/" ~ commit.id -%} {% set ref = "[`" ~ short_sha ~ "`](" ~ commit_url ~ ")" -%} +{% if commit.remote.username -%} +{% set ref = ref ~ " by @" ~ commit.remote.username -%} +{% endif -%} - {{ message }} - ({{ ref }}) {% endfor -%} {% endfor -%} From c79a060b50badc4c240d4a1a2af89c1225b4309c Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Tue, 4 Feb 2025 14:15:02 +0100 Subject: [PATCH 05/39] ci: include commit PRs in changelogs --- cliff.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cliff.toml b/cliff.toml index 54e3fb4..484e335 100644 --- a/cliff.toml +++ b/cliff.toml @@ -27,6 +27,11 @@ body = """ {% if commit.remote.username -%} {% set ref = ref ~ " by @" ~ commit.remote.username -%} {% endif -%} +{% if commit.remote.pr_number -%} +{% set pr_num = commit.remote.pr_number -%} +{% set pr_url = "/pull/" ~ pr_num -%} +{% set ref = ref ~ " in [#" ~ pr_num ~ "](" ~ pr_url ~ ")" -%} +{% endif -%} - {{ message }} - ({{ ref }}) {% endfor -%} {% endfor -%} From 802db3b50075cbecea1d880576d138da3d68a739 Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Tue, 4 Feb 2025 14:24:20 +0100 Subject: [PATCH 06/39] ci: include commit bodies in changelogs --- cliff.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cliff.toml b/cliff.toml index 484e335..eab32be 100644 --- a/cliff.toml +++ b/cliff.toml @@ -13,6 +13,7 @@ body = """ {% else -%} ## Unreleased {% endif -%} +{% set include_commit_body = false -%} {% for group, commits in commits | group_by(attribute="group") %} ### {{ group | split(pat=":") | last | trim }} @@ -33,6 +34,10 @@ body = """ {% set ref = ref ~ " in [#" ~ pr_num ~ "](" ~ pr_url ~ ")" -%} {% endif -%} - {{ message }} - ({{ ref }}) +{% if include_commit_body and commit.body %} + {{ commit.body | indent(prefix=" ") }} + +{% endif -%} {% endfor -%} {% endfor -%} """ From 357e1ebf7be4f9d0f7ee640c59d911432821d8ef Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Tue, 4 Feb 2025 14:34:53 +0100 Subject: [PATCH 07/39] ci: add links to more detailed changelogs --- cliff.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cliff.toml b/cliff.toml index eab32be..8cf5113 100644 --- a/cliff.toml +++ b/cliff.toml @@ -40,6 +40,11 @@ body = """ {% endif -%} {% endfor -%} {% endfor -%} +{% if previous.version -%} +{% set tag = version | default(value="HEAD") -%} +{% set diff_url = "/compare/" ~ previous.version ~ ".." ~ tag %} +The more detailed changelog for `{{ tag }}` can be found [here]({{ diff_url }}). +{% endif -%} """ postprocessors = [ From 51f5956e1aabb289e3d66fe4dcb846353d2b68c2 Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Tue, 4 Feb 2025 14:52:02 +0100 Subject: [PATCH 08/39] ci: enhance issue references in changelogs --- cliff.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cliff.toml b/cliff.toml index 8cf5113..5384e8e 100644 --- a/cliff.toml +++ b/cliff.toml @@ -60,6 +60,11 @@ split_commits = false sort_commits = "oldest" topo_order = false +commit_preprocessors = [ + # Replace issue references with their remote link template + { pattern = '([\(\s]+)#([0-9]+)', replace = "${1}[#${2}](/issues/${2})"}, +] + commit_parsers = [ { message = "^feat", group = "1: Features" }, { message = "^fix", group = "2: Bug Fixes" }, From b24b72603211dbfc6bddc6b759d3442140507fbf Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Tue, 4 Feb 2025 15:02:12 +0100 Subject: [PATCH 09/39] ci: add helper for running chart linter --- Justfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Justfile b/Justfile index 58f9769..02ca605 100644 --- a/Justfile +++ b/Justfile @@ -7,6 +7,10 @@ config_dir := "./configs" spellcheck: typos --config "{{ config_dir }}/typos.toml" +# Run chart linter +lint chart="*": + helm lint {{ chart_dir / chart }} + # Update chart's changelog update-changelog chart version="" dir=(chart_dir / chart): #!/usr/bin/env -S sh -eu -o allexport From 3770cb1dd5d58649b737167ba496352a8c9b87cb Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Tue, 4 Feb 2025 15:17:55 +0100 Subject: [PATCH 10/39] ci: add helper for running chart validator --- Justfile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Justfile b/Justfile index 02ca605..509a82a 100644 --- a/Justfile +++ b/Justfile @@ -11,6 +11,18 @@ spellcheck: lint chart="*": helm lint {{ chart_dir / chart }} +# Run chart validator +validate chart="*": + docker run -t --rm --network="host" \ + --workdir="/data" \ + --volume="$PWD:/data" \ + --volume="$(helm env HELM_CACHE_HOME):/root/.cache/helm:ro" \ + --volume="$(helm env HELM_CONFIG_HOME):/root/.config/helm:ro" \ + "quay.io/helmpack/chart-testing:v3.7.1" \ + ct lint --config "{{ config_dir }}/chart-testing.yaml" \ + --helm-dependency-extra-args "--skip-refresh" \ + {{ if chart == "*" { "--all" } else { '--charts "' + (chart_dir / chart) + '"' } }} + # Update chart's changelog update-changelog chart version="" dir=(chart_dir / chart): #!/usr/bin/env -S sh -eu -o allexport From a3088f051c2008d66f26671198991bb52288e795 Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Tue, 4 Feb 2025 15:33:03 +0100 Subject: [PATCH 11/39] ci: add job for running spell checks --- .github/workflows/checks.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/checks.yaml diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml new file mode 100644 index 0000000..37817b1 --- /dev/null +++ b/.github/workflows/checks.yaml @@ -0,0 +1,25 @@ +# SPDX-FileCopyrightText: 2025 Yale University +# SPDX-License-Identifier: Apache-2.0 + +# Reusable workflow for running various checks on Helm charts + +name: checks +on: + workflow_call: + +permissions: + contents: read + +env: + CLICOLOR: 1 + +jobs: + spell-checker: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Run spell checker + uses: crate-ci/typos@v1.29.7 + with: + config: ./configs/typos.toml From f70a5ffd2cf19c113e21eab7404bffad67cf831e Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Tue, 4 Feb 2025 16:31:06 +0100 Subject: [PATCH 12/39] ci: add job for running chart linters --- .github/workflows/checks.yaml | 30 ++++++++++++++++++++++++++++++ configs/chart-testing.yaml | 7 +++++++ 2 files changed, 37 insertions(+) create mode 100644 configs/chart-testing.yaml diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 37817b1..c065427 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -6,6 +6,11 @@ name: checks on: workflow_call: + inputs: + enable-change-detection: + description: Enable change detection + default: false + type: boolean permissions: contents: read @@ -14,6 +19,31 @@ env: CLICOLOR: 1 jobs: + helm-linter: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + # Fetch whole history required for change detection (if enabled) + fetch-depth: ${{ (inputs.enable-change-detection) && '0' || '1' }} + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + check-latest: true + - name: Install Helm + uses: azure/setup-helm@v4 + with: + version: v3.17.0 + - name: Install chart-testing + uses: helm/chart-testing-action@v2.7.0 + - name: Run chart linters and validators + env: + # Enable change detection if explicitly requested, else check all charts + CHART_TESTING_ARGS: ${{ (inputs.enable-change-detection) && '--target-branch main' || '--all' }} + run: ct lint --config ./configs/chart-testing.yaml ${{ env.CHART_TESTING_ARGS }} + spell-checker: runs-on: ubuntu-latest steps: diff --git a/configs/chart-testing.yaml b/configs/chart-testing.yaml new file mode 100644 index 0000000..d3f98d0 --- /dev/null +++ b/configs/chart-testing.yaml @@ -0,0 +1,7 @@ +# chart-testing configuration (https://github.com/helm/chart-testing) + +check-version-increment: false +validate-maintainers: false +remote: origin +chart-dirs: + - charts From e644e1df1782c5725681819a3444edec3ac56300 Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Tue, 4 Feb 2025 17:07:01 +0100 Subject: [PATCH 13/39] ci: add job for running chart tests --- .github/workflows/checks.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index c065427..b8db83b 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -44,6 +44,24 @@ jobs: CHART_TESTING_ARGS: ${{ (inputs.enable-change-detection) && '--target-branch main' || '--all' }} run: ct lint --config ./configs/chart-testing.yaml ${{ env.CHART_TESTING_ARGS }} + helm-tester: + runs-on: ubuntu-latest + needs: + - helm-linter + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Start Minikube cluster + uses: medyagh/setup-minikube@v0.0.20 + - name: Install Helm + uses: azure/setup-helm@v4 + with: + version: v3.17.0 + - name: Install chart-testing + uses: helm/chart-testing-action@v2.7.0 + - name: Install and test charts + run: ct install --config ./configs/chart-testing.yaml --all + spell-checker: runs-on: ubuntu-latest steps: From ed9f183e85cff8c75ad34b55f21c0571554d9f43 Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Mon, 24 Feb 2025 14:51:04 +0100 Subject: [PATCH 14/39] ci: add reusable action for installing `committed` --- .github/actions/setup-committed/action.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/actions/setup-committed/action.yaml diff --git a/.github/actions/setup-committed/action.yaml b/.github/actions/setup-committed/action.yaml new file mode 100644 index 0000000..ecae960 --- /dev/null +++ b/.github/actions/setup-committed/action.yaml @@ -0,0 +1,13 @@ +# SPDX-FileCopyrightText: 2025 Yale University +# SPDX-License-Identifier: Apache-2.0 + +name: setup-committed +description: Helper for installing Committed +runs: + using: composite + steps: + - name: Install Committed + uses: jaxxstorm/action-install-gh-release@v2.1.0 + with: + repo: crate-ci/committed + tag: v1.1.7 From 06a5474041e83a8d16b594d58c4d8ac8858cc154 Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Mon, 24 Feb 2025 15:11:04 +0100 Subject: [PATCH 15/39] ci: add workflow for enforcing commit style --- .github/workflows/commit-style.yaml | 44 +++++++++++++++++++++++++++++ configs/committed.toml | 26 +++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 .github/workflows/commit-style.yaml create mode 100644 configs/committed.toml diff --git a/.github/workflows/commit-style.yaml b/.github/workflows/commit-style.yaml new file mode 100644 index 0000000..4b19e96 --- /dev/null +++ b/.github/workflows/commit-style.yaml @@ -0,0 +1,44 @@ +# SPDX-FileCopyrightText: 2025 Yale University +# SPDX-License-Identifier: Apache-2.0 + +# Workflow for enforcing commit style conventions + +name: commit-style +on: + push: + branches: + - main + pull_request: + branches: + - '**' + +permissions: + contents: read + +env: + CLICOLOR: 1 + +jobs: + commit-linter: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + # Fetch full history for merge-base detection! + fetch-depth: 0 + - id: commit-range + name: Determine commit range + uses: eaasi/commit-range-action@v0.5 + - name: Install commit style linter + uses: ./.github/actions/setup-committed + - name: Run commit style linter + run: | + range="${{ steps.commit-range.outputs.commit-range }}" + echo "Linting commits:" + git log --color=always --graph --oneline "${range:?}" || true + echo "" + committed -vv --color=always \ + --config ./configs/committed.toml \ + "${range}" + echo "DONE: Commits follow the required style conventions." diff --git a/configs/committed.toml b/configs/committed.toml new file mode 100644 index 0000000..39dcc37 --- /dev/null +++ b/configs/committed.toml @@ -0,0 +1,26 @@ +# committed configuration (https://github.com/crate-ci/committed) + +line_length = 0 +subject_length = 0 +subject_capitalized = false +subject_not_punctuated = true +imperative_subject = true +merge_commit = true +no_fixup = true +no_wip = true + +style = "conventional" + +# allowed commit types +allowed_types = [ + "build", + "chore", + "ci", + "docs", + "feat", + "fix", + "refactor", + "revert", + "style", + "test", +] From 9a446db7905466e3754091620e8692453c22fd19 Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Mon, 24 Feb 2025 15:45:05 +0100 Subject: [PATCH 16/39] ci: add helpers for controlling Minikube clusters --- Justfile | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/Justfile b/Justfile index 509a82a..6ca6a32 100644 --- a/Justfile +++ b/Justfile @@ -1,6 +1,12 @@ chart_dir := "./charts" config_dir := "./configs" +# Name of the Minikube cluster +cluster := "eaasi" + +# Name of the cluster namespace +namespace := "eaasi" + ### HELPERS ################################################################### # Run spell checker @@ -32,3 +38,30 @@ update-changelog chart version="" dir=(chart_dir / chart): --tag-pattern "{{ chart }}-.+" \ --include-path "{{ dir }}/**" \ --prepend "{{ dir }}/CHANGELOG.md" + +### MINIKUBE ################################################################## + +# Start a Minikube cluster +cluster-start name=cluster ns=namespace *args="": + minikube start --profile "{{ name }}" \ + --namespace "{{ ns }}" \ + --cpus "no-limit" \ + --memory "no-limit" \ + --force-systemd=true \ + {{ args }} + +# Stop a Minikube cluster +cluster-stop name=cluster: + minikube stop --profile "{{ name }}" + +# Pause a Minikube cluster +cluster-pause name=cluster: + minikube pause --profile "{{ name }}" --all-namespaces + +# Unpause a Minikube cluster +cluster-unpause name=cluster: + minikube unpause --profile "{{ name }}" --all-namespaces + +# Delete a Minikube cluster +cluster-delete name=cluster: + minikube delete --profile "{{ name }}" From 98fe0c71b9b05a084b740927391a27bc38d78758 Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Mon, 24 Feb 2025 16:06:24 +0100 Subject: [PATCH 17/39] ci: add helpers for running common Helm operations --- Justfile | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/Justfile b/Justfile index 6ca6a32..3b441c3 100644 --- a/Justfile +++ b/Justfile @@ -39,6 +39,47 @@ update-changelog chart version="" dir=(chart_dir / chart): --include-path "{{ dir }}/**" \ --prepend "{{ dir }}/CHANGELOG.md" +### HELM ###################################################################### + +# Add external chart repositories +add-chart-repos: + # TODO: add repos! + +# Build dependencies for all charts +build-chart-deps: + #!/usr/bin/env -S sh -eu + charts=$(ls "{{ chart_dir }}/") + for chart in $charts; do + just dep-build "$chart" + done + +# Build Helm chart's dependencies from its lock file +dep-build chart *args="--skip-refresh": + helm dependency build "{{ chart_dir / chart }}" {{ args }} + +# Update Helm chart's on-disk dependencies +dep-update chart *args="--skip-refresh": + helm dependency update "{{ chart_dir / chart }}" {{ args }} + +# Install a Helm chart +install chart name=chart ns=namespace *args="": + helm install "{{ name }}" "{{ chart_dir / chart }}" \ + --namespace "{{ ns }}" --create-namespace {{ args }} + +# Uninstall a Helm chart release +uninstall release ns=namespace *args="": + helm uninstall "{{ release }}" --namespace "{{ ns }}" {{ args }} + +# Upgrade a Helm chart release +upgrade chart release=chart ns=namespace *args="": + helm upgrade "{{ release }}" "{{ chart_dir / chart }}" \ + --install --namespace "{{ ns }}" --create-namespace {{ args }} + +# Render a Helm chart +render chart name=chart ns=namespace *args="": + helm template "{{ name }}" "{{ chart_dir / chart }}" \ + --namespace "{{ ns }}" {{ args }} | less + ### MINIKUBE ################################################################## # Start a Minikube cluster From 415533c7d12ffbc824380063671d1d5d3db78cb1 Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Mon, 24 Feb 2025 16:40:02 +0100 Subject: [PATCH 18/39] docs: describe how chart helpers can be used for development --- README.md | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/README.md b/README.md index b248514..9399cca 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,14 @@ using the [Helm](https://helm.sh) package manager. ## Helm Repository Add this Helm repository using: + ```console $ helm repo add eaasi https://eaasi.github.io/helm-charts $ helm repo update ``` List the available charts by running: + ```console $ helm search repo eaasi ``` @@ -20,6 +22,61 @@ $ helm search repo eaasi For more details, see the documentation for each chart: +## Development + +Multiple [Just](https://github.com/casey/just) recipes are provided in order to simplify local chart development. +For an overview of all available recipes and their parameters, take a look at the provided [Justfile](./Justfile) or simply run: + +```console +$ just --list +``` + +### Chart Helpers + +All source files can be checked for typos with: + +```console +$ just spellcheck +``` + +A chart linter can be run against a specific chart or all charts with: + +```console +$ just lint # omit name to lint all charts! +``` + +An extended validation can be performed on a specific chart or all charts with: + +```console +$ just validate # omit name to validate all charts! +``` + +All chart's templates can be rendered (without installing) with: + +```console +$ just render # +``` + +A specific chart can be installed or upgraded with: + +```console +$ just install # +$ just upgrade # +``` + +A previously installed release can be removed with: + +```console +$ just uninstall # +``` + +The dependencies of a chart can be managed with: + +```console +$ just dep-build # rebuild deps from Chart.lock file +$ just dep-update # update deps to mirror Chart.yaml +``` + ## License Helm charts for EAASI are distributed under the [Apache-2.0](./LICENSE) license. From 1e32ec2d910da4d7d80b61743b34defad3ea0fd9 Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Mon, 24 Feb 2025 16:56:04 +0100 Subject: [PATCH 19/39] docs: describe how Minikube helpers can be used for development --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index 9399cca..ffa8bc4 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,28 @@ $ just dep-build # rebuild deps from Chart.lock file $ just dep-update # update deps to mirror Chart.yaml ``` +### Minikube Management + +A local [Minikube](https://minikube.sigs.k8s.io) cluster can be created with: + +```console +$ just cluster-start +``` + +A running Minikube cluster can be paused and resumed later with: + +```console +$ just cluster-pause +$ just cluster-unpause +``` + +When a local Minikube cluster is not needed anymore, it can be stopped or deleted with: + +```console +$ just cluster-stop +$ just cluster-delete +``` + ## License Helm charts for EAASI are distributed under the [Apache-2.0](./LICENSE) license. From 367e22ebe24123ee6cfe150aa8833bfaa0a58fdd Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Mon, 24 Feb 2025 16:58:57 +0100 Subject: [PATCH 20/39] docs: describe how to use helpers for adding chart repositories --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index ffa8bc4..776ec01 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,20 @@ $ just cluster-stop $ just cluster-delete ``` +### Deployment + +Before deploying anything, the chart repositories for all dependencies must be added with: + +```console +$ just add-chart-repos +``` + +Next, rebuild all required chart dependencies with: + +```console +$ just build-chart-deps +``` + ## License Helm charts for EAASI are distributed under the [Apache-2.0](./LICENSE) license. From 389a691bae51d811edc7dd4ce4038c9ba28bc3db Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Mon, 24 Feb 2025 19:11:09 +0100 Subject: [PATCH 21/39] ci: add reusable action for installing `helm` --- .github/actions/setup-helm/action.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/actions/setup-helm/action.yaml diff --git a/.github/actions/setup-helm/action.yaml b/.github/actions/setup-helm/action.yaml new file mode 100644 index 0000000..d959686 --- /dev/null +++ b/.github/actions/setup-helm/action.yaml @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: 2025 Yale University +# SPDX-License-Identifier: Apache-2.0 + +name: setup-helm +description: Helper for installing Helm +runs: + using: composite + steps: + - name: Install Helm + uses: azure/setup-helm@v4 + with: + version: v3.17.0 From de28d7892996e067514da806304391d8c1f9346d Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Mon, 24 Feb 2025 19:20:48 +0100 Subject: [PATCH 22/39] refactor: reuse step for installing `helm` in multiple jobs --- .github/workflows/checks.yaml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index b8db83b..21049a5 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -32,10 +32,9 @@ jobs: with: python-version: '3.x' check-latest: true - - name: Install Helm - uses: azure/setup-helm@v4 - with: - version: v3.17.0 + - &install-helm-step + name: Install Helm + uses: ./.github/actions/setup-helm - name: Install chart-testing uses: helm/chart-testing-action@v2.7.0 - name: Run chart linters and validators @@ -53,10 +52,7 @@ jobs: uses: actions/checkout@v4 - name: Start Minikube cluster uses: medyagh/setup-minikube@v0.0.20 - - name: Install Helm - uses: azure/setup-helm@v4 - with: - version: v3.17.0 + - *install-helm-step - name: Install chart-testing uses: helm/chart-testing-action@v2.7.0 - name: Install and test charts From 75dad1185130815b6ee00899e996fb707f63a2c1 Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Mon, 24 Feb 2025 19:26:56 +0100 Subject: [PATCH 23/39] refactor: reuse step for installing `ct` in multiple jobs --- .github/workflows/checks.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 21049a5..234a338 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -35,7 +35,8 @@ jobs: - &install-helm-step name: Install Helm uses: ./.github/actions/setup-helm - - name: Install chart-testing + - &install-ct-step + name: Install chart-testing uses: helm/chart-testing-action@v2.7.0 - name: Run chart linters and validators env: @@ -53,8 +54,7 @@ jobs: - name: Start Minikube cluster uses: medyagh/setup-minikube@v0.0.20 - *install-helm-step - - name: Install chart-testing - uses: helm/chart-testing-action@v2.7.0 + - *install-ct-step - name: Install and test charts run: ct install --config ./configs/chart-testing.yaml --all From fd60b70ac9600844ca59dcca033223e4eb652a48 Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Tue, 18 Mar 2025 13:43:07 +0100 Subject: [PATCH 24/39] ci: add reusable action for installing `just` --- .github/actions/setup-just/action.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/actions/setup-just/action.yaml diff --git a/.github/actions/setup-just/action.yaml b/.github/actions/setup-just/action.yaml new file mode 100644 index 0000000..b185b5e --- /dev/null +++ b/.github/actions/setup-just/action.yaml @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: 2025 Yale University +# SPDX-License-Identifier: Apache-2.0 + +name: setup-just +description: Helper for installing Just +runs: + using: composite + steps: + - name: Install Just + uses: taiki-e/install-action@v2 + with: + tool: just@1.40.0 From 8b0c9e8ee5d214bf90561b0e246ee55ef75fbb60 Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Tue, 18 Mar 2025 14:04:01 +0100 Subject: [PATCH 25/39] ci: register external chart repositories required for validation --- .github/workflows/checks.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 234a338..0aca6f4 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -32,12 +32,16 @@ jobs: with: python-version: '3.x' check-latest: true + - name: Install Just + uses: ./.github/actions/setup-just - &install-helm-step name: Install Helm uses: ./.github/actions/setup-helm - &install-ct-step name: Install chart-testing uses: helm/chart-testing-action@v2.7.0 + - name: Add external chart repositories + run: just add-chart-repos - name: Run chart linters and validators env: # Enable change detection if explicitly requested, else check all charts From 3f01b0f7ed98b60bced4383910735ef9d43e625a Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Tue, 18 Mar 2025 14:06:04 +0100 Subject: [PATCH 26/39] ci: register external chart repositories required for testing --- .github/workflows/checks.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 0aca6f4..3cd223f 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -32,7 +32,8 @@ jobs: with: python-version: '3.x' check-latest: true - - name: Install Just + - &install-just-step + name: Install Just uses: ./.github/actions/setup-just - &install-helm-step name: Install Helm @@ -40,7 +41,8 @@ jobs: - &install-ct-step name: Install chart-testing uses: helm/chart-testing-action@v2.7.0 - - name: Add external chart repositories + - &add-chart-repos-step + name: Add external chart repositories run: just add-chart-repos - name: Run chart linters and validators env: @@ -55,10 +57,12 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + - *install-just-step - name: Start Minikube cluster uses: medyagh/setup-minikube@v0.0.20 - *install-helm-step - *install-ct-step + - *add-chart-repos-step - name: Install and test charts run: ct install --config ./configs/chart-testing.yaml --all From dba04aa5fa89a5f09466ade7f53c143555cb9ba4 Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Tue, 18 Mar 2025 14:08:12 +0100 Subject: [PATCH 27/39] ci: reuse helper for starting Minikube test clusters --- .github/workflows/checks.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 3cd223f..bcd81ea 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -58,8 +58,12 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - *install-just-step - - name: Start Minikube cluster + - name: Install Minikube uses: medyagh/setup-minikube@v0.0.20 + with: + start: false + - name: Start Minikube cluster + run: just cluster-start - *install-helm-step - *install-ct-step - *add-chart-repos-step From 136f0c1e6146d9270f3f4dbd920c8300f856932d Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Tue, 18 Mar 2025 14:18:02 +0100 Subject: [PATCH 28/39] ci: add workflow for running various CI checks --- .github/workflows/ci.yaml | 25 +++++++++++++++++++++++++ charts/.gitkeep | 0 2 files changed, 25 insertions(+) create mode 100644 .github/workflows/ci.yaml create mode 100644 charts/.gitkeep diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..5eb189c --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,25 @@ +# SPDX-FileCopyrightText: 2025 Yale University +# SPDX-License-Identifier: Apache-2.0 + +# Workflow for running various CI checks + +name: continuous-integration +on: + push: + branches: + - main + pull_request: + branches: + - '**' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + +permissions: + contents: read + +jobs: + checks: + uses: ./.github/workflows/checks.yaml + with: + enable-change-detection: ${{ github.ref != 'refs/heads/main' }} diff --git a/charts/.gitkeep b/charts/.gitkeep new file mode 100644 index 0000000..e69de29 From 66427422a52fafd0bf3ec04dba64459e124a3211 Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Tue, 18 Mar 2025 15:05:45 +0100 Subject: [PATCH 29/39] ci: add step for extracting a list of validated charts --- .github/workflows/checks.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index bcd81ea..dbc0af2 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -21,6 +21,8 @@ env: jobs: helm-linter: runs-on: ubuntu-latest + env: + CHART_TESTING_LOG: chart-testing.log steps: - name: Checkout repository uses: actions/checkout@v4 @@ -48,7 +50,15 @@ jobs: env: # Enable change detection if explicitly requested, else check all charts CHART_TESTING_ARGS: ${{ (inputs.enable-change-detection) && '--target-branch main' || '--all' }} - run: ct lint --config ./configs/chart-testing.yaml ${{ env.CHART_TESTING_ARGS }} + run: | + set -o pipefail + ct lint --config ./configs/chart-testing.yaml ${{ env.CHART_TESTING_ARGS }} \ + | tee "${{ env.CHART_TESTING_LOG }}" + - id: ct-log-parser + name: Parse chart-testing logs + uses: eaasi/chart-list-action@v0.3 + with: + ct-log-file: ${{ env.CHART_TESTING_LOG }} helm-tester: runs-on: ubuntu-latest From c6f0f23418a433e666871b81db82a74815d9ec22 Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Tue, 18 Mar 2025 15:09:31 +0100 Subject: [PATCH 30/39] ci: export validated chart list from reusable workflow --- .github/workflows/checks.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index dbc0af2..a9ddf85 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -11,6 +11,10 @@ on: description: Enable change detection default: false type: boolean + outputs: + charts: + description: List of validated charts + value: ${{ jobs.helm-linter.outputs.charts }} permissions: contents: read @@ -21,6 +25,8 @@ env: jobs: helm-linter: runs-on: ubuntu-latest + outputs: + charts: ${{ steps.ct-log-parser.outputs.charts }} env: CHART_TESTING_LOG: chart-testing.log steps: From 4a6c145a7fc48ba0d92e4a8078cc7121f671c23b Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Tue, 18 Mar 2025 15:28:42 +0100 Subject: [PATCH 31/39] ci: add job for checking chart changelogs --- .github/workflows/checks.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index a9ddf85..7653b4f 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -95,3 +95,27 @@ jobs: uses: crate-ci/typos@v1.29.7 with: config: ./configs/typos.toml + + changelog-checker: + runs-on: ubuntu-latest + needs: + - helm-linter + - spell-checker + if: ${{ needs.helm-linter.outputs.charts != '[]' }} + strategy: + matrix: + chart: ${{ fromJSON(needs.helm-linter.outputs.charts) }} + env: + CHANGELOG_FILE: ${{ matrix.chart.path }}/CHANGELOG.md + steps: + - name: Checkout chart's changelog + uses: actions/checkout@v4 + with: + sparse-checkout: ${{ env.CHANGELOG_FILE }} + - name: Check chart's changelog + uses: eaasi/release-notes-action@v0.6 + with: + changelog-file: ${{ env.CHANGELOG_FILE }} + release-version: '${{ matrix.chart.version }}' + # Ignore missing changelogs for default chart version + continue-on-error: ${{ matrix.chart.version == '0.1.0' }} From 5a2743941e19aba676c1edd2ca545be4e99b5e19 Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Tue, 18 Mar 2025 20:03:57 +0100 Subject: [PATCH 32/39] ci: add support for limiting reusable checks to specific chart --- .github/workflows/checks.yaml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 7653b4f..4b76bac 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -11,6 +11,10 @@ on: description: Enable change detection default: false type: boolean + chart: + description: Limit checks to a specific chart + default: '' + type: string outputs: charts: description: List of validated charts @@ -53,12 +57,19 @@ jobs: name: Add external chart repositories run: just add-chart-repos - name: Run chart linters and validators - env: - # Enable change detection if explicitly requested, else check all charts - CHART_TESTING_ARGS: ${{ (inputs.enable-change-detection) && '--target-branch main' || '--all' }} run: | set -o pipefail - ct lint --config ./configs/chart-testing.yaml ${{ env.CHART_TESTING_ARGS }} \ + if ${{ inputs.enable-change-detection }}; then + # Enable change detection if requested + set -- "--target-branch" "main" + elif test -n "${{ inputs.chart }}"; then + # Process only the specified chart + set -- "--charts" "./charts/${{ inputs.chart }}" + else + # Process all charts + set -- "--all" + fi + ct lint --config ./configs/chart-testing.yaml "$@" \ | tee "${{ env.CHART_TESTING_LOG }}" - id: ct-log-parser name: Parse chart-testing logs From c5ae73d9dbffb8c2b4cf91c51bf8f4f379f2ba81 Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Tue, 18 Mar 2025 20:20:03 +0100 Subject: [PATCH 33/39] ci: add workflow for packaging and releasing charts --- .github/workflows/release.yaml | 122 +++++++++++++++++++++++++++++++++ configs/chart-releaser.yaml | 5 ++ 2 files changed, 127 insertions(+) create mode 100644 .github/workflows/release.yaml create mode 100644 configs/chart-releaser.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..9a06454 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,122 @@ +# SPDX-FileCopyrightText: 2025 Yale University +# SPDX-License-Identifier: Apache-2.0 + +# Workflow for packaging and releasing Helm charts + +name: release +on: + push: + tags: + - '**' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + +permissions: + contents: read + +env: + CLICOLOR: 1 + +jobs: + tag-parser: + runs-on: ubuntu-latest + outputs: + chart: ${{ steps.refname-parsing.outputs.chart }} + version: ${{ steps.refname-parsing.outputs.version }} + steps: + - id: refname-parsing + name: Parse pushed ref name + run: | + # Parse ref names of the form - + echo "Parsing ref name '${GITHUB_REF_NAME:?}'..." + refname="$(echo "${GITHUB_REF_NAME}" | sed -E 's/^(.+)-([0-9]+.*)$/\1:\2/')" + lookup() { cut -d ':' -f "${1:?}"; } + chart="$(echo "${refname:?}" | lookup 1)" + version="$(echo "${refname}" | lookup 2)" + echo "chart=${chart:?}" >> "${GITHUB_OUTPUT}" + echo "version=${version:?}" >> "${GITHUB_OUTPUT}" + echo "Parsed values:" + echo " chart = ${chart}" + echo " version = ${version}" + + chart-checks: + needs: + - tag-parser + uses: ./.github/workflows/checks.yaml + with: + chart: ${{ needs.tag-parser.outputs.chart }} + enable-change-detection: false + + chart-info: + runs-on: ubuntu-latest + needs: + - chart-checks + - tag-parser + outputs: + name: ${{ matrix.chart.name }} + version: ${{ matrix.chart.version}} + path: ${{ matrix.chart.path }} + refname: ${{ github.ref_name }} + strategy: + fail-fast: true + matrix: + chart: ${{ fromJSON(needs.chart-checks.outputs.charts) }} + steps: + - name: Find expected chart + run: | + test "${{ matrix.chart.name }}" = "${{ needs.tag-parser.outputs.chart }}" + + version-check: + runs-on: ubuntu-latest + needs: + - chart-info + - tag-parser + steps: + - name: Check chart version + run: | + curver="${{ needs.chart-info.outputs.version }}" + tagver="${{ needs.tag-parser.outputs.version }}" + if test "${curver:?}" != "${tagver:?}"; then + echo "ERROR: Chart version '${curver}' does not match tag version '${tagver}'!" + exit 1 + fi + + chart-releaser: + runs-on: ubuntu-latest + permissions: + contents: write + needs: + - chart-info + - chart-checks + - version-check + env: + CHART_RELEASER_CONFIG: ./configs/chart-releaser.yaml + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + path: ${{ needs.chart-info.outputs.path }} + - name: Update Git configuration + run: | + git config user.name "${{ github.event.pusher.name }}" + git config user.email "${{ github.event.pusher.email }}" + - name: Install chart-releaser + uses: helm/chart-releaser-action@v1.7.0 + with: + install_only: true + - name: Package requested chart + run: | + cr package "${{ needs.chart-info.outputs.path }}" \ + --config "${{ env.CHART_RELEASER_CONFIG }}" + - name: Upload chart package + run: | + cr upload --config "${{ env.CHART_RELEASER_CONFIG }}" \ + --token "${{ secrets.GITHUB_TOKEN }}" \ + --commit "${{ github.sha }}" \ + --skip-existing + - name: Update chart repository index + run: | + cr index --config "${{ env.CHART_RELEASER_CONFIG }}" \ + --token "${{ secrets.GITHUB_TOKEN }}" \ + --push diff --git a/configs/chart-releaser.yaml b/configs/chart-releaser.yaml new file mode 100644 index 0000000..a16b9b4 --- /dev/null +++ b/configs/chart-releaser.yaml @@ -0,0 +1,5 @@ +# chart-releaser configuration (https://github.com/helm/chart-releaser) + +pages-branch: pages +skip-existing: true +make-release-latest: false From 13dda06c4d6571120b987a934bd6bbb64bed9538 Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Tue, 18 Mar 2025 20:28:48 +0100 Subject: [PATCH 34/39] ci: register external chart repositories required for releasing --- .github/workflows/release.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9a06454..749f720 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -101,10 +101,16 @@ jobs: run: | git config user.name "${{ github.event.pusher.name }}" git config user.email "${{ github.event.pusher.email }}" + - name: Install Just + uses: ./.github/actions/setup-just + - name: Install Helm + uses: ./.github/actions/setup-helm - name: Install chart-releaser uses: helm/chart-releaser-action@v1.7.0 with: install_only: true + - name: Add external chart repositories + run: just add-chart-repos - name: Package requested chart run: | cr package "${{ needs.chart-info.outputs.path }}" \ From 5f24907b3b75ef4b007e37453b42d5c91311a077 Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Tue, 18 Mar 2025 20:40:08 +0100 Subject: [PATCH 35/39] ci: add step for preparing chart release notes --- .github/workflows/release.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 749f720..ddab3e6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -92,6 +92,7 @@ jobs: - version-check env: CHART_RELEASER_CONFIG: ./configs/chart-releaser.yaml + RELEASE_NOTES_FILE_NAME: RELEASE.md steps: - name: Checkout repository uses: actions/checkout@v4 @@ -111,6 +112,12 @@ jobs: install_only: true - name: Add external chart repositories run: just add-chart-repos + - name: Extract chart's release notes + uses: eaasi/release-notes-action@v0.6 + with: + changelog-file: ${{ needs.chart-info.outputs.path }}/CHANGELOG.md + release-notes-file: ${{ needs.chart-info.outputs.path }}/${{ env.RELEASE_NOTES_FILE_NAME }} + release-version: '${{ needs.chart-info.outputs.version }}' - name: Package requested chart run: | cr package "${{ needs.chart-info.outputs.path }}" \ From 5bd1a53c38cc5357cf4a4b73ca89aa68af8ff620 Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Tue, 18 Mar 2025 20:55:04 +0100 Subject: [PATCH 36/39] ci: configure `cr` to consume prepared release notes --- .github/workflows/release.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ddab3e6..9e88269 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -127,6 +127,7 @@ jobs: cr upload --config "${{ env.CHART_RELEASER_CONFIG }}" \ --token "${{ secrets.GITHUB_TOKEN }}" \ --commit "${{ github.sha }}" \ + --release-notes-file "${{ env.RELEASE_NOTES_FILE_NAME }}" \ --skip-existing - name: Update chart repository index run: | From f80a714541bc5d543cde085354a88711bce8221b Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Wed, 19 Mar 2025 14:19:01 +0100 Subject: [PATCH 37/39] ci: add reusable action for running `typos` --- .github/actions/check-typos/action.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/actions/check-typos/action.yaml diff --git a/.github/actions/check-typos/action.yaml b/.github/actions/check-typos/action.yaml new file mode 100644 index 0000000..9663c10 --- /dev/null +++ b/.github/actions/check-typos/action.yaml @@ -0,0 +1,18 @@ +# SPDX-FileCopyrightText: 2025 Yale University +# SPDX-License-Identifier: Apache-2.0 + +name: check-typos +description: Helper for running Typos +inputs: + files: + description: Files to check + required: false + default: '' +runs: + using: composite + steps: + - name: Install and run Typos + uses: crate-ci/typos@v1.29.7 + with: + config: ./configs/typos.toml + files: ${{ inputs.files }} From 9dee4c1dd591aaa9eaf347e2457eafea29ca0423 Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Wed, 19 Mar 2025 14:29:31 +0100 Subject: [PATCH 38/39] refactor: reuse local action for running `typos` --- .github/workflows/checks.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 4b76bac..b308341 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -103,9 +103,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - name: Run spell checker - uses: crate-ci/typos@v1.29.7 - with: - config: ./configs/typos.toml + uses: ./.github/actions/check-typos changelog-checker: runs-on: ubuntu-latest From 9b15ad6af02337a8a9e4e54779c9589eddcc7c07 Mon Sep 17 00:00:00 2001 From: Oleg Stobbe Date: Wed, 19 Mar 2025 15:53:07 +0100 Subject: [PATCH 39/39] ci: add workflow for enforcing PR naming convention --- .github/workflows/pr-naming.yaml | 86 ++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 .github/workflows/pr-naming.yaml diff --git a/.github/workflows/pr-naming.yaml b/.github/workflows/pr-naming.yaml new file mode 100644 index 0000000..c26aa56 --- /dev/null +++ b/.github/workflows/pr-naming.yaml @@ -0,0 +1,86 @@ +# SPDX-FileCopyrightText: 2025 Yale University +# SPDX-License-Identifier: Apache-2.0 + +# Workflow for enforcing PR naming conventions + +name: pr-naming +on: + pull_request: + types: + - opened + - edited + - reopened + +permissions: + contents: none + +env: + COMMIT_MESSAGE_FILE: ./commit-message.txt + CLICOLOR: 1 + +jobs: + commit-message: + runs-on: ubuntu-latest + outputs: + content: ${{ steps.message-constructor.outputs.content }} + steps: + - id: message-constructor + name: Construct commit message + env: + PR_TITLE: ${{ github.event.pull_request.title }} + PR_BODY: | + ${{ github.event.pull_request.body }} + run: | + print-commit-message() { + echo "${PR_TITLE:?}" + if test -n "${PR_BODY}"; then + echo "" + echo "${PR_BODY}" + fi + } + # Output commit message + { + echo "content<> "${GITHUB_OUTPUT}" + + commit-linter: + runs-on: ubuntu-latest + needs: + - commit-message + steps: + - &checkout-repository-step + name: Checkout repository + uses: actions/checkout@v4 + with: + sparse-checkout: | + .github/actions + configs + - &prepare-commit-message-step + name: Prepare commit message + run: | + echo -n '${{ needs.commit-message.outputs.content }}' > "${{ env.COMMIT_MESSAGE_FILE }}" + - name: Install commit style linter + uses: ./.github/actions/setup-committed + - name: Run commit style linter + run: | + echo "Linting commit message:" + cat "${{ env.COMMIT_MESSAGE_FILE }}" | sed 's/^/> /' + echo "" + committed -vv --color=always \ + --config ./configs/committed.toml \ + --commit-file "${{ env.COMMIT_MESSAGE_FILE }}" + echo "DONE: PR follows the required naming conventions." + + spell-checker: + runs-on: ubuntu-latest + needs: + - commit-message + steps: + - *checkout-repository-step + - *prepare-commit-message-step + - name: Run spell checker + uses: ./.github/actions/check-typos + with: + files: ${{ env.COMMIT_MESSAGE_FILE }}