mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
refactor: remove deprecated AITaskPromptParameterName constant (#21023)
This removes the deprecated AITaskPromptParameterName constant and all backward compatibility code that was added for v2.28. - Remove AITaskPromptParameterName constant from codersdk/aitasks.go - Remove backward compatibility code in coderd/aitasks.go that populated the "AI Prompt" parameter for templates that defined it - Remove the backward compatibility test (OK AIPromptBackCompat) - Update dbfake to no longer set the AI Prompt parameter - Remove AITaskPromptParameterName from frontend TypeScript types - Remove preset prompt read-only feature from TaskPrompt component - Update docs to reflect that pre-2.28 definition is no longer supported Task prompts are now exclusively stored in the tasks.prompt database column, as introduced in the migration that added the tasks table.
This commit is contained in:
@@ -10,23 +10,8 @@ import (
|
||||
|
||||
"github.com/google/uuid"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/coder/terraform-provider-coder/v2/provider"
|
||||
)
|
||||
|
||||
// AITaskPromptParameterName is the name of the parameter used to pass prompts
|
||||
// to AI tasks.
|
||||
//
|
||||
// Deprecated: This constant is deprecated and maintained only for backwards
|
||||
// compatibility with older templates. Task prompts are now stored directly
|
||||
// in the tasks.prompt database column. New code should access prompts via
|
||||
// the Task.InitialPrompt field returned from task endpoints.
|
||||
//
|
||||
// This constant will be removed in a future major version. Templates should
|
||||
// not rely on this parameter name, as the backend will continue to create it
|
||||
// automatically for compatibility but reads from tasks.prompt.
|
||||
const AITaskPromptParameterName = provider.TaskPromptParameterName
|
||||
|
||||
// CreateTaskRequest represents the request to create a new task.
|
||||
type CreateTaskRequest struct {
|
||||
TemplateVersionID uuid.UUID `json:"template_version_id" format:"uuid"`
|
||||
|
||||
@@ -1017,7 +1017,6 @@ func TestTools(t *testing.T) {
|
||||
ProvisionApply: echo.ApplyComplete,
|
||||
ProvisionGraph: []*proto.Response{
|
||||
{Type: &proto.Response_Graph{Graph: &proto.GraphComplete{
|
||||
Parameters: []*proto.RichParameter{{Name: "AI Prompt", Type: "string"}},
|
||||
HasAiTasks: true,
|
||||
}}},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user