phoenixframework / phoenix

Peace of mind from prototype to production
https://www.phoenixframework.org
MIT License
21.45k stars 2.88k forks source link

`mix phx.new` does not comply with `mix new` Application Name validation and fails later in mix release #5915

Closed bmalum closed 2 months ago

bmalum commented 2 months ago

Environment

Actual behavior

In the current implementation, I can create an app with upper case letters, although according to the error message only lower case letters should be used for an app name. This is a different behaviour than with mix new - which catches us later with a mix release (in my example in the generated Docker file in line 64)

mix phx.new exAppName
cd exAppName
mix phx.gen.release --docker
docker build .

 > [builder 17/17] RUN mix release:                                                                                                                                                                
0.523 ** (Mix) Invalid release name. A release name must start with a lowercase ASCII letter, followed by lowercase ASCII letters, numbers, or underscores, got: :exAppName
------
Dockerfile:64
--------------------
  62 |     
  63 |     COPY rel rel
  64 | >>> RUN mix release
  65 |     
  66 |     # start a new build stage so that the final image will only contain

Expected behavior

mix phx.new exAppName
** (Mix) Application name must start with a letter and have only lowercase letters, numbers and underscore, got: "exAppName". The application name is inferred from the path, if you'd like to explicitly name the application then use the `--app APP` option.