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 has-ai-task filters to the /workspaces and /templates endpoints#18387

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

Open
hugodutka wants to merge4 commits intomain
base:main
Choose a base branch
Loading
fromhugodutka/has-ai-task-filters

Conversation

hugodutka
Copy link
Contributor

This PR allows filtering templates and workspaces with thehas-ai-task filter as described in theCoder Tasks RFC.

@hugodutkahugodutka changed the base branch frommain tohugodutka/insert-workspace-build-ai-taskJune 16, 2025 13:02
@hugodutkahugodutkaforce-pushed thehugodutka/has-ai-task-filters branch 2 times, most recently fromfb3b8ec tod32f3e4CompareJune 16, 2025 13:49
Base automatically changed fromhugodutka/insert-workspace-build-ai-task tomainJune 16, 2025 14:07
@hugodutkahugodutkaforce-pushed thehugodutka/has-ai-task-filters branch from41eebab to31aa2b2CompareJune 16, 2025 14:09
@hugodutkahugodutka marked this pull request as ready for reviewJune 16, 2025 15:20
Copy link
Contributor

@dannykoppingdannykopping left a comment

Choose a reason for hiding this comment

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

LGTM, with a couple nits.

@@ -25,7 +25,7 @@ func userACLMatcher(m sqltypes.VariableMatcher) sqltypes.VariableMatcher {
func TemplateConverter() *sqltypes.VariableConverter {
matcher := sqltypes.NewVariableConverter().RegisterMatcher(
resourceIDMatcher(),
organizationOwnerMatcher(),
sqltypes.StringVarMatcher("t.organization_id :: text", []string{"input", "object", "org_owner"}),
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the only case where we need to update theorganization_id alias?

Comment on lines +1849 to +1850
templateWithAI := coderdtest.CreateTemplate(t, client, user.OrganizationID, versionWithAI.ID)
templateWithoutAI := coderdtest.CreateTemplate(t, client, user.OrganizationID, versionWithoutAI.ID)
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's keep the terminology consistent. This would apply toversionWith{,out}AI as well.

Suggested change
templateWithAI:=coderdtest.CreateTemplate(t,client,user.OrganizationID,versionWithAI.ID)
templateWithoutAI:=coderdtest.CreateTemplate(t,client,user.OrganizationID,versionWithoutAI.ID)
templateWithAITask:=coderdtest.CreateTemplate(t,client,user.OrganizationID,versionWithAI.ID)
templateWithoutAITask:=coderdtest.CreateTemplate(t,client,user.OrganizationID,versionWithoutAI.ID)

@@ -136,7 +136,7 @@ func (api *API) workspace(rw http.ResponseWriter, r *http.Request) {
// @Security CoderSessionToken
// @Produce json
// @Tags Workspaces
// @Param q query string false "Search query in the format `key:value`. Available keys are: owner, template, name, status, has-agent, dormant, last_used_after, last_used_before."
// @Param q query string false "Search query in the format `key:value`. Available keys are: owner, template, name, status, has-agent, dormant, last_used_after, last_used_before, has-ai-task."
Copy link
Contributor

Choose a reason for hiding this comment

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

Damn, seems like we already have two naming conventions (has-agent,last_used_after) 😞
I think we should support both by replacing the separators with one or the other.
Could be in a separate PR though, or just turned into an issue since this isn't your fault.

HasAITask: true,
})

wsWithoutAI := dbgen.Workspace(t, db, database.WorkspaceTable{
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@dannykoppingdannykoppingdannykopping approved these changes

Assignees

@hugodutkahugodutka

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@hugodutka@dannykopping

[8]ページ先頭

©2009-2025 Movatter.jp