feat(ci): tie chart releases to app releases#31
Conversation
- Reset Chart.yaml version to 0.0.1 with explanatory comment - Update CHART_VERSION to use github.ref_name instead of Chart.yaml - Update helm-chart-oci-publisher to @17e4144d7ba68f7c3e8c16eece5aed15fd7c2dc8 🤖 Generated with [GitHub Copilot](https://github.com/features/copilot) (via Zed) Signed-off-by: Eric Searcy <eric@linuxfoundation.org>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughWorkflow now derives chart version from the Git tag (stripping a leading Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
Standardizes Helm chart release versioning so chart versions are derived from the Git tag (app release), reducing the need to manually bump Chart.yaml per release.
Changes:
- Resets the Helm chart
versionto a placeholder (0.0.1) with an explanatory comment. - Updates the tagged-release workflow to derive
CHART_VERSIONfromgithub.ref_nameinstead of readingChart.yaml. - Bumps the pinned
helm-chart-oci-publisheraction commit used to publish the chart.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
charts/lfx-v2-query-service/Chart.yaml |
Sets a placeholder chart version and documents that CI replaces it during release builds. |
.github/workflows/ko-build-tag.yaml |
Derives chart/app versions from the tag and updates the chart publisher action reference. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| APP_VERSION=$(echo ${{ github.ref_name }} | sed 's/v//g') | ||
| CHART_NAME="$(yq '.name' charts/*/Chart.yaml)" | ||
| CHART_VERSION="$(yq '.version' charts/*/Chart.yaml)" | ||
| CHART_VERSION=$(echo ${{ github.ref_name }} | sed 's/v//g') |
There was a problem hiding this comment.
Using sed 's/v//g' removes every "v" in the tag (e.g., v1.2.3-dev becomes 1.2.3-de), which can produce incorrect/invalid versions. Strip only a leading v (e.g., s/^v// or bash ${ref#v}) and consider reusing APP_VERSION for CHART_VERSION to avoid divergence.
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 |
There was a problem hiding this comment.
Inline comment spacing here is ... # v4 with only one space before #. With .yamllint extending the default rules, this typically violates the comments rule (min 2 spaces before an inline comment). Use two spaces before # (see .github/workflows/mega-linter.yml:28 for the existing style).
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 |
There was a problem hiding this comment.
Inline comment spacing here is ... # v4 with only one space before #. With .yamllint extending the default rules, this typically violates the comments rule (min 2 spaces before an inline comment). Use two spaces before # (consistent with other workflows like .github/workflows/mega-linter.yml:28).
| id: publish-ghcr | ||
| # yamllint disable-line rule:line-length | ||
| uses: linuxfoundation/lfx-public-workflows/.github/actions/helm-chart-oci-publisher@c465d6571fa0b8be9d551d902955164ea04a00af # main | ||
| uses: linuxfoundation/lfx-public-workflows/.github/actions/helm-chart-oci-publisher@17e4144d7ba68f7c3e8c16eece5aed15fd7c2dc8 # main |
There was a problem hiding this comment.
Inline comment spacing here is ... # main with only one space before #. With .yamllint extending the default rules, this typically violates the comments rule (min 2 spaces before an inline comment). Adjust to two spaces before # to match repo style and avoid linter findings.
|
|
||
| - name: Install Cosign | ||
| uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2 | ||
| uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2 |
There was a problem hiding this comment.
Inline comment spacing here is ... # v3.9.2 with only one space before #. With .yamllint extending the default rules, this typically violates the comments rule (min 2 spaces before an inline comment). Use two spaces before # to avoid yamllint warnings/errors.
|
|
||
| - name: Login to GitHub | ||
| uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 | ||
| uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 |
There was a problem hiding this comment.
Inline comment spacing here is ... # v3.4.0 with only one space before #. With .yamllint extending the default rules, this typically violates the comments rule (min 2 spaces before an inline comment). Use two spaces before # to match the linting configuration.
| set -euo pipefail | ||
| APP_VERSION=$(echo ${{ github.ref_name }} | sed 's/v//g') | ||
| CHART_NAME="$(yq '.name' charts/*/Chart.yaml)" | ||
| CHART_VERSION="$(yq '.version' charts/*/Chart.yaml)" | ||
| CHART_VERSION=$(echo ${{ github.ref_name }} | sed 's/v//g') |
There was a problem hiding this comment.
In the run script, ${{ github.ref_name }} is interpolated directly into the shell command without quotes. If a tag name contains shell metacharacters (e.g., $()), it could be interpreted by bash. Prefer using the runner-provided env var ($GITHUB_REF_NAME) and quote it (or assign it once) before processing, so it’s treated strictly as data.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.github/workflows/ko-build-tag.yaml:
- Around line 37-39: The pipeline currently strips all "v" characters using sed
's/v//g' which can mangle version strings; update the APP_VERSION assignment to
only remove a leading "v" (e.g., use a leading-anchor sed like s/^v//) and set
CHART_VERSION by reusing APP_VERSION instead of re-running sed, keeping
CHART_NAME logic unchanged.
| APP_VERSION=$(echo ${{ github.ref_name }} | sed 's/v//g') | ||
| CHART_NAME="$(yq '.name' charts/*/Chart.yaml)" | ||
| CHART_VERSION="$(yq '.version' charts/*/Chart.yaml)" | ||
| CHART_VERSION=$(echo ${{ github.ref_name }} | sed 's/v//g') |
There was a problem hiding this comment.
Strip only a leading “v” to avoid mangling version strings.
sed 's/v//g' removes every “v”, not just the prefix. Use a leading-only strip and reuse APP_VERSION for CHART_VERSION to avoid accidental changes.
🔧 Proposed fix
- APP_VERSION=$(echo ${{ github.ref_name }} | sed 's/v//g')
+ APP_VERSION=$(echo ${{ github.ref_name }} | sed 's/^v//')
CHART_NAME="$(yq '.name' charts/*/Chart.yaml)"
- CHART_VERSION=$(echo ${{ github.ref_name }} | sed 's/v//g')
+ CHART_VERSION="$APP_VERSION"🤖 Prompt for AI Agents
In @.github/workflows/ko-build-tag.yaml around lines 37 - 39, The pipeline
currently strips all "v" characters using sed 's/v//g' which can mangle version
strings; update the APP_VERSION assignment to only remove a leading "v" (e.g.,
use a leading-anchor sed like s/^v//) and set CHART_VERSION by reusing
APP_VERSION instead of re-running sed, keeping CHART_NAME logic unchanged.
Implements standardized chart release versioning for LFXV2-872.
Changes Applied
✅ Chart.yaml Updates:
0.4.10to0.0.1✅ Workflow Updates (
ko-build-tag.yaml):helm-chart-oci-publisherto@17e4144d7ba68f7c3e8c16eece5aed15fd7c2dc8CHART_VERSIONto usegithub.ref_nameinstead of reading from Chart.yaml:Benefits
Tracking
Related to LFXV2-872