feat: resolve AppKit template version from compatibility manifest#5139
feat: resolve AppKit template version from compatibility manifest#5139
Conversation
Replace the hardcoded appkitDefaultVersion with a compatibility manifest that maps CLI versions to compatible AppKit template and Agent Skills versions. At runtime, apps init fetches the latest manifest from the AppKit GitHub repo. If the fetch fails, it falls back to an embedded copy. The resolution algorithm finds the nearest compatible version for the running CLI (exact match, nearest lower, or "next" for newer CLIs). The resolved skills version is passed to the skills installer via the DATABRICKS_SKILLS_REF context variable, ensuring apps init recommends a manifest-compatible skills version. Also add a Makefile target (fetch-compat-manifest) for CI to fetch the latest manifest before building the CLI binary. Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com>
- Add io.LimitReader (1MB cap) to fetchRemote to guard against corrupted or oversized HTTP responses. - Rewrite TestFetchManifest_RemoteSuccess and TestFetchManifest_FallbackToEmbedded using a roundTripFunc transport so requests actually reach the httptest server. Previously, manifestURL being a const meant the test server was never called and both tests passed only via the embedded fallback. Co-authored-by: Isaac
- Fix Resolve docstring to match actual nearest-lower behavior - Strengthen TestResolve_NewerThanAll with distinct next values - Fix import ordering in init.go - Use manifest resolution in manifest.go (was hardcoded) - Validate semver keys in parseManifest - Reduce manifest fetch timeout from 5s to 3s - Fix redirectToServer doc comment - Add missing Skills assertions in tests - Add test for invalid JSON fallback from remote Co-authored-by: Isaac
…fest
- Cache fetched manifest locally for 1h using libs/cache
- Add retry logic (2 retries, 300ms backoff) for runtime fetches
- Fetch latest manifest during build (Makefile + goreleaser)
- Replace checked-in manifest with {} placeholder
- Remove hardcoded appkitDefaultVersion fallback; manifest is sole source of truth
- Print resolved template and skills versions to user during apps init
- Remove version from skills post-install message (shown upfront instead)
Co-authored-by: Isaac
- Move libs/apps/compat/ → libs/depversions/ (cross-cutting, not apps-only) - Rename Entry.Appkit → Entry.AppKit - Embed resolved entry in internal/build/dep_versions.json instead of full manifest - Add build-time pin tool (internal/pindepversions) for goreleaser - Add ResolveAppKitVersion/ResolveAgentSkillsVersion convenience helpers - Remove cli-compat.json and fetch-compat-manifest Makefile target - Resolve() returns lowest entry (not "next") for old CLI versions Co-authored-by: Isaac
- Rename Entry.Skills → Entry.AgentSkills (JSON tag stays "skills") - Rename DepVersions.Skills → DepVersions.AgentSkills - Rename compat.go → depversions.go to match package name - Verified pin tool handles missing manifest gracefully (404 → warning, placeholder unchanged) Co-authored-by: Isaac
Use build-time pinned version from dep_versions.json in the --version flag help text. Release builds show the actual default; dev builds show a generic message since no version is pinned. Co-authored-by: Isaac
- Replace sort.Slice with slices.SortFunc (forbidigo) - Check w.Write error returns in test handlers (errcheck) Co-authored-by: Isaac
… fallback
- GetSkillsRef now resolves from compatibility manifest instead of
falling back to hardcoded SKILLS_VERSION file
- Delete SKILLS_VERSION and version.go — manifest is sole source of truth
- Remove DATABRICKS_SKILLS_REF env var override from apps init
(GetSkillsRef handles manifest resolution internally)
- Update all callers to handle GetSkillsRef error return
- Tests use t.Setenv("DATABRICKS_SKILLS_REF", ...) to bypass manifest
Co-authored-by: Isaac
Show "Using skills version X.Y.Z" before installation so the user knows which version was resolved from the compatibility manifest. Co-authored-by: Isaac
Approval status: pending
|
Summary
Decouples AppKit template and Agent Skills version pinning from CLI releases. Instead of hardcoded versions that require manual PRs to bump, both are now resolved from a compatibility manifest hosted in the AppKit repo.
Before
template-v0.24.0in CLI source; every bump required a CLI PRSKILLS_VERSIONfile in the installerAfter
cli-compat.jsonin the AppKit repo maps CLI versions → AppKit + Skills versions--versionhintgo run ./internal/pindepversions --version {{ .Version }}to embed the resolved entry--version/--branchflags andDATABRICKS_SKILLS_REFenv var still overrideDATABRICKS_CACHE_ENABLED=falsebypasses the cacheDesign Doc
https://docs.google.com/document/d/1qOchR4vnYAo_5a_oHyFdIdySBayzRc5bBmVZ0u-Mvus/edit?tab=t.0
Test plan
resolveEntryfallbackapps init/aitools installprint resolved versionsapps init --debugshows fetch URL and cache behaviorapps init --version Xoverrides manifestTesting locally
The manifest doesn't exist on
mainyet (pending appkit#333). Temporarily change the URL:export GOPROXY=go-proxy.dev.databricks.com make build