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

Commitbc241a7

Browse files
fix: template import job
It appears I accidentally modified the template import job to dovalidation on a value that will be emitted as empty (oops). Removingthat now stops the provisioner from failing on import.The logic for attempting to pull the prompt out of the build parametermakes no sense now as the new world no longer has a coder parameter forthe prompt. This will need to be plumbed through with the rest of theCoder Task changes.
1 parent0d1a814 commitbc241a7

File tree

2 files changed

+7
-27
lines changed

2 files changed

+7
-27
lines changed

‎coderd/provisionerdserver/provisionerdserver.go‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -597,18 +597,12 @@ func (s *server) acquireProtoJob(ctx context.Context, job database.ProvisionerJo
597597
returnnil,failJob(fmt.Sprintf("get workspace build parameters: %s",err))
598598
}
599599

600+
// TODO(DanielleMaywood):
601+
// Plumb a task prompt into this when we have the new data-model ready
600602
vartaskPromptstring
601-
for_,buildParameter:=rangeworkspaceBuildParameters {
602-
ifbuildParameter.Name!=codersdk.AITaskPromptParameterName {
603-
continue
604-
}
605-
606-
taskPrompt=buildParameter.Value
607-
break
608-
}
609603

610604
// TODO(DanielleMaywood):
611-
// Plumb a task ID into this when we have the new data-model ready.
605+
// Plumb a task ID into this when we have the new data-model ready
612606
vartaskIDstring
613607

614608
dbExternalAuthProviders:= []database.ExternalAuthProvider{}

‎provisioner/terraform/resources.go‎

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"fmt"
66
"math"
7-
"slices"
87
"strings"
98

109
"github.com/awalterschulze/gographviz"
@@ -1023,18 +1022,13 @@ func ConvertState(ctx context.Context, modules []*tfjson.StateModule, rawGraph s
10231022
returnnil,xerrors.Errorf("decode coder_ai_task attributes: %w",err)
10241023
}
10251024

1026-
appID:=task.AppID
1027-
ifappID==""&&len(task.SidebarApp)>0 {
1028-
appID=task.SidebarApp[0].ID
1029-
}
1030-
ifappID=="" {
1031-
returnnil,xerrors.Errorf("coder_ai_task has no app_id defined")
1032-
}
1033-
10341025
aiTasks=append(aiTasks,&proto.AITask{
10351026
Id:task.ID,
1036-
AppId:appID,
1027+
AppId:task.AppID,
10371028
Prompt:task.Prompt,
1029+
SidebarApp:&proto.AITaskSidebarApp{
1030+
Id:task.AppID,
1031+
},
10381032
})
10391033
}
10401034

@@ -1069,14 +1063,6 @@ func ConvertState(ctx context.Context, modules []*tfjson.StateModule, rawGraph s
10691063
}
10701064

10711065
hasAITasks:=hasAITaskResources(graph)
1072-
ifhasAITasks {
1073-
hasPromptParam:=slices.ContainsFunc(parameters,func(param*proto.RichParameter)bool {
1074-
returnparam.Name==provider.TaskPromptParameterName
1075-
})
1076-
if!hasPromptParam {
1077-
returnnil,xerrors.Errorf("coder_parameter named '%s' is required when 'coder_ai_task' resource is defined",provider.TaskPromptParameterName)
1078-
}
1079-
}
10801066

10811067
return&State{
10821068
Resources:resources,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp