platanus / potassium

A Rails application generator by Platanus, inspired by Suspenders
MIT License
232 stars 17 forks source link

Validate names in heroku recipe do not exceed the name limit #344

Closed agomezcampero closed 3 years ago

agomezcampero commented 3 years ago

Description Closes #331

When the default app name or default pipeline name exceeds 30 characters (the limit set by Heroku), the user is prompted to input a new name. This name doesn't have to include either the name prefix or the environment name at the end (should we enforce that?).

Heroku app names are now set during the ask section of the recipe. This is because it doesn't make sense to ask a user for a Heroku app name if they don't want to deploy the app.

agomezcampero commented 3 years ago

Regarding if we should enforce prefix/suffix, for prefix I don't think is really necessary. For suffix I'm not sure how we should handle it, cause we have heroku-stage that relies on the suffix convention and it's used in mailer and sentry configs. Maybe it's not so bad to not enforce it if we add a warning before the name ask, something like:

Note that potassium projects use the gem "heroku-stage" for some configurations. If your name doesn't follow a certain convention, some things might not work as intended. Here's the convention: https://github.com/platanus/heroku-stage#the-convention

A little long but, something like that. What do you think?

Other than that it looks good! Could you add an entry to the Changelog for this feature (or fix?) pls?

Considering that we are using "heroku-stage" I would definitely enforce the naming convention. I think the downside of some things not working is a lot higher than having to choose a slightly shorter name. I'll add this to the pr and add the entry to the Changelog.