Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: exposeowner_name incoder_workspace resource#11639

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mtojek merged 18 commits intomainfrom9883-add-owner-to-workspace
Jan 17, 2024

Conversation

mtojek
Copy link
Member

@mtojekmtojek commentedJan 16, 2024
edited
Loading

Related:#9883

This PR modifies theusers database table to store the workspace owner's name (first name, last name).

Follow-up:

  • Adjust the Account form to let the user customize their name
  • Adjust frontend tests with "" names

@mtojekmtojek self-assigned thisJan 16, 2024
@mtojekmtojek mentioned this pull requestJan 16, 2024
3 tasks
@mtojekmtojek marked this pull request as ready for reviewJanuary 17, 2024 10:49
Copy link
Member

@johnstcnjohnstcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Names are hard!


// UserRealNameValid returns whether the input string is a valid real user name.
func UserRealNameValid(str string) error {
if len(str) > 128 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

What's the motivation for this limit? Hubert will be sad:https://www.guinnessworldrecords.com/world-records/67285-longest-personal-name

I think it's unlikely we'll hit this, but arbitrary limits have a way of making people sad (think email regex). We should at least document this decision a bit better. Should length also be enforced in the DB side?

PS. If we're thinking about frontend, they could always use ellipse over there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I would expect we don't want to allow someone to fill up the database with a name that's gigabytes in size.

Copy link
Member

@mafredrimafredriJan 17, 2024
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Yeah, I understand that risk could be a concern, I was specifically thinking aboutthis limit (128), though. Seems on the smaller to just be a safety-net. And if we're really worried about this case, I do think database limits would be a good idea, otherwise we'll always run the risk of introducing new holes. And I'd be surprised if we didn't have some gaps in this defense elsewhere currently as well 😄.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The form Mr. Hubert used, HUBERT BLAINE WOLFE­SCHLEGEL­STEIN­HAUSEN­BERGER­DORFF SR, is within the limit!

The original use case for this feature is to populate all places where UI or CLI can render it, like Git commiter/message. I'm sure that Hubert Blain Wolf... will crash UIs in many different places, so I would stick to the artificial limit.

Anyway, we can always disable the limit. The other way round might be hard to do as we might need to chop some names...

I do think database limits would be a good idea, otherwise we'll always run the risk of introducing new holes. And I'd be surprised if we didn't have some gaps in this defense elsewhere currently as well 😄.

This is valid risk, and I wouldn't like to enable another gate to pump bytes into the database.

johnstcn reacted with laugh emoji
{"Hector Ó hEochagáin", true},
{"Małgorzata Kalinowska-Iszkowska", true},
{"成龍", true},
{". .", true},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This looks like a smiley, I approve! 👀

mtojek reacted with laugh emoji
@mtojekmtojek merged commit5eb3e1c intomainJan 17, 2024
@mtojekmtojek deleted the 9883-add-owner-to-workspace branchJanuary 17, 2024 12:20
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJan 17, 2024
}

if strings.TrimSpace(str) != str {
return xerrors.New("must not have leading or trailing white spaces")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Happened to catch my eye, whitespace is uncountable, so we drops. Alt: whitespace characterS.

Suggested change
returnxerrors.New("must not have leading or trailingwhite spaces")
returnxerrors.New("must not have leading or trailingwhitespace")

Not sure about having white space in whitespace, though. Both could be correct 😄.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@mafredrimafredrimafredri approved these changes

@johnstcnjohnstcnjohnstcn approved these changes

Assignees

@mtojekmtojek

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@mtojek@mafredri@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp