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: Allow using username in user queries#1221

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
Emyrk merged 4 commits intomainfromstevenmasley/user_by_username
Apr 29, 2022

Conversation

Emyrk
Copy link
Member

@EmyrkEmyrk commentedApr 29, 2022
edited
Loading

Thecodersdk still acceptsuuid for all user params. I added aUserByUsername ontop onUser() func.

I was thinking we should either use generics, or an interface for aUserIdentifier and accept"me",uuid.UUID, orUsername


I was writing the generic version, but you can't add Generics to methods on structs. 😢

@codecov
Copy link

codecovbot commentedApr 29, 2022
edited
Loading

Codecov Report

Merging#1221 (290d1a3) intomain (3ebe1d2) willincrease coverage by0.10%.
The diff coverage is85.71%.

@@            Coverage Diff             @@##             main    #1221      +/-   ##==========================================+ Coverage   65.60%   65.70%   +0.10%==========================================  Files         269      269                Lines       17337    17365      +28       Branches      162      162              ==========================================+ Hits        11374    11410      +36+ Misses       4772     4767       -5+ Partials     1191     1188       -3
FlagCoverage Δ
unittest-go-macos-latest52.96% <85.71%> (-0.02%)⬇️
unittest-go-postgres-64.75% <85.71%> (+0.08%)⬆️
unittest-go-ubuntu-latest55.42% <85.71%> (+0.13%)⬆️
unittest-go-windows-202252.54% <85.71%> (+0.01%)⬆️
unittest-js68.85% <ø> (ø)
Impacted FilesCoverage Δ
coderd/httpmw/userparam.go85.71% <83.78%> (+7.58%)⬆️
codersdk/users.go64.95% <100.00%> (+0.66%)⬆️
peer/conn.go76.67% <0.00%> (-0.75%)⬇️
provisionerd/provisionerd.go76.30% <0.00%> (ø)
provisioner/terraform/provision.go71.39% <0.00%> (+0.43%)⬆️
coderd/provisionerdaemons.go64.30% <0.00%> (+1.01%)⬆️
peer/channel.go85.54% <0.00%> (+2.31%)⬆️

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last updatea3decc4...290d1a3. Read thecomment docs.

})
return
}
} else if userID, err := uuid.Parse(userQuery); err == nil {
Copy link
Member

Choose a reason for hiding this comment

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

It might reduce complexity if we just disallow getting by UUID entirely. I'm not sure it provides a ton of value anyways, because you need to get the user to get the ID. You could of course list users to do that, but then just use theusername.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I'm not inclined to drop the functionality because usernamesmight be able to be changed. UUIDs never will.

It's really nice to have a ID, as you can assume that will be constant no matter what.

Copy link
Member

Choose a reason for hiding this comment

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

Fair enough fair enough

})
return
}
} else if userID, err := uuid.Parse(userQuery); err == nil {
Copy link
Member

Choose a reason for hiding this comment

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

Fair enough fair enough

@EmyrkEmyrk merged commit69e26c4 intomainApr 29, 2022
@EmyrkEmyrk deleted the stevenmasley/user_by_username branchApril 29, 2022 16:44
@missknissmisskniss added this to theV2 Beta milestoneMay 15, 2022
kylecarbs pushed a commit that referenced this pull requestJun 10, 2022
* feat: Allow using username in user queries* Test needs a username/email to not match empty string
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@kylecarbskylecarbskylecarbs approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
V2 Beta
Development

Successfully merging this pull request may close these issues.

3 participants
@Emyrk@kylecarbs@misskniss

[8]ページ先頭

©2009-2025 Movatter.jp