Repository navigation
[ci] Fix escaping for gen_versions_map.sh script - #836
Conversation
WalkthroughThe update makes a minor but important change to a shell script. It modifies a conditional statement to prefix both sides of a string comparison with "x" to safely handle cases where the variable may be empty or unset. No other logic or exported entities are affected by this change. Changes
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
639ce00 to
f268d34
Compare
|
|
||
| # if commit is not HEAD, check if it's valid | ||
| if [ $commit != "HEAD" ]; then | ||
| if [ "$commit" != "HEAD" ]; then |
There was a problem hiding this comment.
This is a common pattern:
| if [ "$commit" != "HEAD" ]; then | |
| if [ "x$commit" != "xHEAD" ]; then |
Signed-off-by: kklinch0 <[email protected]>
f268d34 to
2def9f4
Compare
second attept of #836 fixes errors like this: - https://github.com/cozystack/cozystack/actions/runs/14591720553/job/40928276862?pr=835 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved reliability of version generation by handling empty or special values safely in the process. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
) Third attempt to fix #842 and #836 tested in https://github.com/cozystack/cozystack/actions/runs/14599981710/job/40955508728?pr=808 Signed-off-by: Andrei Kvapil <[email protected]> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Chores** - Improved GitHub Actions workflow to fetch full git history and tags during pre-commit checks. - **Refactor** - Updated script behavior to display error messages when version extraction from git fails, making troubleshooting easier. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Backport of #836 fixes errors like this: - https://github.com/cozystack/cozystack/actions/runs/14591720553/job/40928276862?pr=835 Improved reliability of version generation by handling empty or special values safely in the process. (cherry picked from commit 7a9a1fc) Signed-off-by: kklinch0 <[email protected]>
Backport of #836 fixes errors like this: - https://github.com/cozystack/cozystack/actions/runs/14591720553/job/40928276862?pr=835 Improved reliability of version generation by handling empty or special values safely in the process. (cherry picked from commit 7a9a1fc) Signed-off-by: kklinch0 <[email protected]> Signed-off-by: Nick Volynkin <[email protected]>
Backport of #836 fixes errors like this: ``` make: Entering directory '/home/runner/work/cozystack/cozystack/packages/apps' find . -maxdepth 2 -name Chart.yaml | awk -F/ '{print $2}' | while read i; do sed -i "s/^name: .*/name: $i/" "$i/Chart.yaml"; done ../../hack/gen_versions_map.sh ../../hack/gen_versions_map.sh: 34: [: !=: unexpected operator fatal: Needed a single revision make: *** [Makefile:17: gen-versions-map] Error 128 make: Leaving directory '/home/runner/work/cozystack/cozystack/packages/apps' ``` https://github.com/cozystack/cozystack/actions/runs/14591720553/job/40928276862?pr=835 Improved reliability of version generation by handling empty or special values safely in the process. (cherry picked from commit 7a9a1fc) Signed-off-by: Nick Volynkin <[email protected]>
second attept of #836 - Improved reliability of version generation by handling empty or special values safely in the process. (cherry picked from commit e505857) Signed-off-by: Nick Volynkin <[email protected]>
) Third attempt to fix #842 and #836 tested in https://github.com/cozystack/cozystack/actions/runs/14599981710/job/40955508728?pr=808 Signed-off-by: Andrei Kvapil <[email protected]> **Chores** - Improved GitHub Actions workflow to fetch full git history and tags during pre-commit checks. **Refactor** - Updated script behavior to display error messages when version extraction from git fails, making troubleshooting easier. (cherry picked from commit a6b02bf) Signed-off-by: Nick Volynkin <[email protected]>
Backport of #842 to release-v0.30 second attept of #836 - Improved reliability of version generation by handling empty or special values safely in the process. (cherry picked from commit e505857) Signed-off-by: Nick Volynkin <[email protected]>
) Backport of #845 to release-v0.30 Third attempt to fix #842 and #836 tested in https://github.com/cozystack/cozystack/actions/runs/14599981710/job/40955508728?pr=808 Signed-off-by: Andrei Kvapil <[email protected]> **Chores** - Improved GitHub Actions workflow to fetch full git history and tags during pre-commit checks. **Refactor** - Updated script behavior to display error messages when version extraction from git fails, making troubleshooting easier. (cherry picked from commit a6b02bf) Signed-off-by: Nick Volynkin <[email protected]>
Backport of #836 fixes errors like this: ``` make: Entering directory '/home/runner/work/cozystack/cozystack/packages/apps' find . -maxdepth 2 -name Chart.yaml | awk -F/ '{print $2}' | while read i; do sed -i "s/^name: .*/name: $i/" "$i/Chart.yaml"; done ../../hack/gen_versions_map.sh ../../hack/gen_versions_map.sh: 34: [: !=: unexpected operator fatal: Needed a single revision make: *** [Makefile:17: gen-versions-map] Error 128 make: Leaving directory '/home/runner/work/cozystack/cozystack/packages/apps' ``` https://github.com/cozystack/cozystack/actions/runs/14591720553/job/40928276862?pr=835 Improved reliability of version generation by handling empty or special values safely in the process. (cherry picked from commit 7a9a1fc) Signed-off-by: Nick Volynkin <[email protected]>
Backport of #842 to release-v0.30 second attept of #836 - Improved reliability of version generation by handling empty or special values safely in the process. (cherry picked from commit e505857) Signed-off-by: Nick Volynkin <[email protected]>
) Backport of #845 to release-v0.30 Third attempt to fix #842 and #836 tested in https://github.com/cozystack/cozystack/actions/runs/14599981710/job/40955508728?pr=808 Signed-off-by: Andrei Kvapil <[email protected]> **Chores** - Improved GitHub Actions workflow to fetch full git history and tags during pre-commit checks. **Refactor** - Updated script behavior to display error messages when version extraction from git fails, making troubleshooting easier. (cherry picked from commit a6b02bf) Signed-off-by: Nick Volynkin <[email protected]>
Backport of #836 fixes errors like this: ``` make: Entering directory '/home/runner/work/cozystack/cozystack/packages/apps' find . -maxdepth 2 -name Chart.yaml | awk -F/ '{print $2}' | while read i; do sed -i "s/^name: .*/name: $i/" "$i/Chart.yaml"; done ../../hack/gen_versions_map.sh ../../hack/gen_versions_map.sh: 34: [: !=: unexpected operator fatal: Needed a single revision make: *** [Makefile:17: gen-versions-map] Error 128 make: Leaving directory '/home/runner/work/cozystack/cozystack/packages/apps' ``` https://github.com/cozystack/cozystack/actions/runs/14591720553/job/40928276862?pr=835 Improved reliability of version generation by handling empty or special values safely in the process. (cherry picked from commit 7a9a1fc) Signed-off-by: Nick Volynkin <[email protected]>
Backport of #842 to release-v0.30 second attept of #836 - Improved reliability of version generation by handling empty or special values safely in the process. (cherry picked from commit e505857) Signed-off-by: Nick Volynkin <[email protected]>
) Backport of #845 to release-v0.30 Third attempt to fix #842 and #836 tested in https://github.com/cozystack/cozystack/actions/runs/14599981710/job/40955508728?pr=808 Signed-off-by: Andrei Kvapil <[email protected]> **Chores** - Improved GitHub Actions workflow to fetch full git history and tags during pre-commit checks. **Refactor** - Updated script behavior to display error messages when version extraction from git fails, making troubleshooting easier. (cherry picked from commit a6b02bf) Signed-off-by: Nick Volynkin <[email protected]>
Backport of #836 fixes errors like this: ``` make: Entering directory '/home/runner/work/cozystack/cozystack/packages/apps' find . -maxdepth 2 -name Chart.yaml | awk -F/ '{print $2}' | while read i; do sed -i "s/^name: .*/name: $i/" "$i/Chart.yaml"; done ../../hack/gen_versions_map.sh ../../hack/gen_versions_map.sh: 34: [: !=: unexpected operator fatal: Needed a single revision make: *** [Makefile:17: gen-versions-map] Error 128 make: Leaving directory '/home/runner/work/cozystack/cozystack/packages/apps' ``` https://github.com/cozystack/cozystack/actions/runs/14591720553/job/40928276862?pr=835 Improved reliability of version generation by handling empty or special values safely in the process. (cherry picked from commit 7a9a1fc) Signed-off-by: Nick Volynkin <[email protected]>
Backport of #842 to release-v0.30 second attept of #836 - Improved reliability of version generation by handling empty or special values safely in the process. (cherry picked from commit e505857) Signed-off-by: Nick Volynkin <[email protected]>
) Backport of #845 to release-v0.30 Third attempt to fix #842 and #836 tested in https://github.com/cozystack/cozystack/actions/runs/14599981710/job/40955508728?pr=808 Signed-off-by: Andrei Kvapil <[email protected]> **Chores** - Improved GitHub Actions workflow to fetch full git history and tags during pre-commit checks. **Refactor** - Updated script behavior to display error messages when version extraction from git fails, making troubleshooting easier. (cherry picked from commit a6b02bf) Signed-off-by: Nick Volynkin <[email protected]>
fixes errors like this:
Summary by CodeRabbit
Backported to v0.30 in #852