Repository navigation
fix: validate Debian versions with dpkg and honor the changelog input - #7
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes three problems in
check-py-deb-pkg-versions-match.ymlandget-formatted-version-string.yml:\d,(?:...)) withgrep -E. GNU grep printedstray \ before dand? at start of expressionon every run (visible in wlanpi-core deploy logs), and it accepted invalid versions such as2.3.7-. It now usesdpkg --validate-version.debian_changelog_file_pathinput. Both workflows declared it but always readdebian/changelog. They now read the input, passed throughenv.check-py-deb-pkg-versions-matchnow strips a Debian epoch before comparing, so1:2.3.7-1matches__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:1.4.22-2vs1.4.211:2.3.7-1vs2.3.71.4.23~rc1-1vs1.4.231.1.55(native)2.3.7-not-a-versiondebian_changelog_file_pathget-formatted-version-stringoutputs are identical for wlanpi-core (2.3.7-1), wlanpi-mcp (0.6.13-1) and wlanpi-profiler (2.1.3-1).