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

Limit branch names on GitHub PR's to 255 bytes #5761

Closed
1 task done
jeffwidman opened this issue Sep 20, 2022 · 1 comment
Closed
1 task done

Limit branch names on GitHub PR's to 255 bytes #5761

jeffwidman opened this issue Sep 20, 2022 · 1 comment
Assignees
Labels
F: pull-requests Issues about Dependabot pull requests T: bug 🐞 Something isn't working

Comments

@jeffwidman
Copy link
Member

Is there an existing issue for this?

  • I have searched the existing issues

Code improvement description

Our internal error logs are showing a PR branch failed to be created because the branch name it was trying to create was 299 characters.

According to the reporter, the limit for GitHub branch names is 255 (244 really after refs/heads).

We should be able to leverage the great work @TomNaessens did in #5338 to to enforce the proper character limit on GitHub.

@jeffwidman jeffwidman added T: bug 🐞 Something isn't working F: pull-requests Issues about Dependabot pull requests labels Sep 20, 2022
@jeffwidman
Copy link
Member Author

Looks like the limit may be enforced on bytes, not characters: https://stackoverflow.com/a/66514473/770425

I googled but couldn't find any public docs published by GitHub documenting the limit.

Since #5338 hasn't made it to a public release yet we may want to teak the option slightly to enforce bytes limits rather than characters... or we could keep it sane for humans and just enforce a slightly smaller character limit such that it's unlikely to ever go over the bytes limit.

@jeffwidman jeffwidman changed the title Limit branch names on GitHub PR's to 255 chars Limit branch names on GitHub PR's to 255 bytes Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F: pull-requests Issues about Dependabot pull requests T: bug 🐞 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants