-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Allow team names of length 36 to accommodate UUIDs #31241
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
Comments
We could/should increase the length even more. |
What is the maximum team length name on GitHub/GitLab? |
This collection implies the max length on GitHub is 255: https://github.com/dead-claudia/github-limits |
I'm fine with anything below 255, so if there's a PR to change it, I'll approve it. |
you likely meant "at or below" 😛 |
Where in the code should the change be made? |
modules/structs/org_team.go
27: Name string `json:"name" binding:"Required;AlphaDashDot;MaxSize(30)"`
43: Name string `json:"name" binding:"AlphaDashDot;MaxSize(30)"` I just had a look at the data model ( |
I assume xorm would auto-migrate the column to the new size, right? If yes, then it is just a change in those structs that is ideally accompanied by a small test that creates a team at the new maximum length. |
@silverwind we require a migration for struct changes that would affect the DB, because even though automigrations will happen, we've run into cases in the past with too large of a version jump in the migration, then some auto-assumed migrations would be skipped (I haven't looked at this specific case though if it'd need the migration/struct change, but from above it seems it is just the validation that needs to be updated). |
As I said, not needed, it's already |
So, is the only thing needed then to change these values to 255?
|
@tobiasbp yes, although I'd suggest making the change locally, compiling, and testing to see if the names can then handle the additional length (in case we are missing another validation area). |
So, let's say 63? |
255 is fine for all common file systems: https://github.com/sindresorhus/valid-filename/blob/main/index.js |
@silverwind the folder length is not enough to look at, some FS (in mobile so I can't link) look at the full path as well. I want to say it's exFAT, but it might be another (common one). |
Thought Windows does have a restriction called MAX_PATH that limits the full path length to 260 chars. I don't think team names can end up as filenames but for stuff that can (org name, repo name), I think 64 is a good limit. |
So... What do we want?
|
Maoam and 255. |
255, to match GitHub and because team names will likely never represent in the file system so things like MAX_PATH are not an issue. |
Ah, sorry, yes, my bad. I was thinking org name, even though you all have been saying team name this entire time. Please ignore my previous concerns. 255 is definitely a good choice for team name. |
Repo and org name limitations need to be investigated separately, I posted some regexes in #4150 (comment), but there is also a length limit. |
PR to change maximum length of team names to 255 characters: #31410 |
closing due to merged PR |
Feature Description
When integrating Gitea with other systems, I have the need to create organization teams the correspond to an external resource. As there is no way to tag a team, I would like to name the with a UUID that matches the UUID of my external resource. Users will never see the team names, so there are no UI issues with users wondering about the UUID names for teams.
Currently, the maximum length of a team name is 30 characters. I would like to have that changed to 36, which is the length of a UUID (32 hex characters and 4 hyphens).
I'm happy to make a PR with the change, if someone could point to the current definition in the code. I am unable to find it.
Screenshots
The text was updated successfully, but these errors were encountered: