From 68ebc46dbdc5f28fa1351019aa617c506d36ba88 Mon Sep 17 00:00:00 2001 From: Aleksei Sviridkin Date: Thu, 6 Nov 2025 13:36:47 +0300 Subject: [PATCH 1/3] feat(deployment): add revisionHistoryLimit parameter for rollback history control Add revisionHistoryLimit parameter to control how many old ReplicaSets are retained for rollback purposes, reducing etcd storage usage compared to Kubernetes default of 10. Changes: - Add revisionHistoryLimit parameter in values.yaml (default: 3) - Add revisionHistoryLimit to deployment.yaml spec - Provide comprehensive documentation with recommendations - Bump chart version 2.5.0 -> 2.5.1 (patch - minor enhancement) - Add changelog annotation for Artifact Hub Benefits: - Reduce etcd storage usage (especially important in large clusters) - Maintain reasonable rollback capability (3 previous versions) - Allow customization based on deployment needs - Can be set to null to use Kubernetes default (10) Default rationale: - 3 revisions provides sufficient rollback capability for most use cases - Reduces cluster resource usage (etcd storage, API server load) - Follows best practices from production Kubernetes deployments - Users can override if they need more history Example usage: # Use default (3 revisions) revisionHistoryLimit: 3 # Increase for critical deployments revisionHistoryLimit: 10 # Use Kubernetes default (10) revisionHistoryLimit: null # Disable history (not recommended) revisionHistoryLimit: 0 See: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#revision-history-limit Co-Authored-By: Claude Signed-off-by: Aleksei Sviridkin --- charts/jellyfin/Chart.yaml | 6 +++++- charts/jellyfin/templates/deployment.yaml | 3 +++ charts/jellyfin/values.yaml | 6 ++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/charts/jellyfin/Chart.yaml b/charts/jellyfin/Chart.yaml index 96a351b..5c24a48 100644 --- a/charts/jellyfin/Chart.yaml +++ b/charts/jellyfin/Chart.yaml @@ -8,5 +8,9 @@ keywords: - jellyfin - media - self-hosted -version: 2.5.0 +version: 2.5.1 appVersion: 10.11.2 +annotations: + artifacthub.io/changes: | + - kind: added + description: Add revisionHistoryLimit parameter to control rollback history retention (defaults to 3 instead of Kubernetes default 10) diff --git a/charts/jellyfin/templates/deployment.yaml b/charts/jellyfin/templates/deployment.yaml index c235001..0c4ea9a 100644 --- a/charts/jellyfin/templates/deployment.yaml +++ b/charts/jellyfin/templates/deployment.yaml @@ -14,6 +14,9 @@ spec: {{- toYaml . | trim | nindent 4 }} {{- end }} replicas: {{ .Values.replicaCount }} + {{- with .Values.revisionHistoryLimit }} + revisionHistoryLimit: {{ . }} + {{- end }} selector: matchLabels: {{- include "jellyfin.selectorLabels" . | nindent 6 }} diff --git a/charts/jellyfin/values.yaml b/charts/jellyfin/values.yaml index 068c0ef..9ea02d5 100644 --- a/charts/jellyfin/values.yaml +++ b/charts/jellyfin/values.yaml @@ -4,6 +4,12 @@ # -- Number of Jellyfin replicas to start. Should be left at 1. replicaCount: 1 +# -- Number of old ReplicaSets to retain for rollback history. +# Set to 0 to disable revision history (not recommended). +# If not specified, Kubernetes defaults to 10. +# See: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#revision-history-limit +revisionHistoryLimit: 3 + # -- Image pull secrets to authenticate with private repositories. # See: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ imagePullSecrets: [] From e1bcdc003b20fb393cd259236c13fa46f16422e7 Mon Sep 17 00:00:00 2001 From: Aleksei Sviridkin Date: Fri, 7 Nov 2025 19:59:15 +0300 Subject: [PATCH 2/3] test(deployment): add revisionHistoryLimit tests and deployment notes Add helm-unittest tests for revisionHistoryLimit: - Default value (3) verification - Custom values support (0, 1, 5, 100) - Ability to disable revision history Add NOTES.txt with revisionHistoryLimit information: - Show configured revision history limit - Warning when disabled (0) - Note for minimal history (1) - Rollback command example for normal values This parameter controls how many old ReplicaSets are retained for rollback purposes, reducing etcd storage usage. Co-Authored-By: Claude Signed-off-by: Aleksei Sviridkin --- charts/jellyfin/templates/NOTES.txt | 35 ++++++++++++++++ .../jellyfin/tests/revision_history_test.yaml | 41 +++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 charts/jellyfin/templates/NOTES.txt create mode 100644 charts/jellyfin/tests/revision_history_test.yaml diff --git a/charts/jellyfin/templates/NOTES.txt b/charts/jellyfin/templates/NOTES.txt new file mode 100644 index 0000000..83dd7c5 --- /dev/null +++ b/charts/jellyfin/templates/NOTES.txt @@ -0,0 +1,35 @@ +Thank you for installing {{ .Chart.Name }}. + +Your release is named {{ .Release.Name }}. + +To learn more about the release, try: + + $ helm status {{ .Release.Name }} + $ helm get all {{ .Release.Name }} + +{{- if .Values.ingress.enabled }} + +Jellyfin is available via Ingress at: +{{- range .Values.ingress.hosts }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .host }}{{ (index .paths 0).path }} +{{- end }} +{{- else }} + +To access Jellyfin, you can use port-forwarding: + + $ kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ include "jellyfin.fullname" . }} {{ .Values.service.port }}:{{ .Values.service.port }} + +Then visit http://localhost:{{ .Values.service.port }} in your browser. +{{- end }} + +Deployment Configuration: + Revision History Limit: {{ .Values.revisionHistoryLimit }} + {{- $limit := int .Values.revisionHistoryLimit }} + {{- if eq $limit 0 }} + ⚠ WARNING: Revision history is disabled - rollback will not be possible! + {{- else if eq $limit 1 }} + ⚠ NOTE: Only 1 revision kept - limited rollback capability + {{- else }} + You can rollback to any of the last {{ .Values.revisionHistoryLimit }} revisions using: + kubectl rollout undo deployment/{{ include "jellyfin.fullname" . }} --namespace {{ .Release.Namespace }} + {{- end }} diff --git a/charts/jellyfin/tests/revision_history_test.yaml b/charts/jellyfin/tests/revision_history_test.yaml new file mode 100644 index 0000000..0a2b903 --- /dev/null +++ b/charts/jellyfin/tests/revision_history_test.yaml @@ -0,0 +1,41 @@ +suite: test revision history limit +templates: + - deployment.yaml +tests: + - it: should set revisionHistoryLimit to 3 by default + asserts: + - equal: + path: spec.revisionHistoryLimit + value: 3 + + - it: should allow custom revisionHistoryLimit + set: + revisionHistoryLimit: 5 + asserts: + - equal: + path: spec.revisionHistoryLimit + value: 5 + + - it: should allow revisionHistoryLimit of 0 + set: + revisionHistoryLimit: 0 + asserts: + - equal: + path: spec.revisionHistoryLimit + value: 0 + + - it: should allow revisionHistoryLimit of 1 + set: + revisionHistoryLimit: 1 + asserts: + - equal: + path: spec.revisionHistoryLimit + value: 1 + + - it: should allow large revisionHistoryLimit + set: + revisionHistoryLimit: 100 + asserts: + - equal: + path: spec.revisionHistoryLimit + value: 100 From 80462ad54aa8659fd9c1dd913c5325a31a790910 Mon Sep 17 00:00:00 2001 From: Aleksei Sviridkin Date: Wed, 5 Nov 2025 23:53:08 +0300 Subject: [PATCH 3/3] ci(release): format release notes with changelog and emojis Automatically extract and format changelog from artifacthub.io/changes annotations in Chart.yaml and update GitHub release notes. Changes: - Install yq for YAML parsing - Add step to extract changelog from Chart.yaml - Format changelog with emojis based on change kind (added, fixed, etc.) - Build comprehensive release notes with: - Chart and app versions - Formatted changelog - Installation and upgrade instructions - Links to documentation - Update release notes after chart-releaser creates the release This addresses the issue where releases only contained "A Helm chart for Jellyfin Media Server" without any information about what changed. Co-Authored-By: Claude Signed-off-by: Aleksei Sviridkin --- .github/workflows/release.yaml | 119 +++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 211098d..8cca81c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -32,9 +32,128 @@ jobs: env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + - name: Install yq + run: | + # renovate: datasource=github-releases depName=mikefarah/yq + YQ_VERSION="4.44.3" + wget -q https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_linux_amd64 -O yq + chmod +x yq + sudo mv yq /usr/local/bin/yq + yq --version + - name: Run chart-releaser uses: helm/chart-releaser-action@cae68fefc6b5f367a0275617c9f83181ba54714f # v1.7.0 env: CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" with: config: .github/cr.yaml + + - name: Extract chart metadata and format release notes + id: release-notes + run: | + CHART_PATH="charts/jellyfin" + CHART_NAME=$(yq eval '.name' "${CHART_PATH}/Chart.yaml") + CHART_VERSION=$(yq eval '.version' "${CHART_PATH}/Chart.yaml") + APP_VERSION=$(yq eval '.appVersion' "${CHART_PATH}/Chart.yaml") + RELEASE_TAG="${CHART_NAME}-${CHART_VERSION}" + + echo "tag=${RELEASE_TAG}" >> $GITHUB_OUTPUT + + CHANGELOG_RAW=$(yq eval '.annotations."artifacthub.io/changes"' "${CHART_PATH}/Chart.yaml") + + # Build changelog section + CHANGELOG_SECTION="" + if [ "$CHANGELOG_RAW" != "null" ] && [ -n "$CHANGELOG_RAW" ]; then + CHANGELOG_SECTION="## What's Changed + + " + TEMP_FILE=$(mktemp) + SEPARATOR="|" + echo "$CHANGELOG_RAW" | yq eval ".[] | .kind + \"${SEPARATOR}\" + .description" - > "$TEMP_FILE" + + while IFS="${SEPARATOR}" read -r kind description; do + case "$kind" in + "added") + emoji="✨" + label="Added" + ;; + "changed") + emoji="🔄" + label="Changed" + ;; + "deprecated") + emoji="⚠️" + label="Deprecated" + ;; + "removed") + emoji="🗑️" + label="Removed" + ;; + "fixed") + emoji="🐛" + label="Fixed" + ;; + "security") + emoji="🔒" + label="Security" + ;; + *) + emoji="📝" + label="Changed" + ;; + esac + CHANGELOG_SECTION="${CHANGELOG_SECTION}- ${emoji} **${label}**: ${description} + " + done < "$TEMP_FILE" + + rm -f "$TEMP_FILE" + CHANGELOG_SECTION="${CHANGELOG_SECTION} + " + fi + + # Build release body + RELEASE_BODY="## Jellyfin Helm Chart v${CHART_VERSION} + + **Application Version**: \`${APP_VERSION}\` + + ${CHANGELOG_SECTION}## Installation + + Add the Jellyfin Helm repository: + + \`\`\`bash + helm repo add jellyfin https://jellyfin.github.io/jellyfin-helm + helm repo update + \`\`\` + + Install the chart: + + \`\`\`bash + helm install my-jellyfin jellyfin/jellyfin --version ${CHART_VERSION} + \`\`\` + + ## Upgrade + + \`\`\`bash + helm upgrade my-jellyfin jellyfin/jellyfin --version ${CHART_VERSION} + \`\`\` + + --- + + 📦 **Chart**: \`jellyfin\` v${CHART_VERSION} + 🎬 **Jellyfin**: v${APP_VERSION} + 📖 **Documentation**: https://github.com/jellyfin/jellyfin-helm/blob/main/charts/jellyfin/README.md + " + + # Save to file + echo "$RELEASE_BODY" > release-notes.md + + - name: Update release notes + env: + GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + run: | + RELEASE_TAG="${{ steps.release-notes.outputs.tag }}" + + # Update release notes + gh release edit "$RELEASE_TAG" --notes-file release-notes.md + + echo "✅ Updated release notes for $RELEASE_TAG"