Skip to content

ci: bump cozyvalues-gen pin to v1.5.0 - #2730

Merged
Aleksei Sviridkin (lexfrei) merged 1 commit into
mainfrom
ci/bump-cozyvalues-gen-v1.5.0
May 25, 2026
Merged

ci: bump cozyvalues-gen pin to v1.5.0#2730
Aleksei Sviridkin (lexfrei) merged 1 commit into
mainfrom
ci/bump-cozyvalues-gen-v1.5.0

Conversation

@lexfrei

@lexfrei Aleksei Sviridkin (lexfrei) commented May 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Bump the cozyvalues-gen binary pinned in .github/workflows/pre-commit.yml from v1.4.0 to v1.5.0.

v1.5.0 (cozystack/cozyvalues-gen#24) adds support for the @immutable annotation. Without this bump, pre-commit re-runs make generate with the old v1.4.0 binary on every PR; the old binary silently ignores ## @immutable directives and regenerates values.schema.json / embedded openAPISchema without the corresponding x-kubernetes-validations entries — which then shows up as committed-vs-regenerated drift on any PR that tries to use the new annotation.

No-op for main today

No chart on main currently uses @immutable (zero hits for ## @immutable under packages/apps/*/values.yaml), so this bump regenerates byte-identical output. The change is purely lifting the floor for downstream PRs that will start using the annotation.

Unblocks

Release info

Summary by CodeRabbit

  • Chores
    • Updated development tooling dependencies for build process improvements.

Review Change Stack

v1.5.0 adds the @immutable annotation support
(cozystack/cozyvalues-gen#24). Without the bump, pre-commit re-runs
make generate with the v1.4.0 binary, silently strips any
x-kubernetes-validations entries that downstream PRs add to
values.schema.json / embedded openAPISchema, and reports drift against
the committed artefacts.

This is a no-op for the current main: no chart currently uses
@immutable, so regeneration with v1.5.0 produces identical output to
v1.4.0. Unblocks #2639 (apply @immutable to
storageClass across stateful apps).

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

@github-actions github-actions Bot added area/uncategorized PR auto-labeler could not map title scope to a known area/*; please review size/XS This PR changes 0-9 lines, ignoring generated files labels May 25, 2026
@dosubot dosubot Bot added the area/ci Issues or PRs related to CI workflows, GitHub Actions, automation label May 25, 2026
@coderabbitai

coderabbitai Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The pre-commit GitHub Actions workflow updates the cozyvalues-gen tool installation step to download release v1.5.0 instead of v1.4.0, a single-line dependency version bump in the CI configuration.

Changes

CI Dependency Update

Layer / File(s) Summary
cozyvalues-gen version bump
.github/workflows/pre-commit.yml
The cozyvalues-gen download URL in the pre-commit workflow install step is updated from v1.4.0 to v1.5.0.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested labels

area/ci

Suggested reviewers

  • myasnikovdaniil
  • sircthulhu
  • kvaps

Poem

🐰 A version bump so lean and small,
From 1.4.0, we heed the call,
To 1.5.0, fresh and bright,
The pre-commit workflow shines with might! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'ci: bump cozyvalues-gen pin to v1.5.0' clearly and concisely summarizes the main change: updating the pinned version of cozyvalues-gen in the CI workflow from v1.4.0 to v1.5.0.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/bump-cozyvalues-gen-v1.5.0

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/pre-commit.yml:
- Line 50: Replace the current piped download+extract of cozyvalues-gen (the
line using curl ... | tar -xzvf- -C /usr/local/bin/ cozyvalues-gen) with a
two-step download-and-verify flow: download cozyvalues-gen-linux-amd64.tar.gz
and the matching cozyvalues-gen-checksums.txt (or compare against the pinned
SHA-256 9633527e6e51b918293f5282349e9e89142ae654d618f2287c04268cd366836f),
verify the tarball with sha256sum -c or by echoing the expected hash and
comparing before extraction, and only run tar -xzvf after the checksum
verification succeeds; update the workflow job that contains this curl|tar
command accordingly so the tarball is never extracted unless the checksum
matches.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 33d80758-c5f1-47a3-9626-76c43ebd83f4

📥 Commits

Reviewing files that changed from the base of the PR and between cb2f606 and 943441b.

📒 Files selected for processing (1)
  • .github/workflows/pre-commit.yml

- name: Install generate
run: |
curl -sSL https://github.com/cozystack/cozyvalues-gen/releases/download/v1.4.0/cozyvalues-gen-linux-amd64.tar.gz | tar -xzvf- -C /usr/local/bin/ cozyvalues-gen
curl -sSL https://github.com/cozystack/cozyvalues-gen/releases/download/v1.5.0/cozyvalues-gen-linux-amd64.tar.gz | tar -xzvf- -C /usr/local/bin/ cozyvalues-gen

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
release="v1.5.0"
base="https://github.com/cozystack/cozyvalues-gen/releases/download/${release}"
curl -fsSL "${base}/cozyvalues-gen-linux-amd64.tar.gz" -o /tmp/cozyvalues-gen-linux-amd64.tar.gz
sha256sum /tmp/cozyvalues-gen-linux-amd64.tar.gz
# If published by the release, fetch and inspect:
curl -fsSL "${base}/checksums.txt" -o /tmp/checksums.txt || true
[ -f /tmp/checksums.txt ] && grep -n "cozyvalues-gen-linux-amd64.tar.gz" /tmp/checksums.txt || true

Repository: cozystack/cozystack

Length of output: 113


🏁 Script executed:

#!/bin/bash
set -euo pipefail

release="v1.5.0"
base="https://github.com/cozystack/cozyvalues-gen/releases/download/${release}"
tarball="cozyvalues-gen-linux-amd64.tar.gz"
url="${base}/${tarball}"
tmp_tar="/tmp/${tarball}"

echo "== Downloading tarball =="
curl -fsSL "$url" -o "$tmp_tar"

echo "== Computing SHA-256 (try common tools) =="
if command -v sha256sum >/dev/null 2>&1; then
  sha256sum "$tmp_tar"
elif command -v shasum >/dev/null 2>&1; then
  shasum -a 256 "$tmp_tar"
elif command -v openssl >/dev/null 2>&1; then
  openssl dgst -sha256 "$tmp_tar"
else
  echo "No SHA-256 tool available (sha256sum/shasum/openssl missing)" >&2
  exit 1
fi

echo "== Looking for checksums files commonly published with releases =="
for f in checksums.txt checksum.txt checksums.sha256 checksums.sha256.txt SHA256SUMS SHA256SUMS.txt .sha256 .sha256.txt; do
  test_url="${base}/${f}"
  code="$(curl -sS -o /dev/null -w "%{http_code}" "$test_url" || true)"
  if [ "$code" = "200" ]; then
    echo "Found: $test_url"
    curl -fsSL "$test_url" -o "/tmp/${f}"
    echo "== Preview ($f) =="
    head -n 30 "/tmp/${f}" | sed 's/\r$//'
    if rg -n --fixed-string "$tarball" "/tmp/${f}" >/dev/null 2>&1; then
      echo "== Matching lines for $tarball in $f =="
      rg -n --fixed-string "$tarball" "/tmp/${f}" || true
    fi
    break
  fi
done

echo "== Also check for detached signatures (common) =="
for f in "$tarball.asc" "$tarball.sig"; do
  sig_url="${base}/${f}"
  code="$(curl -sS -o /dev/null -w "%{http_code}" "$sig_url" || true)"
  echo "$sig_url -> $code"
done

Repository: cozystack/cozystack

Length of output: 211


🏁 Script executed:

#!/bin/bash
set -euo pipefail

release="v1.5.0"
tarball="cozyvalues-gen-linux-amd64.tar.gz"
base="https://github.com/cozystack/cozyvalues-gen/releases/download/${release}"
url="${base}/${tarball}"
tmp_tar="/tmp/${tarball}"

echo "== Basic environment =="
command -v python3 || true
command -v jq || true
echo "== Downloading tarball =="
curl -fsSL "$url" -o "$tmp_tar"

echo "== Computing SHA-256 (via python) =="
python3 - <<'PY'
import hashlib, pathlib
p = pathlib.Path("/tmp/cozyvalues-gen-linux-amd64.tar.gz")
h = hashlib.sha256()
with p.open("rb") as f:
    for chunk in iter(lambda: f.read(1024*1024), b""):
        h.update(chunk)
print(h.hexdigest())
PY

echo "== Checking for common checksum files =="
for f in checksums.txt checksum.txt checksums.sha256 checksums.sha256.txt SHA256SUMS SHA256SUMS.txt .sha256 .sha256.txt; do
  test_url="${base}/${f}"
  code="$(curl -sS -o /dev/null -w "%{http_code}" "$test_url" || true)"
  if [ "$code" = "200" ]; then
    echo "Found: $test_url"
    curl -fsSL "$test_url" -o "/tmp/${f}"
    head -n 40 "/tmp/${f}" | sed 's/\r$//'
    echo "== Lines matching tarball =="
    rg -n --fixed-string "$tarball" "/tmp/${f}" || true
  fi
done

echo "== Checking release assets via GitHub API =="
api_url="https://api.github.com/repos/cozystack/cozyvalues-gen/releases/tags/${release}"
curl -fsSL "$api_url" -o /tmp/release.json
python3 - <<'PY'
import json, pathlib
data = json.loads(pathlib.Path("/tmp/release.json").read_text())
assets = data.get("assets", [])
print("asset_count:", len(assets))
for a in assets:
    name = a.get("name")
    u = a.get("browser_download_url")
    if any(k in (name or "").lower() for k in ["sha", "sum", "sig", "asc", "checksum"]):
        print(name, u)
PY

Repository: cozystack/cozystack

Length of output: 472


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# 1) Inspect workflow snippet around the install command
echo "== Workflow snippet =="
sed -n '35,70p' .github/workflows/pre-commit.yml | nl -ba

# 2) Download checksum file and verify tarball hash is present/matching
release="v1.5.0"
tarball="cozyvalues-gen-linux-amd64.tar.gz"
base="https://github.com/cozystack/cozyvalues-gen/releases/download/${release}"
checksum_file="cozyvalues-gen-checksums.txt"
checksum_url="${base}/${checksum_file}"

tmp_tar="/tmp/${tarball}"
tmp_checksums="/tmp/${checksum_file}"

echo "== Download tarball (if not present) =="
curl -fsSL "${base}/${tarball}" -o "$tmp_tar" >/dev/null

echo "== Download checksums file =="
curl -fsSL "$checksum_url" -o "$tmp_checksums"

echo "== Tarball SHA-256 =="
python3 - <<'PY'
import hashlib, pathlib
p = pathlib.Path("/tmp/cozyvalues-gen-linux-amd64.tar.gz")
h = hashlib.sha256()
with p.open("rb") as f:
    for chunk in iter(lambda: f.read(1024*1024), b""):
        h.update(chunk)
print(h.hexdigest())
PY

echo "== Search checksum file for tarball =="
rg -n --fixed-string "$tarball" "$tmp_checksums" || true

echo "== If checksum file format is hash+filename, extract the hash =="
python3 - <<'PY'
import re, pathlib
tarball="cozyvalues-gen-linux-amd64.tar.gz"
text=pathlib.Path("/tmp/cozyvalues-gen-checksums.txt").read_text(errors="replace").splitlines()
pat=re.compile(r'^\s*([0-9a-fA-F]{64})\s+.*'+re.escape(tarball)+r'\s*$')
for line in text:
    m=pat.match(line)
    if m:
        print("matched_sha256:", m.group(1))
        break
else:
    print("matched_sha256: not found (unknown checksums.txt format)")
PY

Repository: cozystack/cozystack

Length of output: 147


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Find workflow line containing cozyvalues-gen-linux-amd64.tar.gz =="
rg -n --fixed-string "cozyvalues-gen-linux-amd64.tar.gz" .github/workflows/pre-commit.yml

echo "== Print surrounding lines with line numbers (40-60) =="
python3 - <<'PY'
from pathlib import Path
p = Path(".github/workflows/pre-commit.yml")
lines = p.read_text().splitlines()
for i in range(35, 66):  # 1-based display
    if 1 <= i <= len(lines):
        print(f"{i}:{lines[i-1]}")
PY

echo "== Download checksum file and compare tarball SHA-256 =="
release="v1.5.0"
tarball="cozyvalues-gen-linux-amd64.tar.gz"
base="https://github.com/cozystack/cozyvalues-gen/releases/download/${release}"
checksum_file="cozyvalues-gen-checksums.txt"
checksum_url="${base}/${checksum_file}"

tmp_tar="/tmp/${tarball}"
tmp_checksums="/tmp/${checksum_file}"

curl -fsSL "${base}/${tarball}" -o "$tmp_tar"
curl -fsSL "$checksum_url" -o "$tmp_checksums"

python3 - <<'PY'
import hashlib, pathlib, re
tarball="cozyvalues-gen-linux-amd64.tar.gz"
tar=pathlib.Path("/tmp/"+tarball)
h=hashlib.sha256(tar.read_bytes()).hexdigest()
print("computed_sha256:", h)

text=pathlib.Path("/tmp/cozyvalues-gen-checksums.txt").read_text(errors="replace").splitlines()

# Try common formats: "<sha>  <filename>" or "<filename> : <sha>"
sha_from_file=None
for line in text:
    line=line.strip()
    m=re.match(r'^([0-9a-fA-F]{64})\s+\*?'+re.escape(tarball)+r'\s*$', line)
    if m:
        sha_from_file=m.group(1); break
    m=re.search(r''+re.escape(tarball)+r'.*?\b([0-9a-fA-F]{64})\b', line)
    if m:
        sha_from_file=m.group(1); break

print("sha_in_checksums:", sha_from_file)
if sha_from_file:
    print("sha_match:", sha_from_file.lower()==h.lower())
else:
    print("sha_match: unknown (could not parse checksums file)")
PY

echo "== Show checksum-file lines that mention the tarball =="
rg -n --fixed-string "$tarball" "$tmp_checksums" || true

Repository: cozystack/cozystack

Length of output: 599


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Find workflow line containing cozyvalues-gen-linux-amd64.tar.gz =="
rg -n --fixed-strings "cozyvalues-gen-linux-amd64.tar.gz" .github/workflows/pre-commit.yml

echo "== Print workflow lines around the match (40-70) =="
python3 - <<'PY'
from pathlib import Path
p = Path(".github/workflows/pre-commit.yml")
lines = p.read_text().splitlines()
start, end = 40, 70
for i in range(start, min(end, len(lines)) + 1):
    print(f"{i}:{lines[i-1]}")
PY

echo "== Download checksum file and compare tarball SHA-256 =="
release="v1.5.0"
tarball="cozyvalues-gen-linux-amd64.tar.gz"
base="https://github.com/cozystack/cozyvalues-gen/releases/download/${release}"
checksum_file="cozyvalues-gen-checksums.txt"

tmp_tar="/tmp/${tarball}"
tmp_checksums="/tmp/${checksum_file}"

curl -fsSL "${base}/${tarball}" -o "$tmp_tar"
curl -fsSL "${base}/${checksum_file}" -o "$tmp_checksums"

python3 - <<'PY'
import hashlib, pathlib, re
tarball="cozyvalues-gen-linux-amd64.tar.gz"
h=hashlib.sha256(pathlib.Path("/tmp/"+tarball).read_bytes()).hexdigest()
print("computed_sha256:", h)

text=pathlib.Path("/tmp/cozyvalues-gen-checksums.txt").read_text(errors="replace").splitlines()

sha_from_file=None
for line in text:
    l=line.strip()
    m=re.match(r'^([0-9a-fA-F]{64})\s+\*?'+re.escape(tarball)+r'\s*$', l)
    if m:
        sha_from_file=m.group(1); break
    m=re.search(re.escape(tarball)+r'.*?\b([0-9a-fA-F]{64})\b', l)
    if m:
        sha_from_file=m.group(1); break

print("sha_in_checksums:", sha_from_file)
print("sha_match:", sha_from_file.lower()==h.lower() if sha_from_file else "unknown")
PY

echo "== Show checksum-file lines that mention the tarball =="
rg -n --fixed-strings "$tarball" "$tmp_checksums" || true

Repository: cozystack/cozystack

Length of output: 1931


Verify cozyvalues-gen tarball integrity (pin SHA-256) before extraction.

Line 50 pipes a remote cozyvalues-gen-linux-amd64.tar.gz directly into tar without checksum/signature verification. The v1.5.0 release provides cozyvalues-gen-checksums.txt; the tarball SHA-256 is 9633527e6e51b918293f5282349e9e89142ae654d618f2287c04268cd366836f, but the workflow doesn’t validate it.

Suggested hardening change
       - name: Install generate
         run: |
-          curl -sSL https://github.com/cozystack/cozyvalues-gen/releases/download/v1.5.0/cozyvalues-gen-linux-amd64.tar.gz | tar -xzvf- -C /usr/local/bin/ cozyvalues-gen
+          set -euo pipefail
+          url="https://github.com/cozystack/cozyvalues-gen/releases/download/v1.5.0/cozyvalues-gen-linux-amd64.tar.gz"
+          tarball="/tmp/cozyvalues-gen-linux-amd64.tar.gz"
+          sha256="9633527e6e51b918293f5282349e9e89142ae654d618f2287c04268cd366836f"
+          curl -fsSL "$url" -o "$tarball"
+          echo "${sha256}  ${tarball}" | sha256sum -c -
+          tar -xzvf "$tarball" -C /usr/local/bin/ cozyvalues-gen
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
curl -sSL https://github.com/cozystack/cozyvalues-gen/releases/download/v1.5.0/cozyvalues-gen-linux-amd64.tar.gz | tar -xzvf- -C /usr/local/bin/ cozyvalues-gen
- name: Install generate
run: |
set -euo pipefail
url="https://github.com/cozystack/cozyvalues-gen/releases/download/v1.5.0/cozyvalues-gen-linux-amd64.tar.gz"
tarball="/tmp/cozyvalues-gen-linux-amd64.tar.gz"
sha256="9633527e6e51b918293f5282349e9e89142ae654d618f2287c04268cd366836f"
curl -fsSL "$url" -o "$tarball"
echo "${sha256} ${tarball}" | sha256sum -c -
tar -xzvf "$tarball" -C /usr/local/bin/ cozyvalues-gen
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/pre-commit.yml at line 50, Replace the current piped
download+extract of cozyvalues-gen (the line using curl ... | tar -xzvf- -C
/usr/local/bin/ cozyvalues-gen) with a two-step download-and-verify flow:
download cozyvalues-gen-linux-amd64.tar.gz and the matching
cozyvalues-gen-checksums.txt (or compare against the pinned SHA-256
9633527e6e51b918293f5282349e9e89142ae654d618f2287c04268cd366836f), verify the
tarball with sha256sum -c or by echoing the expected hash and comparing before
extraction, and only run tar -xzvf after the checksum verification succeeds;
update the workflow job that contains this curl|tar command accordingly so the
tarball is never extracted unless the checksum matches.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. One-line bump unblocks #2639 (the @immutable annotation rollout). Pre-commit and build are green; no chart on main uses @immutable yet so output is byte-identical.

@lexfrei
Aleksei Sviridkin (lexfrei) merged commit f36240a into main May 25, 2026
12 checks passed
@lexfrei
Aleksei Sviridkin (lexfrei) deleted the ci/bump-cozyvalues-gen-v1.5.0 branch May 25, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci Issues or PRs related to CI workflows, GitHub Actions, automation area/uncategorized PR auto-labeler could not map title scope to a known area/*; please review size/XS This PR changes 0-9 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants