Skip to content

Commit db40140

Browse files
authored
chore: mark warehouse id flag as deprecated (#4524)
## Changes <!-- Brief summary of your changes that is easy to understand --> bringing this back to avoid breaking the agent until we change the skills ## Why <!-- Why are these changes needed? Provide the context that the reviewer might be missing. For example, were there any decisions behind the change that are not reflected in the code itself? --> ## Tests <!-- How have you tested the changes? --> <!-- If your PR needs to be included in the release notes for next release, add a separate entry in NEXT_CHANGELOG.md as part of your PR. --> Co-authored-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
1 parent e493032 commit db40140

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

cmd/apps/init.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ func newInitCmd() *cobra.Command {
5555
branch string
5656
version string
5757
name string
58+
warehouseID string
5859
description string
5960
outputDir string
6061
pluginsFlag []string
@@ -135,6 +136,7 @@ Environment variables:
135136
version: version,
136137
name: name,
137138
nameProvided: cmd.Flags().Changed("name"),
139+
warehouseID: warehouseID,
138140
description: description,
139141
outputDir: outputDir,
140142
plugins: pluginsFlag,
@@ -152,6 +154,8 @@ Environment variables:
152154
cmd.Flags().StringVar(&branch, "branch", "", "Git branch or tag (for GitHub templates, mutually exclusive with --version)")
153155
cmd.Flags().StringVar(&version, "version", "", "AppKit version to use (default: latest release, use 'latest' for main branch)")
154156
cmd.Flags().StringVar(&name, "name", "", "Project name (prompts if not provided)")
157+
cmd.Flags().StringVar(&warehouseID, "warehouse-id", "", "SQL warehouse ID")
158+
_ = cmd.Flags().MarkDeprecated("warehouse-id", "use --set <plugin>.sql-warehouse.id=<value> instead")
155159
cmd.Flags().StringArrayVar(&setValues, "set", nil, "Set resource values (format: plugin.resourceKey.field=value, can specify multiple)")
156160
cmd.Flags().StringVar(&description, "description", "", "App description")
157161
cmd.Flags().StringVar(&outputDir, "output-dir", "", "Directory to write the project to")
@@ -170,6 +174,7 @@ type createOptions struct {
170174
version string
171175
name string
172176
nameProvided bool // true if --name flag was explicitly set (enables "flags mode")
177+
warehouseID string
173178
description string
174179
outputDir string
175180
plugins []string
@@ -646,6 +651,17 @@ func runCreate(ctx context.Context, opts createOptions) error {
646651
}
647652
}
648653

654+
// Expand deprecated --warehouse-id into --set values for each plugin that has a sql-warehouse resource.
655+
if opts.warehouseID != "" {
656+
for _, p := range m.GetPlugins() {
657+
for _, r := range append(p.Resources.Required, p.Resources.Optional...) {
658+
if r.Type == "sql_warehouse" {
659+
opts.setValues = append(opts.setValues, fmt.Sprintf("%s.%s.id=%s", p.Name, r.Key(), opts.warehouseID))
660+
}
661+
}
662+
}
663+
}
664+
649665
// Parse --set values (override any prompted values)
650666
setVals, err := parseSetValues(opts.setValues, m)
651667
if err != nil {

0 commit comments

Comments
 (0)