fix(ci): honour a preset CHART_VERSION and sort chart tags explicitly - #5343
Open
gustavolira wants to merge 2 commits into
Open
fix(ci): honour a preset CHART_VERSION and sort chart tags explicitly#5343gustavolira wants to merge 2 commits into
gustavolira wants to merge 2 commits into
Conversation
On this branch CHART_VERSION was assigned unconditionally:
CHART_VERSION=$(get_chart_version "$CHART_MAJOR_VERSION")
The Gangway trigger passes an override through
MULTISTAGE_PARAM_OVERRIDE_CHART_VERSION, which reaches the script as
CHART_VERSION and is then overwritten on this line before anything reads
it. `--chart-version` has therefore been silently discarded on every
release-1.9 run, and the job resolved the newest chart on the branch
instead. main and release-1.10 already guard this with `-z`; this branch
never did.
Add the guard, and while here close the same gap those branches have: a
pinned image tag did not pin the chart either. `--tag 1.9-246` alone left
CHART_VERSION empty, so the newest chart was resolved regardless. The
image and the chart are published together under the same build number,
so a pinned TAG_NAME already determines the chart. Derive it, and log
that it was derived.
get_chart_version also took `.tags[0].name` from the quay API, which
assumes the response is ordered newest first. The request sets no sort
parameter, so that is an implicit dependency on undocumented behaviour.
Select the tags matching the CI chart shape and take max_by(.start_ts).
Verified against the live API: both the old and the new expression return
1.9-247-CI today.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
|
The container image build workflow finished with status: |
Two problems found reviewing this PR's own diff. Dropping the `grep` after jq lost the empty case: `max_by` over no matches yields null, and `jq -r` prints it as the string "null", so CHART_VERSION became "null". The old grep produced nothing there. Add `// empty`. A GA verification pins the image to x.y.z and passes no --chart-version, which fell through to the lookup and paired it with the newest CI chart - the same mismatch this PR fixes, for the other half of the flow. The chart repo publishes exact GA tags (1.9.8 exists), so map x.y.z to itself. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Contributor
|
The container image build workflow finished with status: |
nickboldt
reviewed
Sep 4, 2026
| @@ -1510,7 +1510,7 @@ get_previous_release_version() { | |||
| get_chart_version() { | |||
| local chart_major_version=$1 | |||
| curl -sSX GET "https://quay.io/api/v1/repository/rhdh/chart/tag/?onlyActiveTags=true&filter_tag_name=like:${chart_major_version}-" -H "Content-Type: application/json" \ | |||
Member
There was a problem hiding this comment.
can you add comment explaining that chart_major_version is actually in the form x.y (major.minor or stream) ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Companion to #5341 (
main) and #5342 (release-1.10). This branch carries a different and worse variant of the same problem, so this is not a straight cherry-pick.Problem
--chart-versionis silently discarded on this branchNo
-zguard. The Gangway trigger passes an override throughMULTISTAGE_PARAM_OVERRIDE_CHART_VERSION, which reaches the script asCHART_VERSIONand is overwritten on this line before anything reads it. Everyrelease-1.9run has resolved the newest chart on the branch regardless of what the operator asked for.mainandrelease-1.10already guard this; this branch never did.A pinned image tag does not pin the chart either
--tag 1.9-246alone leavesCHART_VERSIONempty, so the newest chart is resolved. The image and the chart are published together under the same build number, so a pinnedTAG_NAMEalready determines the chart.Chart tag selection depends on undocumented API ordering
The quay request sets no sort parameter, so taking
.tags[0]is an implicit dependency on the response happening to come back newest first.Fix
Add the
-nguard so a presetCHART_VERSIONwins. Derive it fromTAG_NAMEwhen the tag is pinned to a build number, and log that it was derived. Select the CI chart tags explicitly and takemax_by(.start_ts).--chart-version 1.9-246-CI--tag 1.9-246, no chart1.9-246-CI--tag 1.9Verification
Both the old and the new jq expression return
1.9-247-CIagainst the live API, so today's behaviour is unchanged while the dependency on response order is gone.shellcheck --severity=warningandyarn prettier:checkpass.Note on structure
get_chart_versionlives in.ci/pipelines/utils.shon this branch rather than.ci/pipelines/lib/helm.sh, and takes$CHART_MAJOR_VERSIONas an argument. The change is equivalent to the other two PRs, adapted to that shape.🤖 Generated with Claude Code