- Notifications
You must be signed in to change notification settings - Fork1.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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Open
mafredri wants to merge1 commit intomainChoose a base branch fromfix-deprecated-parameter-removal
base:main
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
+22 −166
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
a52a4a1 tof2eae91CompareThis removes the deprecated AITaskPromptParameterName constant andall 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 PromptTask prompts are now exclusively stored in the tasks.prompt databasecolumn, as introduced in the migration that added the tasks table.Related:coder/internal#1150
f2eae91 to705f201Compare2 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading.Please reload this page.
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.Closescoder/internal#1150