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: make has_ai_task fields on workspace builds and template versions nullable#18403

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 2 commits intomainfromhugodutka/nullable-has-ai-task
Jun 17, 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
4 changes: 2 additions & 2 deletionscoderd/database/dump.sql
View file
Open in desktop

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

View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
ALTER TABLE template_versions ALTER COLUMN has_ai_task SET DEFAULT false;
ALTER TABLE template_versions ALTER COLUMN has_ai_task SET NOT NULL;
ALTER TABLE workspace_builds ALTER COLUMN has_ai_task SET DEFAULT false;
ALTER TABLE workspace_builds ALTER COLUMN has_ai_task SET NOT NULL;
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
-- The fields must be nullable because there's a period of time between
-- inserting a row into the database and finishing the "plan" provisioner job
-- when the final value of the field is unknown.
ALTER TABLE template_versions ALTER COLUMN has_ai_task DROP DEFAULT;
ALTER TABLE template_versions ALTER COLUMN has_ai_task DROP NOT NULL;
ALTER TABLE workspace_builds ALTER COLUMN has_ai_task DROP DEFAULT;
ALTER TABLE workspace_builds ALTER COLUMN has_ai_task DROP NOT NULL;
8 changes: 4 additions & 4 deletionscoderd/database/models.go
View file
Open in desktop

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

4 changes: 2 additions & 2 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: 4 additions & 1 deletioncoderd/templateversions.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1732,7 +1732,10 @@ func (api *API) postTemplateVersionsByOrganization(rw http.ResponseWriter, r *ht
},
// appease the exhaustruct linter
// TODO: set this to whether the template version defines a `coder_ai_task` tf resource
HasAITask: false,
HasAITask: sql.NullBool{
Bool: false,
Valid: false,
},
})
if err != nil {
if database.IsUniqueViolation(err, database.UniqueTemplateVersionsTemplateIDNameKey) {
Expand Down
5 changes: 4 additions & 1 deletioncoderd/wsbuilder/wsbuilder.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -427,7 +427,10 @@ func (b *Builder) buildTx(authFunc func(action policy.Action, object rbac.Object
},
// appease the exhaustruct linter
// TODO: set this to whether the build included a `coder_ai_task` tf resource
HasAITask: false,
HasAITask: sql.NullBool{
Bool: false,
Valid: false,
},
})
if err != nil {
code := http.StatusInternalServerError
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp