Skip to content

add helm package workflow#166

Merged
GatewayJ merged 2 commits into
rustfs:mainfrom
majinghe:ci/helm-package
Jul 9, 2026
Merged

add helm package workflow#166
GatewayJ merged 2 commits into
rustfs:mainfrom
majinghe:ci/helm-package

Conversation

@majinghe

@majinghe majinghe commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Type of Change

  • New Feature
  • Bug Fix
  • Documentation
  • Performance Improvement
  • Test/CI
  • Refactor
  • Other:

Related Issues

Summary of Changes

Checklist

  • I have read and followed the CONTRIBUTING.md guidelines
  • Passed make pre-commit (fmt-check + clippy + test + console-lint + console-fmt-check)
  • Added/updated necessary tests
  • Documentation updated (if needed)
  • CHANGELOG.md updated under [Unreleased] (if user-visible change)
  • CI/CD passed (if applicable)

Impact

  • Breaking change (CRD/API compatibility)
  • Requires doc/config/deployment update
  • Other impact:

Verification

make pre-commit

Additional Notes


Thank you for your contribution! Please ensure your PR follows the community standards (CODE_OF_CONDUCT.md) and sign the CLA if this is your first contribution.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a GitHub Actions workflow intended to package the repository’s Helm chart and publish the resulting chart archive + index to the rustfs/operator-helm-package repository after a successful Docker image release.

Changes:

  • Introduces .github/workflows/helm-package.yml to build a Helm chart package, upload it as an artifact, then publish it to a separate Helm package repository.
  • Adds manual dispatch support to publish a specific version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +35 to +41
if: |
github.event_name == 'workflow_dispatch' ||
(
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'push' &&
contains(github.event.workflow_run.head_branch, '.')
)
Comment thread .github/workflows/helm-package.yml Outdated
Comment on lines +51 to +69
- name: Normalize release version
id: version
run: |
set -eux

if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
RAW="${{ github.event.inputs.version }}"
else
RAW="${{ github.event.workflow_run.head_branch }}"
fi

case "$RAW" in
refs/tags/*)
RAW_TAG="${RAW#refs/tags/}"
;;
*)
RAW_TAG="$RAW"
;;
esac
Comment thread .github/workflows/helm-package.yml
Comment on lines +121 to +124
git config --global user.email "${{ secrets.EMAIL_ADDRESS }}"
git add .
git commit -m "Update rustfs helm package with ${{ needs.build-helm-package.outputs.app_version }}." || echo "No changes to commit"
git push origin main

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a956cf92e6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/helm-package.yml Outdated
github.event_name == 'workflow_dispatch' ||
(
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'push' &&

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Allow release workflow_run events to publish charts

The upstream .github/workflows/docker.yml workflow named Publish Docker Image is triggered by release and workflow_dispatch, not by push, so this condition filters out the successful Docker publish runs that should automatically publish the chart. In that release path, github.event.workflow_run.event is release, making build-helm-package skip entirely unless someone runs this workflow manually.

Useful? React with 👍 / 👎.


outputs:
raw_tag: ${{ steps.version.outputs.raw_tag }}
chart_version: ${{ steps.version.outputs.chart_version }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Set the chart_version output before using it

The Normalize release version step only assigns shell variables and never writes chart_version to $GITHUB_OUTPUT, so this job output resolves to an empty string on both manual and workflow_run executions. The later helm package --version "${{ steps.version.outputs.chart_version }}" then cannot package the requested release version.

Useful? React with 👍 / 👎.

Comment thread .github/workflows/helm-package.yml Outdated
- name: Replace chart version and app version
run: |
set -eux
sed -i -E 's/^version:.*/version: "${{ steps.version.outputs.chart_version }}"/' helm/rustfs/Chart.yaml

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update the existing chart path before packaging

Repo-wide search shows the chart lives at deploy/rustfs-operator/Chart.yaml, which is also the path packaged below, but this command edits helm/rustfs/Chart.yaml. Any run that reaches this step fails immediately with a missing file instead of producing the Helm artifact.

Useful? React with 👍 / 👎.


steps:
- name: Checkout helm chart repo
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Check out the Docker workflow's head SHA

For automatic workflow_run publishes, GitHub sets the follow-up workflow's GITHUB_SHA/GITHUB_REF to the default branch, and actions/checkout uses that triggering ref by default. That means a chart publish for an older release tag can package whatever is currently on main instead of the commit that the successful Docker workflow built, so the chart contents can drift from the released image unless this checkout pins github.event.workflow_run.head_sha or the release ref.

Useful? React with 👍 / 👎.

Comment on lines +82 to +84
helm package ./deploy/rustfs-operator \
--destination deploy/rustfs-operator/ \
--version "${{ steps.version.outputs.chart_version }}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Override appVersion when packaging releases

This package command only overrides the chart version; it never sets appVersion, so each published archive keeps the checked-in appVersion: "0.1.0". The chart templates emit .Chart.AppVersion as app.kubernetes.io/version, so installing a 1.0.0 chart would still label its resources as 0.1.0 unless the workflow also passes the release version as the app version.

Useful? React with 👍 / 👎.

Comment on lines +82 to +84
helm package ./deploy/rustfs-operator \
--destination deploy/rustfs-operator/ \
--version "${{ steps.version.outputs.chart_version }}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Pin the packaged chart to the released image tag

When users install one of these published chart versions without extra --set overrides, the packaged values.yaml still has operator.image.tag: latest, and the deployment template uses that value for the operator image. Since this workflow only changes the chart metadata before helm package, a versioned chart can deploy whatever latest points to instead of the Docker image version that just triggered the publish.

Useful? React with 👍 / 👎.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 5 comments.

# See the License for the specific language governing permissions and
# limitations under the License.

name: Publish helm chart to artifacthub
Comment on lines +75 to +79
- name: Replace chart version and app version
run: |
set -eux
sed -i -E 's/^version:.*/version: "${{ steps.version.outputs.chart_version }}"/' deploy/rustfs-operator/Chart.yaml

Comment on lines +118 to +120
- name: Generate index
run: helm repo index . --url https://operator.rustfs.com

Comment on lines +121 to +125
- name: Push helm package and index file
run: |
set -eux
git config --global user.name "${{ secrets.USERNAME }}"
git config --global user.email "${{ secrets.EMAIL_ADDRESS }}"
set -eux
git config --global user.name "${{ secrets.USERNAME }}"
git config --global user.email "${{ secrets.EMAIL_ADDRESS }}"
git add .
@GatewayJ GatewayJ added this pull request to the merge queue Jul 9, 2026
Merged via the queue into rustfs:main with commit d264fcd Jul 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants