zpnk / stage-ci

Automatic deploy previews for your PRs using zeit.co/now.
https://stage.now.sh
MIT License
131 stars 23 forks source link

Support long branch names #42

Open littleStudent opened 6 years ago

littleStudent commented 6 years ago

fixes #41

paulirish commented 6 years ago

can you add a comment pointing to where the 70char max is defined or documented?

also... it'd seem slightly better if you set the const as 70 and do the math.

littleStudent commented 6 years ago

did not find anything in the docs. I ran into the problem and tested the constraints myself. I will try to get an official statement in slack?

Sure i can do the calculation starting from the maxChar.

UPDATE: I found this in the cli tool: https://github.com/zeit/now-cli/blob/c49ba28bbffe74860c845f313882b49c0e85988d/src/providers/sh/util/alias.js#L36

const domainRegex = /^((?=[a-z0-9-]{1,63}\.)(xn--)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,63}$/

So as i see it we got 63 chars to choose + .now.sh (7 chars) = 70chars