phx.gen.release: simplify Debian version parsing and usage - #6807
Open
rhcarvalho wants to merge 1 commit into
Open
phx.gen.release: simplify Debian version parsing and usage#6807rhcarvalho wants to merge 1 commit into
rhcarvalho wants to merge 1 commit into
Conversation
Consolidate the Debian tag into a single `debian_vsn` binding instead of splitting it into `debian` and `debian_vsn` and stripping/re-appending `-slim`. Key changes: * Use an inline regex in `docker_tag_candidate/1` to declaratively parse Docker tags according to the tag specification while enforcing the `-slim` suffix. Compared to string splitting, the regex match is more concise while strictly validating accepted tag characters. * Keep `debian_vsn` as the complete Debian tag (e.g. `trixie-20251117-slim`), removing the redundant `debian` template binding and aligning `ARG DEBIAN_VERSION=<%= debian_vsn %>` symmetrically with `elixir_vsn` and `otp_vsn`. * Streamline candidate data flow and unify `_vsn` naming, removing redundant tuple conversions and duplicate `case` expressions in `gen_docker/2`. * Add test coverage for pre-release versions with hyphens, non-slim/non-Debian tags, and malformed inputs.
Contributor
Author
|
I'm not lucky with the GHA runner :) |
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.
Consolidate the Debian tag into a single
debian_vsnbinding instead of splitting it intodebiananddebian_vsnand stripping/re-appending-slim.Key changes:
docker_tag_candidate/1to declaratively parse Docker tags according to the tag specification while enforcing the-slimsuffix. Compared to string splitting, the regex match is more concise while strictly validating accepted tag characters.debian_vsnas the complete Debian tag (e.g.trixie-20251117-slim), removing the redundantdebiantemplate binding and aligningARG DEBIAN_VERSION=<%= debian_vsn %>symmetrically withelixir_vsnandotp_vsn._vsnnaming, removing redundant tuple conversions and duplicatecaseexpressions ingen_docker/2.Follows up on #6802.