Open
Conversation
Signed-off-by: Stavros Foteinopoulos <stafot@gmail.com>
andrleite
approved these changes
Aug 28, 2025
Contributor
|
This PR has been automatically labelled "stale" because it hasn't had recent activity. |
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.
Summary
Fix chart-releaser index update failure when no new releases are detected
Problem
The Helm chart release pipeline fails when running on commits that don't introduce new chart versions, with the following error:
Root Cause Analysis
The issue occurs in the
update_index()function inscripts/release.shdue to the interaction between Git branch switching and untracked directories:The Failing Sequence
cr indexcommand creates.cr-index/index.yamlregardless of whether changes are detectedif [[ ! -d "$CR_INDEX_DIR" ]]- script continues because.cr-index/existsgit checkout gh-pagesswitches working directory from master to gh-pages.cr-index/during branch switch because:.gitignore(untracked by Git)cp --force .cr-index/index.yaml index.yaml- source file no longer existsWhy This Worked Previously
This is a conditional failure that only manifests when:
Index .cr-index/index.yaml did not change)Previous successful runs had actual new chart versions to release, where chart-releaser's behavior may have differed in preserving the directory through the process.
Evidence from Logs
Successful run (4 days ago):
Failed run (today):
Solution
Preserve the
index.yamlfile before the Git branch switch to eliminate dependency on the.cr-indexdirectory surviving Git operations:Code Changes
Complete Function Update
Why This Fix Works
Testing
The fix addresses the exact failure condition:
bash -n scripts/release.shpassesHistorical Context
This issue was introduced by the interaction between:
04ae8b7(Aug 2022): Migrated from CircleCI to GitHub Actions3944a73(Oct 2022): Added--skip-existingflag and directory check--skip-existingflag changes chart-releaser behavior for no-change scenariosThe previous fix in
3944a73only addressed the case where.cr-indexis never created, but missed the case where it's created then destroyed by Git operations.Impact
Files Changed
scripts/release.sh: Updatedupdate_index()function to preserve index file before branch operationsTicket Link
https://mattermost.atlassian.net/browse/CLD-9505