- Notifications
You must be signed in to change notification settings - Fork1.2k
feat: filter users by github user id in the users list CLI command#17029
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
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes from1 commit
Commits
Show all changes
6 commits Select commitHold shift + click to select a range
ab3d254 query
hugodutka2e96d64 make gen
hugodutka5394f26 impl GetUsers github user id filter
hugodutka4318781 add github user id filter to the users list cli command
hugodutka1f2b078 make update-golden-files
hugodutkad08dd3b make gen
hugodutkaFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
impl GetUsers github user id filter
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commit5394f264e473d2a572cb29b9f77de0105172ff32
There are no files selected for viewing
10 changes: 10 additions & 0 deletionscoderd/database/dbmem/dbmem.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletionscoderd/httpapi/queryparams.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -82,6 +82,20 @@ func (p *QueryParamParser) Int(vals url.Values, def int, queryParam string) int | ||
| return v | ||
| } | ||
| func (p *QueryParamParser) Int64(vals url.Values, def int64, queryParam string) int64 { | ||
| v, err := parseQueryParam(p, vals, func(v string) (int64, error) { | ||
| return strconv.ParseInt(v, 10, 64) | ||
| }, def, queryParam) | ||
| if err != nil { | ||
| p.Errors = append(p.Errors, codersdk.ValidationError{ | ||
| Field: queryParam, | ||
| Detail: fmt.Sprintf("Query param %q must be a valid 64-bit integer: %s", queryParam, err.Error()), | ||
| }) | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. suggestion: explicitly return the zero value here | ||
| return 0 | ||
| } | ||
| return v | ||
| } | ||
| // PositiveInt32 function checks if the given value is 32-bit and positive. | ||
| // | ||
| // We can't use `uint32` as the value must be within the range <0,2147483647> | ||
15 changes: 8 additions & 7 deletionscoderd/searchquery/search.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
21 changes: 11 additions & 10 deletionscoderd/users.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletionscoderd/users_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.