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

Merged
hugodutka merged 4 commits intomainfromhugodutka/has-ai-task-filters
Jun 18, 2025

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?

Copy link
Contributor

Choose a reason for hiding this comment

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

Bump

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Oh, sorry about that - yes, that's the only place. Only the SQL filter of theGetTemplates query is affected, andTemplateConverter is only used forGetTemplates.

@hugodutkahugodutkaforce-pushed thehugodutka/has-ai-task-filters branch from0adf1f2 to32cc427CompareJune 18, 2025 14:46
return false, xerrors.Errorf("get workspace build parameters: %w", err)
}
for _, param := range parameters {
if param.Name == "AI Prompt" && param.Value != "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

SELECT 1
FROM workspace_build_parameters
WHERE workspace_build_parameters.workspace_build_id = latest_build.id
AND workspace_build_parameters.name = 'AI Prompt'
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm we may want to accept this name as an arg, but could get tricky since this is used in a few places.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

If we want to enforce that this constant matches the constant in go code, I'd rather define a helper function:

CREATEFUNCTIONai_prompt_param_name() RETURNSTEXTAS $$BEGIN    RETURN'AI Prompt';END;$$ LANGUAGE plpgsql IMMUTABLE;

Then use that function in the query, and add a test that checks if the result of that function matches the constant in go code.

@@ -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.

Bump

@hugodutkahugodutka merged commit591f5db intomainJun 18, 2025
36 checks passed
@hugodutkahugodutka deleted the hugodutka/has-ai-task-filters branchJune 18, 2025 16:22
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJun 18, 2025
@hugodutka
Copy link
ContributorAuthor

related to#18158

Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
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