From c2183e63c89da541223226f3ed4ba7ce1c7cd1f4 Mon Sep 17 00:00:00 2001 From: David Kegley Date: Wed, 30 Oct 2024 12:57:08 -0400 Subject: [PATCH 01/13] Add helm unittesting scaffolds --- .github/workflows/chart-test.yaml | 22 +++++++++++++ .gitignore | 5 +++ CONTRIBUTING.md | 13 ++++++++ .../tests/service-accounts_test.yaml | 32 +++++++++++++++++++ 4 files changed, 72 insertions(+) create mode 100644 charts/rstudio-connect/tests/service-accounts_test.yaml diff --git a/.github/workflows/chart-test.yaml b/.github/workflows/chart-test.yaml index f0e1712c..a46ab3e7 100644 --- a/.github/workflows/chart-test.yaml +++ b/.github/workflows/chart-test.yaml @@ -79,6 +79,28 @@ jobs: if: steps.ct-lint.outcome == 'failure' || steps.ct-lint-all.outcome == 'failure' run: exit 1 + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@v4.2.0 + with: + version: v3.6.3 + + - name: Install helm unittest plugin + run: helm plugin install --version v0.6.3 https://github.com/helm-unittest/helm-unittest.git + + - name: Run chart unit tests + run: | + for dir in $(ls -d charts/*/); do + helm unittest $dir + done + install: runs-on: ubuntu-latest steps: diff --git a/.gitignore b/.gitignore index fdc6c0f6..ba4ec178 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,10 @@ helm-docs charts/**/charts/ /*.values /.cr-release-packages + +# helm unittest plugin +__snapshot__ + bin/** !bin/README.md @@ -10,3 +14,4 @@ _site/ _publish.yml /.quarto/ + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4e2cdce7..7aeba09d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,6 +34,19 @@ We'll try to be as responsive as possible in reviewing and accepting pull reques - If `index.yaml` gets out of date on the repository, see [`./scripts/`](./scripts) for a workflow to fix +## Testing + +Running the [helm chart unit tests](https://github.com/helm-unittest/helm-unittest): + +``` +# install the unittest plugin +helm plugin install https://github.com/helm-unittest/helm-unittest.git + +# run the rstudio-connect chart unittests +# unit tests are defined in `charts/$CHART_NAME/tests` +helm unittest --color ./charts/rstudio-connect +``` + ## Templates The `rstudio-workbench` and `rstudio-connect` charts both make heavy use of the "templating" feature of the Posit Job diff --git a/charts/rstudio-connect/tests/service-accounts_test.yaml b/charts/rstudio-connect/tests/service-accounts_test.yaml new file mode 100644 index 00000000..9e68cc65 --- /dev/null +++ b/charts/rstudio-connect/tests/service-accounts_test.yaml @@ -0,0 +1,32 @@ +suite: Connect Service Accounts +templates: + - configmap.yaml + - configmap-prestart.yaml + - deployment.yaml +tests: + - it: should set the Connect pod service account when the launcher is enabled + template: deployment.yaml + set: + launcher: + enabled: true + rbac: + create: true + serviceAccount: + name: "connect-service-account" + asserts: + - equal: + path: "spec.template.spec.serviceAccountName" + value: "connect-service-account" + - it: should set the Connect pod service account when the launcher is not enabled + template: deployment.yaml + set: + launcher: + enabled: false + rbac: + create: true + serviceAccount: + name: "connect-service-account" + asserts: + - equal: + path: "spec.template.spec.serviceAccountName" + value: "connect-service-account" From edff9fdd1b75f7d06acbe49331014160cefa7442 Mon Sep 17 00:00:00 2001 From: David Kegley Date: Wed, 30 Oct 2024 13:05:18 -0400 Subject: [PATCH 02/13] Install chart dependencies before running tests --- .github/workflows/chart-test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/chart-test.yaml b/.github/workflows/chart-test.yaml index a46ab3e7..91741df1 100644 --- a/.github/workflows/chart-test.yaml +++ b/.github/workflows/chart-test.yaml @@ -98,6 +98,7 @@ jobs: - name: Run chart unit tests run: | for dir in $(ls -d charts/*/); do + pushd $dir; helm dependencies update; popd helm unittest $dir done From edda2b0f81af6ed0bf88612617d14205c52c0c6e Mon Sep 17 00:00:00 2001 From: David Kegley Date: Wed, 30 Oct 2024 14:00:30 -0400 Subject: [PATCH 03/13] Bump chart version, add slack alerting --- .github/workflows/chart-test.yaml | 27 +++++++++++++++++++++++++++ charts/rstudio-connect/Chart.yaml | 2 +- charts/rstudio-connect/NEWS.md | 4 ++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/.github/workflows/chart-test.yaml b/.github/workflows/chart-test.yaml index 91741df1..20d46398 100644 --- a/.github/workflows/chart-test.yaml +++ b/.github/workflows/chart-test.yaml @@ -96,11 +96,38 @@ jobs: run: helm plugin install --version v0.6.3 https://github.com/helm-unittest/helm-unittest.git - name: Run chart unit tests + id: unittest run: | for dir in $(ls -d charts/*/); do pushd $dir; helm dependencies update; popd helm unittest $dir done + continue-on-error: true + + - name: Notify Slack of chart unittest failure + if: steps.unittest.outcome == 'failure' + uses: slackapi/slack-github-action@v1.27.0 + with: + payload-delimiter: "_" + payload: | + { + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "Chart unit tests failed. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + } + } + ] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK + + - name: Fail the workflow if failed unittest + if: steps.unittest.outcome == 'failure' + run: exit 1 install: runs-on: ubuntu-latest diff --git a/charts/rstudio-connect/Chart.yaml b/charts/rstudio-connect/Chart.yaml index 14b4ec2e..ba49a968 100644 --- a/charts/rstudio-connect/Chart.yaml +++ b/charts/rstudio-connect/Chart.yaml @@ -1,6 +1,6 @@ name: rstudio-connect description: Official Helm chart for Posit Connect -version: 0.7.12 +version: 0.7.13 apiVersion: v2 appVersion: 2024.09.0 icon: https://rstudio.com/wp-content/uploads/2018/10/RStudio-Logo-Flat.png diff --git a/charts/rstudio-connect/NEWS.md b/charts/rstudio-connect/NEWS.md index a90e0d6e..f55b69f0 100644 --- a/charts/rstudio-connect/NEWS.md +++ b/charts/rstudio-connect/NEWS.md @@ -1,5 +1,9 @@ # Changelog +## 0.7.13 + +- Add initial set of chart unit tests + ## 0.7.12 - Fix a bug where `rbac.serviceAccount.name` was not applied when the job launcher is enabled. From 605581b0c9888ee5beb6cf90e4837f18731e671b Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 30 Oct 2024 18:01:36 +0000 Subject: [PATCH 04/13] Update helm-docs and README.md --- charts/rstudio-connect/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/rstudio-connect/README.md b/charts/rstudio-connect/README.md index 8ea201a6..c279d655 100644 --- a/charts/rstudio-connect/README.md +++ b/charts/rstudio-connect/README.md @@ -1,6 +1,6 @@ # Posit Connect -![Version: 0.7.12](https://img.shields.io/badge/Version-0.7.12-informational?style=flat-square) ![AppVersion: 2024.09.0](https://img.shields.io/badge/AppVersion-2024.09.0-informational?style=flat-square) +![Version: 0.7.13](https://img.shields.io/badge/Version-0.7.13-informational?style=flat-square) ![AppVersion: 2024.09.0](https://img.shields.io/badge/AppVersion-2024.09.0-informational?style=flat-square) #### _Official Helm chart for Posit Connect_ @@ -30,11 +30,11 @@ To ensure reproducibility in your environment and insulate yourself from future ## Installing the chart -To install the chart with the release name `my-release` at version 0.7.12: +To install the chart with the release name `my-release` at version 0.7.13: ```{.bash} helm repo add rstudio https://helm.rstudio.com -helm upgrade --install my-release rstudio/rstudio-connect --version=0.7.12 +helm upgrade --install my-release rstudio/rstudio-connect --version=0.7.13 ``` To explore other chart versions, look at: From e5416824bcb79bedc906ab7ed5e621fbf497a428 Mon Sep 17 00:00:00 2001 From: David Kegley Date: Wed, 30 Oct 2024 15:40:40 -0400 Subject: [PATCH 05/13] Add tests/ directory to .helmignore for all charts; revert chart version bump --- charts/posit-chronicle/.helmignore | 3 +++ charts/rstudio-connect/.helmignore | 26 ++++++++++++++++++++++++ charts/rstudio-connect/Chart.yaml | 2 +- charts/rstudio-connect/NEWS.md | 4 ---- charts/rstudio-launcher-rbac/.helmignore | 3 +++ charts/rstudio-library/.helmignore | 3 +++ charts/rstudio-pm/.helmignore | 26 ++++++++++++++++++++++++ charts/rstudio-workbench/.helmignore | 3 +++ 8 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 charts/rstudio-connect/.helmignore create mode 100644 charts/rstudio-pm/.helmignore diff --git a/charts/posit-chronicle/.helmignore b/charts/posit-chronicle/.helmignore index 0e8a0eb3..f70705f1 100644 --- a/charts/posit-chronicle/.helmignore +++ b/charts/posit-chronicle/.helmignore @@ -21,3 +21,6 @@ .idea/ *.tmproj .vscode/ + +# chart tests +tests/ diff --git a/charts/rstudio-connect/.helmignore b/charts/rstudio-connect/.helmignore new file mode 100644 index 00000000..f70705f1 --- /dev/null +++ b/charts/rstudio-connect/.helmignore @@ -0,0 +1,26 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ + +# chart tests +tests/ diff --git a/charts/rstudio-connect/Chart.yaml b/charts/rstudio-connect/Chart.yaml index ba49a968..14b4ec2e 100644 --- a/charts/rstudio-connect/Chart.yaml +++ b/charts/rstudio-connect/Chart.yaml @@ -1,6 +1,6 @@ name: rstudio-connect description: Official Helm chart for Posit Connect -version: 0.7.13 +version: 0.7.12 apiVersion: v2 appVersion: 2024.09.0 icon: https://rstudio.com/wp-content/uploads/2018/10/RStudio-Logo-Flat.png diff --git a/charts/rstudio-connect/NEWS.md b/charts/rstudio-connect/NEWS.md index f55b69f0..a90e0d6e 100644 --- a/charts/rstudio-connect/NEWS.md +++ b/charts/rstudio-connect/NEWS.md @@ -1,9 +1,5 @@ # Changelog -## 0.7.13 - -- Add initial set of chart unit tests - ## 0.7.12 - Fix a bug where `rbac.serviceAccount.name` was not applied when the job launcher is enabled. diff --git a/charts/rstudio-launcher-rbac/.helmignore b/charts/rstudio-launcher-rbac/.helmignore index 0e8a0eb3..f70705f1 100644 --- a/charts/rstudio-launcher-rbac/.helmignore +++ b/charts/rstudio-launcher-rbac/.helmignore @@ -21,3 +21,6 @@ .idea/ *.tmproj .vscode/ + +# chart tests +tests/ diff --git a/charts/rstudio-library/.helmignore b/charts/rstudio-library/.helmignore index 0e8a0eb3..f70705f1 100644 --- a/charts/rstudio-library/.helmignore +++ b/charts/rstudio-library/.helmignore @@ -21,3 +21,6 @@ .idea/ *.tmproj .vscode/ + +# chart tests +tests/ diff --git a/charts/rstudio-pm/.helmignore b/charts/rstudio-pm/.helmignore new file mode 100644 index 00000000..f70705f1 --- /dev/null +++ b/charts/rstudio-pm/.helmignore @@ -0,0 +1,26 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ + +# chart tests +tests/ diff --git a/charts/rstudio-workbench/.helmignore b/charts/rstudio-workbench/.helmignore index ed4080b1..1cbd52de 100644 --- a/charts/rstudio-workbench/.helmignore +++ b/charts/rstudio-workbench/.helmignore @@ -1,3 +1,6 @@ snapshot/ Makefile *.gotmpl + +# chart tests +tests/ From d49b78bd14f9eb65c5a3a9ea1c341cd89ea587fb Mon Sep 17 00:00:00 2001 From: David Kegley Date: Wed, 30 Oct 2024 15:49:24 -0400 Subject: [PATCH 06/13] Revert helmignore changes for other charts --- charts/posit-chronicle/.helmignore | 3 --- charts/rstudio-launcher-rbac/.helmignore | 3 --- charts/rstudio-library/.helmignore | 3 --- charts/rstudio-pm/.helmignore | 26 ------------------------ charts/rstudio-workbench/.helmignore | 3 --- 5 files changed, 38 deletions(-) delete mode 100644 charts/rstudio-pm/.helmignore diff --git a/charts/posit-chronicle/.helmignore b/charts/posit-chronicle/.helmignore index f70705f1..0e8a0eb3 100644 --- a/charts/posit-chronicle/.helmignore +++ b/charts/posit-chronicle/.helmignore @@ -21,6 +21,3 @@ .idea/ *.tmproj .vscode/ - -# chart tests -tests/ diff --git a/charts/rstudio-launcher-rbac/.helmignore b/charts/rstudio-launcher-rbac/.helmignore index f70705f1..0e8a0eb3 100644 --- a/charts/rstudio-launcher-rbac/.helmignore +++ b/charts/rstudio-launcher-rbac/.helmignore @@ -21,6 +21,3 @@ .idea/ *.tmproj .vscode/ - -# chart tests -tests/ diff --git a/charts/rstudio-library/.helmignore b/charts/rstudio-library/.helmignore index f70705f1..0e8a0eb3 100644 --- a/charts/rstudio-library/.helmignore +++ b/charts/rstudio-library/.helmignore @@ -21,6 +21,3 @@ .idea/ *.tmproj .vscode/ - -# chart tests -tests/ diff --git a/charts/rstudio-pm/.helmignore b/charts/rstudio-pm/.helmignore deleted file mode 100644 index f70705f1..00000000 --- a/charts/rstudio-pm/.helmignore +++ /dev/null @@ -1,26 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ - -# chart tests -tests/ diff --git a/charts/rstudio-workbench/.helmignore b/charts/rstudio-workbench/.helmignore index 1cbd52de..ed4080b1 100644 --- a/charts/rstudio-workbench/.helmignore +++ b/charts/rstudio-workbench/.helmignore @@ -1,6 +1,3 @@ snapshot/ Makefile *.gotmpl - -# chart tests -tests/ From a290c2018216d36c9b156ac86a06d1c25e9deee8 Mon Sep 17 00:00:00 2001 From: David Kegley Date: Wed, 30 Oct 2024 15:50:12 -0400 Subject: [PATCH 07/13] Bump rstudio-connect chart version --- charts/rstudio-connect/Chart.yaml | 2 +- charts/rstudio-connect/NEWS.md | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/charts/rstudio-connect/Chart.yaml b/charts/rstudio-connect/Chart.yaml index 14b4ec2e..ba49a968 100644 --- a/charts/rstudio-connect/Chart.yaml +++ b/charts/rstudio-connect/Chart.yaml @@ -1,6 +1,6 @@ name: rstudio-connect description: Official Helm chart for Posit Connect -version: 0.7.12 +version: 0.7.13 apiVersion: v2 appVersion: 2024.09.0 icon: https://rstudio.com/wp-content/uploads/2018/10/RStudio-Logo-Flat.png diff --git a/charts/rstudio-connect/NEWS.md b/charts/rstudio-connect/NEWS.md index a90e0d6e..fcd40905 100644 --- a/charts/rstudio-connect/NEWS.md +++ b/charts/rstudio-connect/NEWS.md @@ -1,5 +1,9 @@ # Changelog +## 0.7.13 + +- Add initial set of helm unit tests. + ## 0.7.12 - Fix a bug where `rbac.serviceAccount.name` was not applied when the job launcher is enabled. From 281b263adcb897e95cb1624e81b73116189f4253 Mon Sep 17 00:00:00 2001 From: David Kegley Date: Wed, 30 Oct 2024 16:05:08 -0400 Subject: [PATCH 08/13] Add helm unit tests scaffolding and bump all chart versions --- charts/posit-chronicle/.helmignore | 3 +++ charts/posit-chronicle/Chart.yaml | 2 +- charts/posit-chronicle/NEWS.md | 4 ++++ charts/rstudio-launcher-rbac/.helmignore | 3 +++ charts/rstudio-launcher-rbac/Chart.yaml | 2 +- charts/rstudio-launcher-rbac/NEWS.md | 4 ++++ charts/rstudio-library/.helmignore | 3 +++ charts/rstudio-library/Chart.yaml | 4 ++-- charts/rstudio-library/NEWS.md | 4 ++++ charts/rstudio-pm/.helmignore | 26 ++++++++++++++++++++++++ charts/rstudio-pm/Chart.yaml | 2 +- charts/rstudio-pm/NEWS.md | 4 ++++ charts/rstudio-workbench/.helmignore | 3 +++ charts/rstudio-workbench/Chart.yaml | 2 +- charts/rstudio-workbench/NEWS.md | 4 ++++ 15 files changed, 64 insertions(+), 6 deletions(-) create mode 100644 charts/rstudio-pm/.helmignore diff --git a/charts/posit-chronicle/.helmignore b/charts/posit-chronicle/.helmignore index 0e8a0eb3..f70705f1 100644 --- a/charts/posit-chronicle/.helmignore +++ b/charts/posit-chronicle/.helmignore @@ -21,3 +21,6 @@ .idea/ *.tmproj .vscode/ + +# chart tests +tests/ diff --git a/charts/posit-chronicle/Chart.yaml b/charts/posit-chronicle/Chart.yaml index 79fa54bd..1833080b 100644 --- a/charts/posit-chronicle/Chart.yaml +++ b/charts/posit-chronicle/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: posit-chronicle description: Official Helm chart for Posit Chronicle Server -version: 0.3.3 +version: 0.3.4 appVersion: 2024.09.0 icon: https://rstudio.com/wp-content/uploads/2018/10/RStudio-Logo-Flat.png home: https://www.posit.co diff --git a/charts/posit-chronicle/NEWS.md b/charts/posit-chronicle/NEWS.md index fea0ba17..89d2215b 100644 --- a/charts/posit-chronicle/NEWS.md +++ b/charts/posit-chronicle/NEWS.md @@ -1,5 +1,9 @@ # Changelog +## 0.3.4 + +- Add helm unit test scaffold. + ## 0.3.3 - Move the values files for linting and installation testing outside the chart directory so that we can iterate on them without releasing a new version of the chart diff --git a/charts/rstudio-launcher-rbac/.helmignore b/charts/rstudio-launcher-rbac/.helmignore index 0e8a0eb3..f70705f1 100644 --- a/charts/rstudio-launcher-rbac/.helmignore +++ b/charts/rstudio-launcher-rbac/.helmignore @@ -21,3 +21,6 @@ .idea/ *.tmproj .vscode/ + +# chart tests +tests/ diff --git a/charts/rstudio-launcher-rbac/Chart.yaml b/charts/rstudio-launcher-rbac/Chart.yaml index f57389d8..503bc537 100644 --- a/charts/rstudio-launcher-rbac/Chart.yaml +++ b/charts/rstudio-launcher-rbac/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: rstudio-launcher-rbac description: RBAC definition for the RStudio Job Launcher type: application -version: 0.2.22 +version: 0.2.23 appVersion: 0.2.21 icon: https://rstudio.com/wp-content/uploads/2018/10/RStudio-Logo-Flat.png sources: diff --git a/charts/rstudio-launcher-rbac/NEWS.md b/charts/rstudio-launcher-rbac/NEWS.md index 76e0a2bc..6563e816 100644 --- a/charts/rstudio-launcher-rbac/NEWS.md +++ b/charts/rstudio-launcher-rbac/NEWS.md @@ -1,5 +1,9 @@ # Changelog +## 0.2.23 + +- Add helm unit test scaffold. + ## 0.2.22 - Move the values files for linting and installation testing outside the chart directory so that we can iterate on them without releasing a new version of the chart diff --git a/charts/rstudio-library/.helmignore b/charts/rstudio-library/.helmignore index 0e8a0eb3..f70705f1 100644 --- a/charts/rstudio-library/.helmignore +++ b/charts/rstudio-library/.helmignore @@ -21,3 +21,6 @@ .idea/ *.tmproj .vscode/ + +# chart tests +tests/ diff --git a/charts/rstudio-library/Chart.yaml b/charts/rstudio-library/Chart.yaml index 5be0c871..c497be93 100644 --- a/charts/rstudio-library/Chart.yaml +++ b/charts/rstudio-library/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: rstudio-library description: Helm library helpers for use by official RStudio charts type: library -version: 0.1.30 -appVersion: 0.1.30 +version: 0.1.31 +appVersion: 0.1.31 icon: https://rstudio.com/wp-content/uploads/2018/10/RStudio-Logo-Flat.png home: https://www.rstudio.com diff --git a/charts/rstudio-library/NEWS.md b/charts/rstudio-library/NEWS.md index 0e68647c..109c8828 100644 --- a/charts/rstudio-library/NEWS.md +++ b/charts/rstudio-library/NEWS.md @@ -1,5 +1,9 @@ # Changelog +## 0.1.31 + +- Add helm unit test scaffold. + ## 0.1.30 - Documentation site updates diff --git a/charts/rstudio-pm/.helmignore b/charts/rstudio-pm/.helmignore new file mode 100644 index 00000000..f70705f1 --- /dev/null +++ b/charts/rstudio-pm/.helmignore @@ -0,0 +1,26 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ + +# chart tests +tests/ diff --git a/charts/rstudio-pm/Chart.yaml b/charts/rstudio-pm/Chart.yaml index 1bf0b64d..142748dc 100644 --- a/charts/rstudio-pm/Chart.yaml +++ b/charts/rstudio-pm/Chart.yaml @@ -1,6 +1,6 @@ name: rstudio-pm description: Official Helm chart for Posit Package Manager -version: 0.5.39 +version: 0.5.40 apiVersion: v2 appVersion: 2024.08.2 icon: https://rstudio.com/wp-content/uploads/2018/10/RStudio-Logo-Flat.png diff --git a/charts/rstudio-pm/NEWS.md b/charts/rstudio-pm/NEWS.md index 8c4d696b..952dcbf0 100644 --- a/charts/rstudio-pm/NEWS.md +++ b/charts/rstudio-pm/NEWS.md @@ -1,5 +1,9 @@ # Changelog +## 0.5.40 + +- Add helm unit test scaffold. + ## 0.5.39 - Add the `fsGroupChangePolicy: "OnRootMismatch"` default option to the pod's `securityContext`. This will only ensure diff --git a/charts/rstudio-workbench/.helmignore b/charts/rstudio-workbench/.helmignore index ed4080b1..1cbd52de 100644 --- a/charts/rstudio-workbench/.helmignore +++ b/charts/rstudio-workbench/.helmignore @@ -1,3 +1,6 @@ snapshot/ Makefile *.gotmpl + +# chart tests +tests/ diff --git a/charts/rstudio-workbench/Chart.yaml b/charts/rstudio-workbench/Chart.yaml index e90f0a65..7ef4294a 100644 --- a/charts/rstudio-workbench/Chart.yaml +++ b/charts/rstudio-workbench/Chart.yaml @@ -1,6 +1,6 @@ name: rstudio-workbench description: Official Helm chart for Posit Workbench -version: 0.8.4 +version: 0.8.5 apiVersion: v2 appVersion: 2024.09.0 icon: https://rstudio.com/wp-content/uploads/2018/10/RStudio-Logo-Flat.png diff --git a/charts/rstudio-workbench/NEWS.md b/charts/rstudio-workbench/NEWS.md index 5b4d9e75..e8d4731f 100644 --- a/charts/rstudio-workbench/NEWS.md +++ b/charts/rstudio-workbench/NEWS.md @@ -1,5 +1,9 @@ # Changelog +## 0.8.5 + +- Add helm unit test scaffold. + ## 0.8.4 - Move the values files for linting and installation testing outside the chart directory so that we can iterate on them without releasing a new version of the chart From 67f9b65f14c2058d3766e66f3e7a64d83be29485 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 30 Oct 2024 20:06:20 +0000 Subject: [PATCH 09/13] Update helm-docs and README.md --- charts/posit-chronicle/README.md | 6 +++--- charts/rstudio-launcher-rbac/README.md | 6 +++--- charts/rstudio-library/README.md | 2 +- charts/rstudio-pm/README.md | 6 +++--- charts/rstudio-workbench/README.md | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/charts/posit-chronicle/README.md b/charts/posit-chronicle/README.md index e90511e2..8e1bbb5d 100644 --- a/charts/posit-chronicle/README.md +++ b/charts/posit-chronicle/README.md @@ -1,6 +1,6 @@ # Posit Chronicle -![Version: 0.3.3](https://img.shields.io/badge/Version-0.3.3-informational?style=flat-square) ![AppVersion: 2024.09.0](https://img.shields.io/badge/AppVersion-2024.09.0-informational?style=flat-square) +![Version: 0.3.4](https://img.shields.io/badge/Version-0.3.4-informational?style=flat-square) ![AppVersion: 2024.09.0](https://img.shields.io/badge/AppVersion-2024.09.0-informational?style=flat-square) #### _Official Helm chart for Posit Chronicle Server_ @@ -25,11 +25,11 @@ To ensure a stable production deployment: ## Installing the chart -To install the chart with the release name `my-release` at version 0.3.3: +To install the chart with the release name `my-release` at version 0.3.4: ```{.bash} helm repo add rstudio https://helm.rstudio.com -helm upgrade --install my-release rstudio/posit-chronicle --version=0.3.3 +helm upgrade --install my-release rstudio/posit-chronicle --version=0.3.4 ``` To explore other chart versions, look at: diff --git a/charts/rstudio-launcher-rbac/README.md b/charts/rstudio-launcher-rbac/README.md index 0aa9fdb9..de66cd4a 100644 --- a/charts/rstudio-launcher-rbac/README.md +++ b/charts/rstudio-launcher-rbac/README.md @@ -1,6 +1,6 @@ # rstudio-launcher-rbac -![Version: 0.2.22](https://img.shields.io/badge/Version-0.2.22-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.2.21](https://img.shields.io/badge/AppVersion-0.2.21-informational?style=flat-square) +![Version: 0.2.23](https://img.shields.io/badge/Version-0.2.23-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.2.21](https://img.shields.io/badge/AppVersion-0.2.21-informational?style=flat-square) #### _RBAC definition for the RStudio Job Launcher_ @@ -21,11 +21,11 @@ To ensure a stable production deployment: ## Installing the chart -To install the chart with the release name `my-release` at version 0.2.22: +To install the chart with the release name `my-release` at version 0.2.23: ```{.bash} helm repo add rstudio https://helm.rstudio.com -helm upgrade --install my-release rstudio/rstudio-launcher-rbac --version=0.2.22 +helm upgrade --install my-release rstudio/rstudio-launcher-rbac --version=0.2.23 ``` To explore other chart versions, look at: diff --git a/charts/rstudio-library/README.md b/charts/rstudio-library/README.md index 142c0114..eea6e619 100644 --- a/charts/rstudio-library/README.md +++ b/charts/rstudio-library/README.md @@ -1,6 +1,6 @@ # rstudio-library -![Version: 0.1.30](https://img.shields.io/badge/Version-0.1.30-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) ![AppVersion: 0.1.30](https://img.shields.io/badge/AppVersion-0.1.30-informational?style=flat-square) +![Version: 0.1.31](https://img.shields.io/badge/Version-0.1.31-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) ![AppVersion: 0.1.31](https://img.shields.io/badge/AppVersion-0.1.31-informational?style=flat-square) #### _Helm library helpers for use by official RStudio charts_ diff --git a/charts/rstudio-pm/README.md b/charts/rstudio-pm/README.md index 07295a29..a50067de 100644 --- a/charts/rstudio-pm/README.md +++ b/charts/rstudio-pm/README.md @@ -1,6 +1,6 @@ # Posit Package Manager -![Version: 0.5.39](https://img.shields.io/badge/Version-0.5.39-informational?style=flat-square) ![AppVersion: 2024.08.2](https://img.shields.io/badge/AppVersion-2024.08.2-informational?style=flat-square) +![Version: 0.5.40](https://img.shields.io/badge/Version-0.5.40-informational?style=flat-square) ![AppVersion: 2024.08.2](https://img.shields.io/badge/AppVersion-2024.08.2-informational?style=flat-square) #### _Official Helm chart for Posit Package Manager_ @@ -24,11 +24,11 @@ To ensure a stable production deployment: ## Installing the chart -To install the chart with the release name `my-release` at version 0.5.39: +To install the chart with the release name `my-release` at version 0.5.40: ```{.bash} helm repo add rstudio https://helm.rstudio.com -helm upgrade --install my-release rstudio/rstudio-pm --version=0.5.39 +helm upgrade --install my-release rstudio/rstudio-pm --version=0.5.40 ``` To explore other chart versions, look at: diff --git a/charts/rstudio-workbench/README.md b/charts/rstudio-workbench/README.md index 176fc569..413ba567 100644 --- a/charts/rstudio-workbench/README.md +++ b/charts/rstudio-workbench/README.md @@ -1,6 +1,6 @@ # Posit Workbench -![Version: 0.8.4](https://img.shields.io/badge/Version-0.8.4-informational?style=flat-square) ![AppVersion: 2024.09.0](https://img.shields.io/badge/AppVersion-2024.09.0-informational?style=flat-square) +![Version: 0.8.5](https://img.shields.io/badge/Version-0.8.5-informational?style=flat-square) ![AppVersion: 2024.09.0](https://img.shields.io/badge/AppVersion-2024.09.0-informational?style=flat-square) #### _Official Helm chart for Posit Workbench_ @@ -24,11 +24,11 @@ To ensure a stable production deployment: ## Installing the chart -To install the chart with the release name `my-release` at version 0.8.4: +To install the chart with the release name `my-release` at version 0.8.5: ```{.bash} helm repo add rstudio https://helm.rstudio.com -helm upgrade --install my-release rstudio/rstudio-workbench --version=0.8.4 +helm upgrade --install my-release rstudio/rstudio-workbench --version=0.8.5 ``` To explore other chart versions, look at: From fb28ac92b92e2b34dcd03e8ecb8a968fa94323c6 Mon Sep 17 00:00:00 2001 From: David Kegley Date: Wed, 30 Oct 2024 16:09:32 -0400 Subject: [PATCH 10/13] Bump library chart version in product charts --- charts/rstudio-connect/Chart.yaml | 2 +- charts/rstudio-launcher-rbac/Chart.yaml | 2 +- charts/rstudio-pm/Chart.yaml | 2 +- charts/rstudio-workbench/Chart.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/rstudio-connect/Chart.yaml b/charts/rstudio-connect/Chart.yaml index ba49a968..b58c27fc 100644 --- a/charts/rstudio-connect/Chart.yaml +++ b/charts/rstudio-connect/Chart.yaml @@ -13,7 +13,7 @@ maintainers: url: https://github.com/sol-eng dependencies: - name: rstudio-library - version: 0.1.30 + version: 0.1.31 repository: file://../rstudio-library annotations: artifacthub.io/images: | diff --git a/charts/rstudio-launcher-rbac/Chart.yaml b/charts/rstudio-launcher-rbac/Chart.yaml index 503bc537..26731ec5 100644 --- a/charts/rstudio-launcher-rbac/Chart.yaml +++ b/charts/rstudio-launcher-rbac/Chart.yaml @@ -13,7 +13,7 @@ maintainers: url: https://github.com/sol-eng dependencies: - name: rstudio-library - version: 0.1.30 + version: 0.1.31 repository: file://../rstudio-library keywords: - "data science" diff --git a/charts/rstudio-pm/Chart.yaml b/charts/rstudio-pm/Chart.yaml index 142748dc..d047eec3 100644 --- a/charts/rstudio-pm/Chart.yaml +++ b/charts/rstudio-pm/Chart.yaml @@ -14,7 +14,7 @@ maintainers: url: https://github.com/rstudio/helm dependencies: - name: rstudio-library - version: 0.1.30 + version: 0.1.31 repository: file://../rstudio-library annotations: artifacthub.io/images: | diff --git a/charts/rstudio-workbench/Chart.yaml b/charts/rstudio-workbench/Chart.yaml index 7ef4294a..8e2ea00f 100644 --- a/charts/rstudio-workbench/Chart.yaml +++ b/charts/rstudio-workbench/Chart.yaml @@ -13,7 +13,7 @@ maintainers: url: https://github.com/sol-eng dependencies: - name: rstudio-library - version: 0.1.30 + version: 0.1.31 repository: file://../rstudio-library annotations: artifacthub.io/images: | From d58fefe3a4295a969b0bf3dcd03f48f0d8e60bab Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 30 Oct 2024 20:11:49 +0000 Subject: [PATCH 11/13] Update rbac yaml --- .../rbac/rstudio-launcher-rbac-0.2.23.yaml | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 examples/rbac/rstudio-launcher-rbac-0.2.23.yaml diff --git a/examples/rbac/rstudio-launcher-rbac-0.2.23.yaml b/examples/rbac/rstudio-launcher-rbac-0.2.23.yaml new file mode 100644 index 00000000..3b322f8d --- /dev/null +++ b/examples/rbac/rstudio-launcher-rbac-0.2.23.yaml @@ -0,0 +1,88 @@ +--- +# Source: rstudio-launcher-rbac/templates/rbac.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: rstudio-launcher-rbac +--- +# Source: rstudio-launcher-rbac/templates/rbac.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: rstudio-launcher-rbac +rules: + - apiGroups: + - "" + resources: + - "serviceaccounts" + verbs: + - "list" + - apiGroups: + - "" + resources: + - "pods/log" + verbs: + - "get" + - "watch" + - "list" + - apiGroups: + - "" + resources: + - "pods" + - "pods/attach" + - "pods/exec" + verbs: + - "get" + - "create" + - "update" + - "patch" + - "watch" + - "list" + - "delete" + - apiGroups: + - "" + resources: + - "events" + verbs: + - "watch" + - apiGroups: + - "" + resources: + - "services" + verbs: + - "create" + - "get" + - "watch" + - "list" + - "delete" + - apiGroups: + - "batch" + resources: + - "jobs" + verbs: + - "create" + - "update" + - "patch" + - "get" + - "watch" + - "list" + - "delete" + - apiGroups: + - "metrics.k8s.io" + resources: + - "pods" + verbs: + - "get" +--- +# Source: rstudio-launcher-rbac/templates/rbac.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: rstudio-launcher-rbac +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: rstudio-launcher-rbac +subjects: + - kind: ServiceAccount + name: rstudio-launcher-rbac From 94728cd5339dd356b5602bbcbdbea0723e81011d Mon Sep 17 00:00:00 2001 From: David Kegley Date: Wed, 30 Oct 2024 16:16:15 -0400 Subject: [PATCH 12/13] Update helm chart lock for all product charts --- charts/rstudio-connect/Chart.lock | 6 +++--- charts/rstudio-launcher-rbac/Chart.lock | 6 +++--- charts/rstudio-pm/Chart.lock | 6 +++--- charts/rstudio-workbench/Chart.lock | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/charts/rstudio-connect/Chart.lock b/charts/rstudio-connect/Chart.lock index 0a3e8bb9..506d1dc9 100644 --- a/charts/rstudio-connect/Chart.lock +++ b/charts/rstudio-connect/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: rstudio-library repository: file://../rstudio-library - version: 0.1.30 -digest: sha256:dcf9d679b18cf99da3781b22797d639a2cbeb47b746dff7e7532b3e55261e938 -generated: "2024-05-15T19:57:52.620702-04:00" + version: 0.1.31 +digest: sha256:0eb384784157aa97191636a6da495adebef600647566c77a2a0642d3699fdffa +generated: "2024-10-30T16:15:51.145000005-04:00" diff --git a/charts/rstudio-launcher-rbac/Chart.lock b/charts/rstudio-launcher-rbac/Chart.lock index 134100c0..b149562b 100644 --- a/charts/rstudio-launcher-rbac/Chart.lock +++ b/charts/rstudio-launcher-rbac/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: rstudio-library repository: file://../rstudio-library - version: 0.1.30 -digest: sha256:dcf9d679b18cf99da3781b22797d639a2cbeb47b746dff7e7532b3e55261e938 -generated: "2024-05-15T19:57:55.735705-04:00" + version: 0.1.31 +digest: sha256:0eb384784157aa97191636a6da495adebef600647566c77a2a0642d3699fdffa +generated: "2024-10-30T16:15:51.566392274-04:00" diff --git a/charts/rstudio-pm/Chart.lock b/charts/rstudio-pm/Chart.lock index 82f8ef24..5d5da7eb 100644 --- a/charts/rstudio-pm/Chart.lock +++ b/charts/rstudio-pm/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: rstudio-library repository: file://../rstudio-library - version: 0.1.30 -digest: sha256:dcf9d679b18cf99da3781b22797d639a2cbeb47b746dff7e7532b3e55261e938 -generated: "2024-05-15T19:57:58.863614-04:00" + version: 0.1.31 +digest: sha256:0eb384784157aa97191636a6da495adebef600647566c77a2a0642d3699fdffa +generated: "2024-10-30T16:15:52.072362457-04:00" diff --git a/charts/rstudio-workbench/Chart.lock b/charts/rstudio-workbench/Chart.lock index f139bc12..c37328b9 100644 --- a/charts/rstudio-workbench/Chart.lock +++ b/charts/rstudio-workbench/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: rstudio-library repository: file://../rstudio-library - version: 0.1.30 -digest: sha256:dcf9d679b18cf99da3781b22797d639a2cbeb47b746dff7e7532b3e55261e938 -generated: "2024-05-15T19:58:02.13077-04:00" + version: 0.1.31 +digest: sha256:0eb384784157aa97191636a6da495adebef600647566c77a2a0642d3699fdffa +generated: "2024-10-30T16:15:52.507116664-04:00" From 50e101c593b44a335c0f4fe30d4c3185fcbbbd37 Mon Sep 17 00:00:00 2001 From: David Kegley Date: Thu, 31 Oct 2024 10:47:26 -0400 Subject: [PATCH 13/13] Add test justfile target --- CONTRIBUTING.md | 8 ++++++-- Justfile | 13 ++++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7aeba09d..929a8494 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,9 +42,13 @@ Running the [helm chart unit tests](https://github.com/helm-unittest/helm-unitte # install the unittest plugin helm plugin install https://github.com/helm-unittest/helm-unittest.git -# run the rstudio-connect chart unittests # unit tests are defined in `charts/$CHART_NAME/tests` -helm unittest --color ./charts/rstudio-connect + +# test all charts +just test + +# run unit tests for a single chart +just test rstudio-connect ``` ## Templates diff --git a/Justfile b/Justfile index 51653743..d12a4330 100644 --- a/Justfile +++ b/Justfile @@ -75,6 +75,17 @@ snapshot-rsw-diff: fi done +test chart='all': + #!/usr/bin/env bash + set -xe + if [[ "{{ chart }}" == 'all' ]]; then + for dir in $(ls -d {{ justfile_directory() }}/charts/*/); do + helm unittest $dir + done + else + helm unittest "charts/{{ chart }}" + fi + test-connect-interpreter-versions: #!/usr/bin/env bash set -xe @@ -118,4 +129,4 @@ push-docs: # The s3 bucket is s3://docs.rstudio.com/, which is available as https://docs.posit.co/ aws s3 sync ${s3_args[*]:-} \ _site \ - "s3://docs.rstudio.com/helm/" \ No newline at end of file + "s3://docs.rstudio.com/helm/"