feat: publish the Helm chart on release - #35
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
How is the internal one different from this? I was working on converting that one over here |
|
Hi @cigamit, thanks for the pointer. They are the same chart. So this PR does not write a chart. It rebrands what the generator already emits, which is the whole 7 line Makefile diff, and adds the missing The That leaves a choice rather than a difference: generate the chart here, or move your fork into |
There was a problem hiding this comment.
🟡 Changes recommended
The new publish workflow is not idempotent on reruns (can fail when there’s nothing to commit), and there are documentation/workflow clarity issues that should be corrected before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR adds an automated Helm chart publishing flow so each GitHub Release publishes a packaged chart asset and updates a Helm index.yaml served from the repo’s gh-pages branch, making the operator installable via helm repo add.
Changes:
- Adds a GitHub Actions workflow to package/upload the chart on release and regenerate/publish the Helm index on
gh-pages. - Renames Helm chart variables/paths from
awx-operatortoascender-operatorin the Makefile and ensureshelm-indexcan run standalone. - Updates Helm installation documentation and starter README links to point at this repository and chart.
File summaries
| File | Description |
|---|---|
.github/workflows/publish-helm.yaml |
New release/dispatch workflow to package the chart, upload it to the release, and publish updated index.yaml to gh-pages. |
Makefile |
Renames chart variables and updates Helm chart generation/packaging/index targets to use $(CHART_NAME). |
docs/installation/helm-install-on-existing-cluster.md |
Updates helm repo/install examples and explains how the chart index is produced from release assets. |
.helm/starter/README.md |
Updates chart README wording and links to refer to Ascender Operator and this repository. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| git add index.yaml | ||
| git commit -m "Update index.yaml for release ${TAG_NAME}" | ||
| git push origin gh-pages |
| run: | | ||
| echo "TAG_NAME=${{ github.event.release.tag_name }}" >> $GITHUB_ENV | ||
|
|
||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| $ helm install -n ascender --create-namespace my-ascender-operator ascender-operator/ascender-operator | ||
| NAME: my-ascender-operator | ||
| LAST DEPLOYED: Thu Feb 17 22:09:05 2022 | ||
| NAMESPACE: default |
|
gh-pages branch has been created. Github Pages has been configured to point to the branch. Just waiting on this PR to be corrected and we should be ready to go. |
The chart machinery inherited from awx-operator was never wired to a workflow here, so the chart could only be built by hand and there was no repository to install it from. A release now packages the chart, attaches it to the release, and refreshes index.yaml on the gh-pages branch, which makes the repository servable from GitHub Pages at https://ctrliq.github.io/ascender-operator. The chart is named ascender-operator and its image is the one this repository publishes.
87d8415 to
1735587
Compare
|
Rebased on
Ran the steps locally against a clone of this repository's
IMPORTANT @cigamit: one thing on the branch. |
Addresses ctrliq/ascender-install#181, which asks for an official Helm repository for the operator. Issues were disabled here when it was filed, so the request landed on the installer repo.
Problem
The chart machinery is all here already, inherited from awx-operator:
.helm/starter, and thehelm-chart,helm-packageandhelm-indextargets in the Makefile. Nothing calls it. The chart is still namedawx-operatorand points at the upstream repository, and no workflow publishes it, so there is no repository tohelm repo addand the operator can only be installed with kustomize.Change
Releases now publish the chart:
.github/workflows/publish-helm.yamlruns when a release is published, or on demand for a given tag. It packages the chart at the release version, attaches the tarball to the release, and refreshesindex.yamlon thegh-pagesbranch. The branch is created on the first run when it does not exist yet.ascender-operator, and the three places that spelledawx-operatorout use$(CHART_NAME)instead.helm-indexnow depends on thehelmtarget so it can be run on its own.The chart index lists each version with the URL of the tarball attached to that release, which is the layout the chart README already describes. Nothing about the generated manifests changes:
namePrefixstaysawx-operator-, so resource names inside the chart are the same as with kustomize.Once this merges, the repository needs GitHub Pages pointed at the
gh-pagesbranch, root folder, and the chart is then available with:Older releases have no chart attached, so
helm-indexskips them and the index starts at the first release published with this workflow.Testing
Run locally against this branch with
VERSION=0.0.0-test:make helm-chartgeneratescharts/ascender-operatorwith the CRDs incrds/and the operator manifests intemplates/make helm-packageproducesascender-operator-0.0.0-test.tgz, andhelm lintpasses on the charthelm templaterenders the deployment withimage: ghcr.io/ctrliq/ascender-operator:0.0.0-testmake helm-index CHART_OWNER=ctrliqskips the existing releases that carry no chart and writes an index whose entry URL ishttps://github.com/ctrliq/ascender-operator/releases/download/0.0.0-test/ascender-operator-0.0.0-test.tgzThe workflow itself has not run, since that needs a release in this repository.