-
Notifications
You must be signed in to change notification settings - Fork 182
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
Make the name
field in projects optional
#870
Make the name
field in projects optional
#870
Conversation
Backport for 7.4.x is here: #871 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, just had a small question about ServeSession::project_name
and then I will approbe
self.root_project | ||
.name | ||
.as_ref() | ||
.expect("all top-level projects must have their name set") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this panic reachable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't be. I gave it a separate warning just in case though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, I'm approving this then and we'll have @osyrisrblx check out #871 before merging since that's the one that's shipping right now
Unlike most of the other backports, this code couldn't be directly translated so it had to be re-implemented. Luckily, it is very simple. This implementation is a bit messy and heavy handed with potential panics, but I think it's probably fine since file names that aren't UTF-8 aren't really supported anyway. The original implementation is a lot cleaner though. The test snapshots are (almost) all identical between the 7.5 implementation and this one. The sole exception is with the path in the `snapshot_middleware::project` test, since I didn't feel like adding a `name` parameter to `snapshot_project` in this implementation.
Closes #858.
If a project is named
default.project.json
, it acts as aninit
file and gains the name of the folder it's inside of. If it is named something other thandefault.project.json
, it gains the name of the file with.project.json
trimmed off. So e.g.foo.project.json
becomesfoo
.