Repository navigation
aitools: track the latest skills release safely for every released CLI - #8202
simonfaltum wants to merge 7 commits into
Conversation
The compatibility manifest can now set "use_latest": true next to a concrete skills pin. CLIs that know the field install the latest skills release; CLIs that predate it ignore the field and install the pin, so the published manifest never has to carry the "latest" sentinel that CLIs before 1.6.0 reject. The latest release is read from the version file the skills release workflow writes to the repo's main branch, on the host that already serves the skill files, instead of the rate-limited GitHub REST API that failed aitools list with HTTP 403 in October. When the lookup fails, commands fall back to the newest of the manifest pin, the release known at build time and the installed release, and warn instead of failing. The release-build workflow injects the release that is latest at build time as the compiled fallback. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Regression test report ✅Commit: Selected 4 changed tests (limit=20, 0 not selected) 4 tests: regression=4 unreleased=0 coverage=0 failing=0
TestAccept/cmd/aitools/auto-install/upgrade: branch ✅ | main (bfcdd1f) ❌ | latest (v1.28.0) ❌main (bfcdd1f): latest (v1.28.0): TestAccept/cmd/aitools/list/latest: branch ✅ | main (bfcdd1f) ❌ | latest (v1.28.0) ❌main (bfcdd1f): latest (v1.28.0): TestAccept/cmd/aitools/list/latest-lookup-fails: branch ✅ | main (bfcdd1f) ❌ | latest (v1.28.0) ❌main (bfcdd1f): latest (v1.28.0): TestAccept/cmd/aitools/list/update-check-lookup-fails: branch ✅ | main (bfcdd1f) ❌ | latest (v1.28.0) ❌main (bfcdd1f): latest (v1.28.0): |
The embedded manifest's pin is the checked-in fallback, so the separate constant that would have rotted is gone; the release injected at build time only moves the fallback forward, and the build verifies the release's tag exists before injecting it. NewestRelease returns one canonical form, and list reuses the installer's warning. Co-authored-by: Isaac <no-reply@databricks.com>
|
An independent review pass turned up a few things, addressed in the latest commit:
Two findings left as they are, for the record:
A pre-existing double resolution (the install command and the installer both resolve the release) is unchanged here; threading one |
Every CLI version on a machine shares the cache, and re-encoding it dropped the fields this CLI does not know, so an older CLI's refresh turned use_latest off for a newer one until the next refresh. Keep the bytes. Co-authored-by: Isaac <no-reply@databricks.com>
✅ Integration test reportCommit: 6574bc3
Top 3 slowest tests (at least 2 minutes):
|
rugpanov
left a comment
There was a problem hiding this comment.
Two blocking points stay open at 74c37d6. Both show only after the remote manifest sets use_latest, but the code that causes them ships in the binaries of this PR, so a manifest change cannot fix them later.
- An older CLI that shares the cache can make a newer CLI downgrade the installed skills (
libs/skills/ref.go:104). - The version file on skills
maincan name a release that has no tag. Today it says0.2.57, but tagv0.2.57does not exist andreleases/latestisv0.2.56(libs/skills/ref.go:107).
[Question] The PR adds about 600 lines that have no effect until a follow-up change to the remote manifest, and it mixes several changes: a new lookup source, the use_latest field, non-failing fallbacks, build-time injection and a fallback bump. Is a separate, smaller PR possible for the build-time injection and the lookup source? A one-line bump of the 1.23.0 pin in internal/build/cli-compat.json already reaches all CLIs from 1.23.0 within an hour. The answer helps to review each risk on its own.
Risk: HIGH. The change ships in every released CLI binary and changes how databricks aitools install, update, list and auto-install pick the skills release on user machines. It also adds a release-build step that reads a file from another repo. Users see no change until a remote manifest sets use_latest, but that switch reaches all CLIs 1.29+ within an hour, with no binary rollback.
CI: no failing check at 74c37d6. Integration Tests and some task test jobs were still in progress when this review was written.
A compatibility pin older than the installed release now keeps the installed one: CLIs up to 1.28.0 drop use_latest when they rewrite the shared cache, and following that pin downgraded the skills. A release that the version file names but whose manifest is not served yet counts as a failed lookup, so the fallback, which includes the installed release, runs. A failed lookup keeps a plugin record's version instead of clearing it. The build-time injection of the fallback release moves to its own PR. Co-authored-by: Isaac <no-reply@databricks.com>
|
Thanks @rugpanov. Both blocking points are fixed in dbe4efb, and every inline thread has a reply. On the split: the build-time injection is now #8218 (release-build workflow and goreleaser only, safe in any merge order since the linker ignores On the one-line pin bump: it does reach every CLI from 1.23.0 within an hour, and we can do it in the meantime. The goal of this PR is to stop needing that PR on every skills release. |
Co-authored-by: Isaac <no-reply@databricks.com>
Why
databricks aitools installships skills that are weeks old. The newest range incli-compat.jsonis pinned to 0.2.47 while the skills repository is at 0.2.57, and every bump needs a human PR. The pin exists because tracking "latest" was tried in October (#7069) and reverted three days later (#7159): the lookup of the latest release went through the GitHub REST API, whose unauthenticated requests are limited to 60 per hour per IP, andaitools listfailed with HTTP 403 on the VS Code extension's shared CI runners (databricks/databricks-vscode#2269). CLIs before 1.6.0 also reject the whole manifest when any entry uses the"latest"sentinel.This change makes tracking the latest release safe for every released CLI, so the pin can go.
Changes
Before, the manifest's
skillsfield was either an exact pin or"latest"."latest"made the CLI callapi.github.com/repos/databricks/databricks-agent-skills/releases/latest, and a failed call failedaitools list, plugin installs and fresh installs. Now the manifest keeps a concreteskillspin and can set"use_latest": truenext to it. CLIs that know the field install the latest release; CLIs that predate it ignore the field and install the pin, exactly as today. No released CLI changes behavior when the field appears.libs/clicompat:Entry.UseLatestandResolveAgentSkills, which returns the pin and whether the range tracks latest. The"latest"sentinel is still parsed, for manifests cached before the field existed.NewestReleasepicks the newest of several releases.libs/skills:ResolveReleasereplacesGetSkillsRefandResolveSkillsRef. It returns aReleasewith the ref, whether it is pinned, and the lookup error when the latest release could not be resolved. The lookup readsmetaplugin/version.meta.jsonfrom the skills repo's main branch on raw.githubusercontent.com, the host that already serves every skill file; the skills release workflow writes that file with the release it just tagged. In the October CI failure, this host answered while the API returned 403.use_latestwhen they rewrite the shared cache.install,update,listand--dump-pathwarn and continue;versionprints no update line;update --checkreports that nothing could be checked, as it already does when the manifest fetch fails; plugin installs and updates still run, and a plugin record keeps the version it holds. Installations the CLI cannot compare with a release (legacy, or from a branch) keep failing on the lookup rather than get overwritten.internal/build: theAgentSkillsFallbackVersionconstant becomes a variable that release builds can set with-ldflags -X, or empty. The embedded manifest's pin is the checked-in fallback; an injected release only moves it forward. The release-build step that injects it is in release-build: inject the latest skills release as the build-time fallback #8218.list/latest-lookup-failsnow shows the fallback instead of the error.internal/build/README.mdand thebump-cli-compatskill.The manifest itself is unchanged here. A follow-up PR adds
"use_latest": trueto the 1.23.0 range. Removing the field again turns the tracking off remotely within the cache hour.Test plan
go test ./internal/build/ ./libs/clicompat/ ./libs/skills/ ./libs/aitools/installer/ ./cmd/aitools/./task aitools-full: lint, unit tests, the aitools, apps, help and version acceptance tests, deadcode./task checks,./task lint-q,./task fmt-qcmd/aitools/list/latest,list/latest-lookup-failsandauto-install/upgraderegenerated with-update; apart from the fallback case, only stubbed paths and env names changedLatest skills release: x.y.z, anddatabricks aitools list --debugon the next release resolves the version fileThis pull request and its description were written by Isaac.