Skip to content

fix: validate Debian versions with dpkg and honor the changelog input - #7

Merged
joshschmelzle merged 1 commit into
mainfrom
fix/version-check-validation
Sep 23, 2026
Merged

joshschmelzle merged 1 commit into
mainfrom
fix/version-check-validation

Conversation

@joshschmelzle

Copy link
Copy Markdown
Member

Fixes three problems in check-py-deb-pkg-versions-match.yml and get-formatted-version-string.yml:

  • Version validation. The check used a PCRE-style regex (\d, (?:...)) with grep -E. GNU grep printed stray \ before d and ? at start of expression on every run (visible in wlanpi-core deploy logs), and it accepted invalid versions such as 2.3.7-. It now uses dpkg --validate-version.
  • debian_changelog_file_path input. Both workflows declared it but always read debian/changelog. They now read the input, passed through env.
  • Epochs. check-py-deb-pkg-versions-match now strips a Debian epoch before comparing, so 1:2.3.7-1 matches __version__ = "2.3.7".

Callers use @main, so this takes effect for every consumer when merged. None of them passes a custom changelog path.

Validation: actionlint passes. I ran each workflow's steps locally, old and new, simulating inputs and GITHUB_ENV/GITHUB_OUTPUT:

Case Old New
wlanpi-core, -mcp, -profiler, -webui, -fpms (real changelogs) pass pass
1.4.22-2 vs 1.4.21 fail fail
1:2.3.7-1 vs 2.3.7 fail pass
1.4.23~rc1-1 vs 1.4.23 pass pass
1.1.55 (native) pass pass
2.3.7- pass fail (dpkg: revision number is empty)
not-a-version fail fail
custom debian_changelog_file_path ignored used

get-formatted-version-string outputs are identical for wlanpi-core (2.3.7-1), wlanpi-mcp (0.6.13-1) and wlanpi-profiler (2.1.3-1).

The validity check used a PCRE-style regex with grep -E: GNU grep warned on every run (stray \ before d, ? at start of expression) and it accepted invalid versions such as 2.3.7-. Use dpkg --validate-version instead.

Both workflows declared debian_changelog_file_path but read debian/changelog regardless; read the input (via env). check-py-deb-pkg-versions-match also strips a Debian epoch before comparing with __version__, so 1:2.3.7-1 matches 2.3.7.

Results are unchanged for every current caller (wlanpi-core, wlanpi-mcp, wlanpi-profiler, wlanpi-webui, wlanpi-fpms); none passes a custom changelog path.
@joshschmelzle
joshschmelzle merged commit 883f267 into main Sep 23, 2026
6 checks passed
@joshschmelzle
joshschmelzle deleted the fix/version-check-validation branch September 23, 2026 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant