Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Semantics of username being applied to usernames and workspace names #1756

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

Closed
greyscaled opened this issue May 25, 2022 · 4 comments
Closed
Labels
api Area: HTTP API stale This issue is like stale bread.

Comments

@greyscaled
Copy link
Contributor

greyscaled commented May 25, 2022

Developer Story

We have a custom username validator (that we register on Go Validator) called username:

err := validate.RegisterValidation("username", func(fl validator.FieldLevel) bool {

It's being applied to both usernames:

Username string `json:"username" validate:"required,username"`

and workspace names:

Name string `json:"name" validate:"username,required"`

These semantics don't overlap cleanly - is a workspace name a username ?

It may be the case that workspace names and usernames have the same validation under-the-hood, but the questions remain:

  • should username be generalized then (renamed)
  • should we create a new validation for workspace name (even though it's the same)

S/o to @oxy for helping to identify this 🎉 !

@greyscaled greyscaled added api Area: HTTP API chore 🔧 labels May 25, 2022
@kylecarbs
Copy link
Member

I think the type username should be renamed, but I'm not sure what it should be called.

The idea is to maintain consistency between our naming semantics, similar to GitHub.

@ketang
Copy link
Contributor

ketang commented May 26, 2022

Why do we need that consistency? The two types of names are not used the same way.

@kylecarbs kylecarbs changed the title Refactor: Semantics of username being applied to usernames and workspace names Semantics of username being applied to usernames and workspace names Jun 7, 2022
@github-actions
Copy link

github-actions bot commented Aug 7, 2022

This issue is becoming stale. In order to keep the tracker readable and actionable, I'm going close to this issue in 7 days if there isn't more activity.

@github-actions github-actions bot added the stale This issue is like stale bread. label Aug 7, 2022
@bpmct
Copy link
Member

bpmct commented Aug 8, 2022

Gonna close for now, but this is related to this use case #3321

@bpmct bpmct closed this as not planned Won't fix, can't repro, duplicate, stale Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Area: HTTP API stale This issue is like stale bread.
Projects
None yet
Development

No branches or pull requests

4 participants