From b84e6d4bc53b056c8341f24edd77360f0cf49d05 Mon Sep 17 00:00:00 2001 From: Matti Airas Date: Mon, 15 Jun 2026 10:06:09 +0300 Subject: [PATCH 1/2] fix(ci): wrap long changelog lines for lintian The release build regenerates debian/changelog from commit subjects and runs lintian with --fail-on warning, so a subject over ~76 chars trips debian-changelog-line-too-long and fails the build (it did, for 0.7.0). Port the wrap_changes helper already used by the shared-workflows fallback: fold each subject at 76 columns with a hanging indent. Also fix the stale `grep -v "~pre"` (tags use the `_pre` suffix) so pre-release tags are excluded from the since-last-tag range. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/scripts/generate-changelog.sh | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/scripts/generate-changelog.sh b/.github/scripts/generate-changelog.sh index cd73092..4aa596f 100755 --- a/.github/scripts/generate-changelog.sh +++ b/.github/scripts/generate-changelog.sh @@ -53,15 +53,29 @@ MAINTAINER_EMAIL="${MAINTAINER_EMAIL:-matti.airas@hatlabs.fi}" # Date in RFC 2822 format DATE=$(date -R) -# Get recent changes from git log -# Get commits since last published release tag -LAST_TAG=$(git tag -l "v*" --sort=-version:refname | grep -v "~pre" | head -n1 || echo "") - +# Fold commit subjects into changelog bullets wrapped at 80 columns. lintian's +# debian-changelog-line-too-long warning is fatal in the release build +# (--fail-on warning), and conventional-commit subjects can exceed the limit +# once the " * " prefix is added. +wrap_changes() { + while IFS= read -r subject; do + [ -z "$subject" ] && continue + printf '%s\n' "$subject" \ + | fold -s -w 76 \ + | sed -e 's/[[:space:]]*$//' -e '1s/^/ * /' -e '1!s/^/ /' + done +} + +# Get commits since last published (non-pre-release) tag. +LAST_TAG=$(git tag -l "v*" --sort=-version:refname | grep -v "_pre" | head -n1 || echo "") + +# tformat (not format) terminates every subject with a newline so the read +# loop in wrap_changes does not drop the last commit. if [ -n "$LAST_TAG" ]; then - CHANGES=$(git log "${LAST_TAG}"..HEAD --pretty=format:" * %s" --no-merges || echo " * Build ${REVISION}") + CHANGES=$(git log "${LAST_TAG}"..HEAD --pretty=tformat:"%s" --no-merges -- | wrap_changes) else # No previous tags, use recent commits - CHANGES=$(git log -10 --pretty=format:" * %s" --no-merges || echo " * Build ${REVISION}") + CHANGES=$(git log -10 --pretty=tformat:"%s" --no-merges | wrap_changes) fi # If no changes (shouldn't happen), use a default message From 517805943dabdb544a1e1d20ef8fa0e1254f5f3c Mon Sep 17 00:00:00 2001 From: Matti Airas Date: Mon, 15 Jun 2026 10:09:46 +0300 Subject: [PATCH 2/2] fix(types): annotate mixed-value dicts to satisfy ty Two dict literals were inferred as dict[str, str] from their initial string-only entries, then assigned a non-str value later (a forward_auth dict in routing.py, a read_only bool in the CasaOS transformer), tripping ty's invalid-assignment check. Annotate both as dict[str, Any] at construction. In routing.py the auth dict is now built before routing_data so the forward_auth branch mutates an explicitly typed local. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../converters/casaos/transformer.py | 2 +- src/generate_container_packages/routing.py | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/generate_container_packages/converters/casaos/transformer.py b/src/generate_container_packages/converters/casaos/transformer.py index 54d16c0..3b58ad1 100644 --- a/src/generate_container_packages/converters/casaos/transformer.py +++ b/src/generate_container_packages/converters/casaos/transformer.py @@ -735,7 +735,7 @@ def _build_clean_compose(self, casaos_app: CasaOSApp) -> dict[str, Any]: # Transform host path transformed_host = self._transform_path(volume.host, casaos_app.id) - volume_def = { + volume_def: dict[str, Any] = { "type": "bind", "source": transformed_host, "target": volume.container, diff --git a/src/generate_container_packages/routing.py b/src/generate_container_packages/routing.py index 7914d87..5f0b2f6 100644 --- a/src/generate_container_packages/routing.py +++ b/src/generate_container_packages/routing.py @@ -72,24 +72,23 @@ def generate_routing_yml( if scheme != "http": backend_config["scheme"] = scheme + auth_config: dict[str, Any] = {"mode": auth_mode} + # Add forward_auth headers if present + if forward_auth_headers: + auth_config["forward_auth"] = {"headers": forward_auth_headers} + routing_data: dict[str, Any] = { "app_id": app_id, "package_name": package_name, "routing": { "backend": backend_config, }, - "auth": { - "mode": auth_mode, - }, + "auth": auth_config, "network": { "join_proxy_network": not is_host_network, }, } - # Add forward_auth headers if present - if forward_auth_headers: - routing_data["auth"]["forward_auth"] = {"headers": forward_auth_headers} - # Generate YAML with header comment header = f"""# Generic routing declaration for {app_id} # Installed to /etc/halos/routing.d/{app_id}.yml