-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
feat(core): Create names for personal projects in one place and resuse it #8995
Conversation
if (this.firstName && this.lastName && this.email) { | ||
return `${this.firstName} ${this.lastName} <${this.email}>`; | ||
} else if (this.email) { | ||
return `<${this.email}>`; |
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.
@krynble This is what it generates for shell accounts.
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.
One thing I'm wondering is the fact that we tested a lot of places that use this function but we haven't tested this function itself. We have 3 possible outcomes and we have no tests for it.
Would you mind adding a few tests for it?
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.
@@ -543,7 +544,7 @@ describe('DELETE /users/:id', () => { | |||
}); | |||
|
|||
test('should fail to delete a user that does not exist', async () => { | |||
await ownerAgent.delete('/users/foobar').query({ transferId: '' }).expect(404); |
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.
Unrelated fix for the postgres tests.
fa93117
to
5ef982b
Compare
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.
LGTM
|
Summary
This adds a helper function to the user entity that generates the name for the user's personal project.
Next step would be to mark the field as non-nullable in the entity and the migration.
Related tickets and issues
none
Review / Merge checklist
(no-changelog)
otherwise. (conventions)