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

chore: support the has_ai_task column in template version and workspace insert queries#18385

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 3 commits intomainfromhugodutka/insert-workspace-build-ai-task
Jun 16, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletionscoderd/database/dbgen/dbgen.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -369,6 +369,7 @@ func WorkspaceBuild(t testing.TB, db database.Store, orig database.WorkspaceBuil
UUID: uuid.UUID{},
Valid:false,
}),
HasAITask:orig.HasAITask,
})
iferr!=nil {
returnerr
Expand DownExpand Up@@ -943,6 +944,7 @@ func TemplateVersion(t testing.TB, db database.Store, orig database.TemplateVers
JobID:takeFirst(orig.JobID,uuid.New()),
CreatedBy:takeFirst(orig.CreatedBy,uuid.New()),
SourceExampleID:takeFirst(orig.SourceExampleID, sql.NullString{}),
HasAITask:orig.HasAITask,
})
iferr!=nil {
returnerr
Expand Down
2 changes: 2 additions & 0 deletionscoderd/database/dbmem/dbmem.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9382,6 +9382,7 @@ func (q *FakeQuerier) InsertTemplateVersion(_ context.Context, arg database.Inse
JobID: arg.JobID,
CreatedBy: arg.CreatedBy,
SourceExampleID: arg.SourceExampleID,
HasAITask: arg.HasAITask,
}
q.templateVersions = append(q.templateVersions, version)
return nil
Expand DownExpand Up@@ -10061,6 +10062,7 @@ func (q *FakeQuerier) InsertWorkspaceBuild(_ context.Context, arg database.Inser
MaxDeadline: arg.MaxDeadline,
Reason: arg.Reason,
TemplateVersionPresetID: arg.TemplateVersionPresetID,
HasAITask: arg.HasAITask,
}
q.workspaceBuilds = append(q.workspaceBuilds, workspaceBuild)
return nil
Expand Down
14 changes: 10 additions & 4 deletionscoderd/database/queries.sql.go
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

5 changes: 3 additions & 2 deletionscoderd/database/queries/templateversions.sql
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,10 +88,11 @@ INSERT INTO
readme,
job_id,
created_by,
source_example_id
source_example_id,
has_ai_task
)
VALUES
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11);
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12);

-- name: UpdateTemplateVersionByID :exec
UPDATE
Expand Down
5 changes: 3 additions & 2 deletionscoderd/database/queries/workspacebuilds.sql
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -121,10 +121,11 @@ INSERT INTO
deadline,
max_deadline,
reason,
template_version_preset_id
template_version_preset_id,
has_ai_task
)
VALUES
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14);
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15);

-- name: UpdateWorkspaceBuildCostByID :exec
UPDATE
Expand Down
3 changes: 3 additions & 0 deletionscoderd/templateversions.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1730,6 +1730,9 @@ func (api *API) postTemplateVersionsByOrganization(rw http.ResponseWriter, r *ht
String:req.ExampleID,
Valid:req.ExampleID!="",
},
// appease the exhaustruct linter
// TODO: set this to whether the template version defines a `coder_ai_task` tf resource
HasAITask:false,
})
iferr!=nil {
ifdatabase.IsUniqueViolation(err,database.UniqueTemplateVersionsTemplateIDNameKey) {
Expand Down
3 changes: 3 additions & 0 deletionscoderd/wsbuilder/wsbuilder.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -425,6 +425,9 @@ func (b *Builder) buildTx(authFunc func(action policy.Action, object rbac.Object
UUID: b.templateVersionPresetID,
Valid: b.templateVersionPresetID != uuid.Nil,
},
// appease the exhaustruct linter
// TODO: set this to whether the build included a `coder_ai_task` tf resource
HasAITask: false,
})
if err != nil {
code := http.StatusInternalServerError
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp