thoughtbot / parity

Shell commands for development, staging, and production parity for Heroku apps
https://thoughtbot.com
MIT License
889 stars 57 forks source link

Review App prefix truncated to 22 characters #164

Closed clowder closed 5 years ago

clowder commented 5 years ago

When using the pr_app command I was running into issues because we have a long application name, but Heroku appears to truncate that to 22 characters when using it for the Review App prefix.

Opening this as an issue as I've only got a data-point of one and it would be nice to confirm this with other users.

Thanks for all your hard work ❤️ 💻

rubendinho commented 5 years ago

Hi @geoffharcourt and @clowder I am experiencing this problem on v3.1

The original app is called: ourapp-ninechars-api-staging The review app Heroku created: ourapp-ninechars-api-sta-pr-25

When i run pr_app 25 console, I get:

Running bundle exec rails console on ⬢ ourapp-ninechars-api-s-pr-25... !
 ▸    Couldn't find that app.

So it looks like while Parity is truncating the name to 22 characters as per #165, in my case, Heroku is truncating to 24 characters.

I suspect that @clowder experienced this issue with a 4-digit PR number (vs my 2-digit one), since Heroku imposes a 30-character limit on app names. So the solution is probably to truncate up to 30 characters including the -pr-#{review_app_number}, rather than chop off the first 22 characters.

image