Skip to content

feat: filter users by github user id in the users list CLI command#17029

Merged
hugodutka merged 6 commits into
mainfrom
hugodutka/list-users-by-github-user-id
Mar 21, 2025
Merged

feat: filter users by github user id in the users list CLI command#17029
hugodutka merged 6 commits into
mainfrom
hugodutka/list-users-by-github-user-id

Conversation

@hugodutka

@hugodutka hugodutka commented Mar 20, 2025

Copy link
Copy Markdown
Contributor

Add the --github-user-id option to coder users list, which makes the command only return users with a matching GitHub user id. This will enable https://github.com/coder/start-workspace-action to find a Coder user that corresponds to a GitHub user requesting to start a workspace.

@hugodutka hugodutka changed the title feature: filter users by github user id in the users list CLI command feat: filter users by github user id in the users list CLI command Mar 20, 2025
@hugodutka hugodutka marked this pull request as ready for review March 21, 2025 11:26
@hugodutka hugodutka requested a review from johnstcn March 21, 2025 11:26
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()),
})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

suggestion: explicitly return the zero value here

Comment on lines +227 to +229
WHEN @github_com_user_id :: bigint != 0 THEN
github_com_user_id = @github_com_user_id
ELSE true

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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:

At time of implementation, this is used to check if the user has starred the Coder repository.

It may be worth updating this comment in a follow-up now that it's becoming more of a load-bearing number.

@hugodutka hugodutka force-pushed the hugodutka/list-users-by-github-user-id branch from f29590e to d08dd3b Compare March 21, 2025 11:39
@hugodutka hugodutka merged commit a71aa20 into main Mar 21, 2025
@hugodutka hugodutka deleted the hugodutka/list-users-by-github-user-id branch March 21, 2025 12:30
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants