-
Notifications
You must be signed in to change notification settings - Fork 1.1k
chore: remove deprecated AITaskPromptParameterName constant #21023
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
a52a4a1 to
f2eae91
Compare
This removes the deprecated AITaskPromptParameterName constant and all backward compatibility code that was added in v2.28. Changes: - Remove AITaskPromptParameterName constant from codersdk/aitasks.go - Remove backward compatibility code in coderd/aitasks.go that automatically 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 - Update toolsdk tests to not require AI Prompt parameter - Remove AITaskPromptParameterName from frontend TypeScript types - Remove preset prompt read-only feature from TaskPrompt component that relied on the AI Prompt parameter - Update test mocks (MockAIPromptPresets) to not include AI Prompt Task prompts are now exclusively stored in the tasks.prompt database column, as introduced in the migration that added the tasks table. Related: coder/internal#1150
f2eae91 to
705f201
Compare
|
|
||
| ## Tasks format from 2.28 onwards | ||
|
|
||
| In v2.28 and above, the following changes were made: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to modify/bump the version number specified here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this statement is still true. 🤔 It's more that in 2.29 we still allowed the syntax and had back-combat, but in 2.30 we're removing the back-compat too. But please correct me if I'm overlooking something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was a non-blocking suggestion so I'm happy to merge as-is
|
@mafredri QQ: Can we merge this PR now? |
Summary
This PR removes the deprecated
AITaskPromptParameterNameconstant and all backward compatibility code that was added in v2.28 for theAI Promptparameter.Background
In v2.28, task prompts were migrated from being stored as workspace build parameters (named "AI Prompt") to being stored directly in the
tasks.promptdatabase column. TheAITaskPromptParameterNameconstant was kept for backward compatibility with older templates that might still define an "AI Prompt" parameter.Changes
Backend
AITaskPromptParameterNameconstant fromcodersdk/aitasks.gocoderd/aitasks.gothat automatically populated the "AI Prompt" parameter for templates that defined itgithub.com/coder/terraform-provider-coder/v2/providerfrom codersdkcoderd/util/sliceimport as it's no longer neededdbfake.WorkspaceBuildBuilder.WithTask()to no longer set the AI Prompt parameterTests
OK AIPromptBackCompattest case fromcoderd/aitasks_test.gotoolsdk_test.goto not require AI Prompt parameter in template versionFrontend
AITaskPromptParameterNameconstant fromsite/src/api/typesGenerated.tsTaskPrompt.tsxcomponent that relied on the AI Prompt parameterMockAIPromptPresetstest mock to not include the AI Prompt parameterReadOnlyPresetPromptstory toWithAIPresetsResult
Task prompts are now exclusively stored in the
tasks.promptdatabase column. Templates no longer need to define an "AI Prompt" parameter to work with tasks.Note: The Terraform provider (
github.com/coder/terraform-provider-coder) may still require this parameter forcoder_ai_taskresources. That's a separate change tracked in a corresponding provider issue.Closes coder/internal#1150