Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase or document environment branch reference limits #3815

Open
shreddedbacon opened this issue Oct 1, 2024 · 2 comments
Open

Increase or document environment branch reference limits #3815

shreddedbacon opened this issue Oct 1, 2024 · 2 comments

Comments

@shreddedbacon
Copy link
Member

The baseref and headref fields on an environment in the database have a max length of 100. This can result in environments or pullrequests that have long branch refs failing to deploy with an obscure error.

table.string('deploy_base_ref', 100);
table.string('deploy_head_ref', 100);

We should either increase this, or document these limits. We should also return an clearer error if these limits are exceeded, rather than when the SQL in performed.

@tobybellwood
Copy link
Member

It looks like github has a 255 char limit - including refs/heads/

so maybe we can change this - but should we also support longer environment names too - to accommodate it - or are we happy to truncate them when needed?

Context - making lots of db changes in #3816 - so can accommodate these there if needed

@shreddedbacon
Copy link
Member Author

so maybe we can change this - but should we also support longer environment names too - to accommodate it - or are we happy to truncate them when needed?

TLDR; Yeah, we can probably increase them to 255, but leave the environment name at 100.

Well we add some things into labels in resources, and labels in kubernetes have limits on the length of the value. If we were going to have any issues, it would be on the environment name after it has been modified, but this truncates the calculated name to 63 already (58+5, 5 being -hash).

Luckily, we put the unmodified values of branch/refs into annotations which can definitely support more than 255.

I don't think we do anything to the project name though, and this would suffer from a being greater than 63 thing, which I'm a bit surprised hasn't happened. We limit project names to 100 in the db

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants