Skip to content

chore: add organization search query to workspaces #14474

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 2 commits into from
Aug 28, 2024

Conversation

Emyrk
Copy link
Member

@Emyrk Emyrk commented Aug 28, 2024

Closes #14444

@Emyrk Emyrk requested a review from f0ssel August 28, 2024 19:29
@@ -95,7 +75,7 @@ func Users(query string) (database.GetUsersParams, []codersdk.ValidationError) {
return filter, parser.Errors
}

func Workspaces(query string, page codersdk.Pagination, agentInactiveDisconnectTimeout time.Duration) (database.GetWorkspacesParams, []codersdk.ValidationError) {
func Workspaces(ctx context.Context, db database.Store, query string, page codersdk.Pagination, agentInactiveDisconnectTimeout time.Duration) (database.GetWorkspacesParams, []codersdk.ValidationError) {
Copy link
Contributor

Choose a reason for hiding this comment

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

aside: I see why we do it in this package, but this is kind of a weird naming scheme for something that returns database query params.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fair. Maybe it should be named WorkspacesFilter or something. I won't address here though

Comment on lines +273 to +277
db := dbmem.New()
if c.Setup != nil {
c.Setup(t, db)
}
values, errs := searchquery.Workspaces(context.Background(), db, c.Query, codersdk.Pagination{}, 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we not use the traditional way of getting a DB in tests so this can run against postgres too?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd prefer not to for this. What would be even better is if I used the mock database, but I haven't messed with that at all yet.

@Emyrk Emyrk merged commit b96ac67 into main Aug 28, 2024
27 checks passed
@Emyrk Emyrk deleted the stevenmasley/workspace_org_search branch August 28, 2024 20:18
@github-actions github-actions bot locked and limited conversation to collaborators Aug 28, 2024
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.

Add organizations to workspace search query
2 participants