Skip to content

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 21, 2025

Conversation

hugodutka
Copy link
Contributor

@hugodutka hugodutka commented Mar 20, 2025

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
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
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
31 of 32 checks passed
@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