From e7076c39a9143321a3cb3f20328448d981002b24 Mon Sep 17 00:00:00 2001 From: Kailan Blanks Date: Fri, 7 Aug 2026 15:12:31 +0100 Subject: [PATCH 1/2] [CDTOOL-1707] add Python starter kit to the static config The starter kits embedded into the CLI binary are injected at build time by ./scripts/config.sh, which holds a hardcoded list of starter kit repositories. Python language support (#1811) never added the Python starter kit to that list, so `compute init --language python` reported that no starter kits were configured and fell back to asking the user for a template git URL. Add compute-starter-kit-python-default to the list, and a test that asserts every language offered at the `compute init` prompt has at least one starter kit in the static config, so the same drift is caught for the next language we add. Co-Authored-By: Claude Opus 5 (1M context) --- pkg/commands/compute/language_test.go | 40 +++++++++++++++++++++++++++ scripts/config.sh | 1 + 2 files changed, 41 insertions(+) create mode 100644 pkg/commands/compute/language_test.go diff --git a/pkg/commands/compute/language_test.go b/pkg/commands/compute/language_test.go new file mode 100644 index 000000000..38b7cb795 --- /dev/null +++ b/pkg/commands/compute/language_test.go @@ -0,0 +1,40 @@ +package compute_test + +import ( + "testing" + + toml "github.com/pelletier/go-toml" + + "github.com/fastly/cli/pkg/commands/compute" + "github.com/fastly/cli/pkg/config" +) + +// TestStaticConfigStarterKits validates that every language the CLI offers at +// the `compute init` prompt has at least one starter kit in the static config +// embedded into the binary. +// +// The starter kits are injected into the static config at build time by +// ./scripts/config.sh, which holds its own hardcoded list of starter kit +// repositories. Adding a language without also updating that list leaves users +// of the new language unable to init a project (see CDTOOL-1707), and this test +// is here to catch that drift. +// +// NOTE: The static config is generated, not committed, so run `make config` +// before running this test locally. +func TestStaticConfigStarterKits(t *testing.T) { + var f config.File + if err := toml.Unmarshal(config.Static, &f); err != nil { + t.Fatalf("failed to unmarshal the static config: %s", err) + } + + for _, language := range compute.NewLanguages(f.StarterKits) { + // The 'other' language is for users bringing their own Wasm binary and so + // has no starter kits by design. + if language.Name == "other" { + continue + } + if len(language.StarterKits) == 0 { + t.Errorf("no starter kits found in the static config for language %q: add its starter kit repositories to the 'kits' list in ./scripts/config.sh", language.Name) + } + } +} diff --git a/scripts/config.sh b/scripts/config.sh index c9cd2f0dc..667272085 100755 --- a/scripts/config.sh +++ b/scripts/config.sh @@ -21,6 +21,7 @@ kits=( compute-starter-kit-typescript compute-starter-kit-cpp-default compute-starter-kit-cpp-empty + compute-starter-kit-python-default ) function parse() { From caf2f094f30fd316064dd4ad96b48edb83db331d Mon Sep 17 00:00:00 2001 From: Kailan Blanks Date: Fri, 7 Aug 2026 15:13:30 +0100 Subject: [PATCH 2/2] docs(changelog): note the Python starter kit fix Co-Authored-By: Claude Opus 5 (1M context) --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3060bc4d2..03fbc87c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ ### Bug Fixes: +- fix(compute): add Python starter kit to the static config ([#1877](https://github.com/fastly/cli/pull/1877)) + ### Enhancements: - feat(audit-log): add event-mapping command group ([#1875](https://github.com/fastly/cli/pull/1875))