Skip to content

phx.gen.release: simplify Debian version parsing and usage - #6807

Open
rhcarvalho wants to merge 1 commit into
phoenixframework:mainfrom
praialabs:simplify-debian-version
Open

phx.gen.release: simplify Debian version parsing and usage#6807
rhcarvalho wants to merge 1 commit into
phoenixframework:mainfrom
praialabs:simplify-debian-version

Conversation

@rhcarvalho

Copy link
Copy Markdown
Contributor

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.

Follows up on #6802.

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.
@rhcarvalho

Copy link
Copy Markdown
Contributor Author

I'm not lucky with the GHA runner :)

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