Resolve AppKit and Agent Skills versions from compatibility manifest#5139
Conversation
renaudhartert-db
left a comment
There was a problem hiding this comment.
Thanks for the PR @pkosiec. Could we have a chat internally about what you're trying to achieve? I'd like to make sure that this is aligned with the overall direction we're planning to evolve that command toward.
d7d005f to
3241ae2
Compare
- Fix stale libs/depversions/ references in README (renamed to libs/clicompat/) - Fix incorrect "next" key description (only used for dev builds, not newer-than-all) - Fix import ordering (clicompat before cmdctx/cmdio alphabetically) - Fix slices import grouping in clicompat_test.go (stdlib, not separate group) - Fix error format: semicolon instead of period before hint text - Fix FetchManifest godoc: "4-tier fallback" to match numbered list - Fix writeLocalManifest comment: explain temp-file-then-rename pattern - Fix README example values to match actual manifest - Fix flaky test: pre-populate cache to avoid real network calls Co-authored-by: Isaac
When the manifest resolves to a version that doesn't exist as a git tag (404), retry with the version from the embedded manifest. Only triggers on "not found" errors, not transient network failures. Also: - Rename EmbeddedDefaultAppKitVersion/EmbeddedResolve* to ResolveEmbeddedAppKitVersion/ResolveEmbeddedAgentSkillsVersion - Remove duplicate log lines (keep only log.Warnf, drop cmdio.LogString) - Drop ctx parameter from ResolveEmbedded* (not needed) Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com>
Address all review comments: add sentinel ErrNotFound and typed HTTPStatusError, validate manifest entry values, centralize not-found fallback for skills and AppKit consumers, skip retries on 4xx, add User-Agent header, support DATABRICKS_CACHE_ENABLED, and document pruning policy and trust model. Co-authored-by: Isaac
- Only fall back to embedded version when version was auto-resolved, not when user explicitly passed --version or --branch - Skip fallback if embedded version matches the one already tried - Log warning when embedded fallback resolution itself fails Co-authored-by: Isaac
c79f553 to
847438f
Compare
GetSkillsRef now returns whether the ref was explicitly set via env var. FetchSkillsManifestWithFallback accepts allowFallback to skip the embedded fallback when the user explicitly chose a ref. Co-authored-by: Isaac
|
The new Use
Closest analog: the Same shape as this PR: remote HTTP fetch with a TTL and fallback behavior. See Other call sites worth skimming
Sketch for clicompat const (
compatCacheComponent = "cli-compat"
compatCacheTTL = 1 * time.Hour
)
type manifestFingerprint struct{}
func FetchManifest(ctx context.Context) (Manifest, error) {
c := cache.NewCache(ctx, compatCacheComponent, compatCacheTTL, nil)
m, err := cache.GetOrCompute[Manifest](ctx, c, manifestFingerprint{}, fetchRemoteWithRetry)
if err == nil {
return m, nil
}
return parseEmbeddedManifest()
}That removes One open question: the stale-cache fallback (current tier 3a)
I'd vote (1) for this PR. |
|
@simonfaltum yeah, as discussed, it was done on purpose to fallback to a successfuly fetched manifest (even if it is "outdated") in case of GitHub is down 👍 |
simonfaltum
left a comment
There was a problem hiding this comment.
Did a deep dive on this in person, looks good
5e4c5df to
2f92468
Compare
2f92468 to
d526958
Compare
…E_EMBEDDED_COMPAT The manifest is now purely range-based: each versioned entry defines a range floor that applies to that CLI version and all above it. The "next" key was redundant since we always know the CLI version when updating the manifest. Dev builds now resolve to the highest versioned entry. Also adds DATABRICKS_FORCE_EMBEDDED_COMPAT=true env var to skip remote fetch and use only the embedded manifest, useful for local development. Co-authored-by: Isaac
d526958 to
ea39588
Compare
renaudhartert-db
left a comment
There was a problem hiding this comment.
LGTM on the high-level, deferring final approval to Simon.
## Summary Adds a "Version resolution in Databricks CLI" section to CONTRIBUTING.md explaining that the CLI uses `cli-compat.json` to determine which Agent Skills version to install. Companion PRs: - [databricks/cli#5139](databricks/cli#5139) - [databricks/appkit#333](databricks/appkit#333) Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com>
Summary
Introduces a CLI compatibility manifest (
internal/build/cli-compat.json) that maps CLI versions to compatible AppKit template and Agent Skills versions. This enables template updates to reach users without CLI releases.Manifest format
The manifest is purely range-based — each versioned entry defines a range floor that applies to that CLI version and all versions above it, up to the next entry. The manifest should be sparse: only add a new entry when a compatibility boundary changes (e.g., new AppKit templates require specific CLI features).
Resolution
0.0.0-dev*) → highest versioned entryManifest sources (fallback chain)
Set
DATABRICKS_FORCE_EMBEDDED_COMPAT=trueto skip remote fetch and use only the embedded manifest (useful for local development).Companion PRs
Screenshot