- Notifications
You must be signed in to change notification settings - Fork925
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
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
ab3d254
2e96d64
5394f26
4318781
1f2b078
d08dd3b
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -223,6 +223,11 @@ WHERE | ||
created_at >= @created_after | ||
ELSE true | ||
END | ||
AND CASE | ||
WHEN @github_com_user_id :: bigint != 0 THEN | ||
github_com_user_id = @github_com_user_id | ||
ELSE true | ||
Comment on lines +227 to +229 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. I don't think this is worth blocking on, but the comment for this column mentions:
It may be worth updating this comment in a follow-up now that it's becoming more of a load-bearing number. | ||
END | ||
-- End of filters | ||
-- Authorize Filter clause will be injected below in GetAuthorizedUsers | ||
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()), | ||
}) | ||
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> | ||
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.