Source starter kits from new service#1846
Conversation
|
If I'm not mistaken, the only usage of Rust in this repository was for |
anthony-gomez-fastly
left a comment
There was a problem hiding this comment.
Looks great! thank you!
|
This must not be merged until the https://github.com/fastly/compute-starter-kits repo goes public |
f18c849 to
aaef935
Compare
@kpfleming Can you help me with that? It's hard for me to tell which ones can be safely removed, because some of the CI seems to still use Rust (e.g. in testing where it builds a sample rust app) |
|
@anthony-gomez-fastly @rcaril @kpfleming |
Let's just ignore the removal of Rust then, it's not that important. |
|
Ty for updating the command docs, looks great |
Change summary
Fastly is consolidating the ~40 standalone
fastly/compute-starter-kit-*template repos into a single monorepo, served by a new starter-kit edge service (https://compute-starter-kits.fastly.dev).This PR updates
fastly compute initto talk to it.New
--from=starter-kit/<lang>/<name>form. Resolves directly against a tarball endpoint exposed by the edge service, reusing the existing tarball-fetch/extract code path unchanged (pkg/commands/compute/init.go).Transparent legacy-repo redirect. When
--from(or a re-clone of a previously-deployed service'scloned_frommetadata) points at afastly/compute-starter-kit-*repo, the CLI checks for a root-level.starter-kit-idmarker file before cloning. If present, its contents (starter-kit/<lang>/<name>) are resolved against the new service instead — the legacy repo is never cloned. Absent/unreadable/malformed marker files fall back to today's git-clone behavior unchanged. Seepkg/commands/compute/starterkit_redirect.go.Interactive picker now sources live from the edge service instead of the ~11-kit list previously baked into
pkg/config/config.tomlat build time. Results are filtered tocatalog.show_on_cliand to kits supported by the running CLI version (catalog.min_cli_version), with the "default" kit sorted first (pkg/commands/compute/language.go).New
pkg/starterkitpackage: typed client for the edge service (Kits,TarballURL,ParseFrom), mirroring the existingpkg/githubclient pattern.Removed the old mechanism:
scripts/config.sh's per-kitcurl/tomlqloop,config.StarterKit/StarterKitLanguagestypes, and the[[starter-kits]]section of the generated config.Two latent bugs surfaced (and are fixed) by this change:
revision.AppVersion's "unknown version" sentinel (v0.0.0-unknown), which parses as valid semver and is lower than any realmin_cli_version— this hid every starter kit for anyone running a local/dev build. Now treated the same as "unknown."pkg/file/archive.go'sExtract()checked forfastly.tomlrelative to the process's cwd instead of the archive's actual destination — invisible until now because every archive-extraction path previously haddst == cwd; exposed once the default interactive kit became tarball-sourced, breakingcompute init --directory <dir>.All Submissions
Large portions of this submissions were written with assistance from Claude Code.
New Feature Submissions
Changes to Core Features
New unit tests in
pkg/starterkit,pkg/commands/compute/language_test.go, andpkg/commands/compute/starterkit_redirect_test.go(all fully mocked, no network). Existingpkg/commands/compute/init_test.goscenarios updated for the newstarterkit.Kit-based fixtures, plus two new scenarios exercising--from=starter-kit/<lang>/<name>and the.starter-kit-idredirect end-to-end against the real, live edge service and a real legacy repo fixture (github.com/fastly/compute-starter-kit-typescript-default) underTEST_COMPUTE_INIT=1.make test(full suite,-race) andgolangci-lint run --new-from-rev=origin/mainboth pass clean.User Impact
fastly compute init --from starter-kit/<lang>/<name>is a new, directly-usable form.--from=<github-url>and local-path/zip/tar.gz behavior is unchanged.fastly/compute-starter-kit-*repo that gets a.starter-kit-idmarker file added will transparently redirect existing users of--from=<that-repo-url>to the new service, with no CLI-side action needed, so long as they update to this new version.Are there any considerations that need to be addressed for release?
min_cli_version: "16.0.0"— this should ship as (or after) v16.0.0, otherwise the interactive picker will show zero kits..starter-kit-idmarker file format (when writing this file into legacy repos) isstarter-kit/<lang>/<name>(matches the new--fromsyntax).config_versionbump needed — the removed[[starter-kits]]config section is a pure field removal, and old persisted user configs with stale entries there are simply ignored by the TOML parser.