Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add shared filter to workspaces query#19807

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
brettkolodny merged 5 commits intomainfrombrett/i972
Sep 16, 2025
Merged

Conversation

brettkolodny
Copy link
Contributor

@brettkolodnybrettkolodny commentedSep 12, 2025
edited
Loading

Adds ashared:<boolean> search query to the/workspaces [get] endpoint

CleanShot.2025-09-15.at.11.13.25.mp4

Closescoder/internal#972

@brettkolodnybrettkolodny marked this pull request as ready for reviewSeptember 15, 2025 15:15
Copy link
Member

@aslilacaslilac left a comment

Choose a reason for hiding this comment

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

looks great! could we add some tests that actually hit the database tho?

brettkolodny reacted with thumbs up emoji
Copy link
Member

@aslilacaslilac left a comment
edited
Loading

Choose a reason for hiding this comment

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

I don't think these tests are actually testing much right now, sinceasRequestOption didn't get wired up but they're still passing. 😅

nvm, I didn't see that they're actually failing

// FilterQuery supports a raw filter query string
FilterQuerystring`json:"q,omitempty"`
// Shared is a whether the workspace is shared with any users or groups
Sharedbool`json:"shared" typescript:"-"`
Copy link
Member

Choose a reason for hiding this comment

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

  1. WorkspaceFilter has anasRequestOption method that also needs to be updated. that's where theq param actually gets serialized.

  2. this field probably needs to be*bool so that you can setshared:false as distinct from "noshared: filter"

Comment on lines 519 to 522
// FilterQuery supports a raw filter query string
FilterQuerystring`json:"q,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

nit: I think this being last was intentional since it doesn't quite "fit in", and that should be preserved

@brettkolodny
Copy link
ContributorAuthor

I don't think these tests are actually testing much right now, sinceasRequestOption didn't get wired up but they're still passing. 😅

nvm, I didn't see that they're actually failing

Yeah I'm still working on it, I'll re-request review when it's ready

@brettkolodnybrettkolodny marked this pull request as draftSeptember 15, 2025 21:20
@brettkolodnybrettkolodnyforce-pushed thebrett/i972 branch 3 times, most recently fromc0dc8e8 tobf4b351CompareSeptember 15, 2025 21:48
Comment on lines +1846 to +1850
workspaces,err:=client.Workspaces(ctx, codersdk.WorkspaceFilter{
Shared:ptr.Ref(true),
})
require.NoError(t,err,"fetch workspaces")
require.Equal(t,1,workspaces.Count,"expected only one workspace")
Copy link
Member

Choose a reason for hiding this comment

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

since there's only one workspace here, could we also run this withShared: ptr.Ref(false) and check the length to be 0?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I am creating two workspaces if you look at the setup

Comment on lines +3619 to +3624
workspaces,err:=client.Workspaces(ctx, codersdk.WorkspaceFilter{
Shared:ptr.Ref(true),
})
require.NoError(t,err,"fetch workspaces")
require.Equal(t,1,workspaces.Count,"expected only one workspace")
require.Equal(t,workspaces.Workspaces[0].ID,sharedWorkspace.ID)
Copy link
Member

Choose a reason for hiding this comment

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

and perhaps the same thing here for the groups case

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Same as above, a second workspace is being created but not shared

@brettkolodnybrettkolodny merged commite6b04d1 intomainSep 16, 2025
53 of 55 checks passed
@brettkolodnybrettkolodny deleted the brett/i972 branchSeptember 16, 2025 16:37
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsSep 16, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@aslilacaslilacaslilac approved these changes

Assignees

@brettkolodnybrettkolodny

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Addshared: filter to /workspaces endpoint
2 participants
@brettkolodny@aslilac

[8]ページ先頭

©2009-2025 Movatter.jp