As soon as I put 51 characters in a name, then drone does not start from my GitHub PR.
IMO this is because a lot of the database fields are limited to VARCHAR(50)
e.g. https://github.com/drone/drone/blob/master/store/shared/migrate/mysql/files/005_create_table_stages.sql
Is there a reason for that limit?
Can we make it longer? (100, 128, 256?)
e.g. I am generating the drone matrix from a starlark script. I end up with names like:
kind: pipeline
type: docker
name: webUIActivitySharingInternal-firefox-master-mariadb10.2-php7.0
I am generating a unique name that describes all the variable pieces of the environment that are used in the stage:
webUIActivitySharingInternalfirefoxmastermariadb10.2php7.0That makes a long name! But the generated names need to be unique so that they can be mentioned in depends_on
Of course it could be longer, but acceptance tests are anyway running with a single db and php version, that's why I skipped that for the title
I have no problem increasing the size. The only consideration we need to make is that mysql limits the size of a unique index, and this limit is further impacted by utf8 character set. So probably best to increase to 100 to be safe and then put some logic in the linter to error if a stage name is > 100 characters.
"logic in the linter" would be good. I wondered what I had done for a while, because I got no build at all listed in drone (and thus also no link in GitHub to the drone build). So I was somewhat at a loss to understand what happened - had the trigger from GitHub<-> drone got lost, or...
I noticed that when I do other bad things, like accidentally have duplicate names for stages, I see a linter error reported in the drone webUI.
I guess in this "long name" case, the problem is only being "detected" when an exception is thrown on attempting to insert the long name into a VARCHAR(50) database field.
stage name increased to 100 characters in mysql and postgres in master. I have not added validation logic yet to enforce the 100 character limit, however, this does not seem to be a common issue and should be less common with the increases. We can therefore follow-up in a separate patch to enforce such limits.
Most helpful comment
stage name increased to 100 characters in mysql and postgres in master. I have not added validation logic yet to enforce the 100 character limit, however, this does not seem to be a common issue and should be less common with the increases. We can therefore follow-up in a separate patch to enforce such limits.