Skip to content

Conversation

@mitchellwrosen
Copy link
Member

Overview

Currently UCM allows more project names than Share and the local UI. We've decided to restrict valid project names to slugs similar to GitHub's (except our project names have an optional @user/ prefix):

  • Starts with ascii letter or digit
  • Continues with ascii letter, digit, or hyphen, where hyphens have to be followed by ascii letter or digit
  • 2-40 characters in length

This PR just adds a parser for that syntax, and on startup, reports to the user whether any of their project names don't conform to the new regex:

Screenshot 2025-09-08 at 12 07 11 PM

@mitchellwrosen mitchellwrosen marked this pull request as ready for review September 8, 2025 16:23
@aryairani
Copy link
Contributor

aryairani commented Sep 9, 2025

Nice.

For the message, how about:

Just a heads up: we're updating UCM's project naming rules to match Unison Share. The following project names will need a quick rename to keep everything running smoothly in upcoming releases:

a, a_a, éééééééééé

Just use `project.rename` and switch to one that only includes ASCII letters, digits, and hyphens; between 2–40 characters.

In a future PR we can switch project.create, project.create-empty, project.rename to only allow new names that match the regex, even while still giving the warning for legacy names.

Mainly just avoiding the phrase "will all be invalid".

@mitchellwrosen
Copy link
Member Author

@aryairani I'm happy to make changes here but I think your suggestion "The following project names will need a quick rename to keep everything running smoothly in upcoming releases" is kinda wordy and confusing to read.

Could we perhaps tease out what specifically is wrong with the phrasing "These project names will all be considered invalid in an upcoming UCM release" and then iterate from there?

@aryairani
Copy link
Contributor

@mitchellwrosen Good point about it being kind of long. How about

⚠️ 

We're updating UCM's naming rules to match Unison Share, and these project names won’t be supported much longer:

a, a_a, éééééééééé

Please project.rename them using only ASCII letters, numbers, and hyphens (2–40 characters).

Could we perhaps tease out what specifically is wrong with the current phrasing and then iterate from there

Just trying to match tone with the rest of the UCM, which aims friendlier and less 🤖 "error: invalid data" than most compiler tools. Therefore avoiding the phrase "all will be invalid".

@mitchellwrosen
Copy link
Member Author

Ok, the point about tone sounds good, I think I still have a small issue with this error message though, which is that this feels unnecessary to disclose to the user (and therefore unnecessarily wordy):

We're updating UCM's naming rules to match Unison Share

Like, yeah, we screwed up and used two different regexs for project names in two different places and now have to migrate our way out of this situation 😅.

How about just starting at the "these project names won't be supported much longer" part?

@aryairani
Copy link
Contributor

Yeah, when you put it that way about the regexes...
But I do want to include a "why" whenever practical.

We're updating UCM's project naming rules, and these names won’t be supported much longer:

This is a pretty weak why, but it's better than nothing

@mitchellwrosen
Copy link
Member Author

CI still seems to be failing, unrelated to this PR

@mitchellwrosen
Copy link
Member Author

@aryairani Ready

@aryairani aryairani merged commit 5c9d3c3 into trunk Sep 16, 2025
1 check passed
@aryairani aryairani deleted the github-project-name branch September 16, 2025 05:35
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

Successfully merging this pull request may close these issues.

3 participants