Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .nextchanges/cli/aitools-skills-rate-limit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Fix GitHub API rate limit errors in `aitools list` and plugin installs by pinning skills to `0.2.32`. ([#7159](https://github.com/databricks/cli/pull/7159))
2 changes: 1 addition & 1 deletion internal/build/cli-compat.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"1.22.0": { "appkit": "0.84.0", "skills": "latest" },
"1.22.0": { "appkit": "0.84.0", "skills": "0.2.32" },
"1.20.0": { "appkit": "0.84.0", "skills": "0.2.30" },
"1.0.0": { "appkit": "0.76.1", "skills": "0.2.10" },
"0.299.2": { "appkit": "0.24.0", "skills": "0.1.5" }
Expand Down
20 changes: 11 additions & 9 deletions libs/aitools/installer/installer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,11 +456,11 @@ func setupSkillsFallback(t *testing.T, latestErr error) (ManifestSource, string)
t.Setenv("DATABRICKS_SKILLS_REF", "")
t.Setenv("DATABRICKS_FORCE_EMBEDDED_COMPAT", "false")
t.Setenv("DATABRICKS_CACHE_ENABLED", "true")
cacheDir := t.TempDir()
t.Setenv("DATABRICKS_CACHE_DIR", cacheDir)
require.NoError(t, os.WriteFile(filepath.Join(cacheDir, "compat-manifest.json"), build.CLICompatManifestJSON, 0o600))
withCachedCompat(t, skillsLatestSentinel)
stubLatestSkillsReleaseRef(t, "v9.9.9", latestErr)
fallbackRef := "v" + build.AgentSkillsFallbackVersion
fallbackVersion, err := clicompat.ResolveEmbeddedAgentSkillsVersion()
require.NoError(t, err)
fallbackRef := "v" + fallbackVersion
body, err := json.Marshal(testManifest())
require.NoError(t, err)
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
Expand Down Expand Up @@ -1343,9 +1343,9 @@ func TestGetSkillsRefDefaultManifest(t *testing.T) {
{version: "1.20.0"},
{version: "1.21.0"},
{version: "1.21.9"},
{version: "1.22.0", latest: true},
{version: "1.23.0", latest: true},
{version: "0.0.0-dev+test", latest: true},
{version: "1.22.0"},
{version: "1.23.0"},
{version: "0.0.0-dev+test"},
}
for _, tc := range tests {
entry, err := clicompat.Resolve(m, tc.version)
Expand All @@ -1362,7 +1362,7 @@ func TestGetSkillsRefDefaultManifest(t *testing.T) {
wantRef := pinnedRef
var latestErr error
if offline {
latestErr = errors.New("network down")
latestErr = errors.New("HTTP 403 fetching latest skills release")
}
switch {
case tc.latest && offline:
Expand Down Expand Up @@ -1401,7 +1401,9 @@ func TestGetSkillsRefLatestReleaseLookupFails(t *testing.T) {
func TestFetchSkillsManifestWithFallback(t *testing.T) {
const missingRef = "v9.9.9"
setBuildVersion(t, "1.22.0")
fallbackRef := "v" + build.AgentSkillsFallbackVersion
fallbackVersion, err := clicompat.ResolveEmbeddedAgentSkillsVersion()
require.NoError(t, err)
fallbackRef := "v" + fallbackVersion

tests := []struct {
name string
Expand Down
10 changes: 6 additions & 4 deletions libs/clicompat/clicompat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import (
"golang.org/x/mod/semver"
)

const pinnedAgentSkillsVersion = "0.2.32"

// roundTripFunc adapts a function into an http.RoundTripper.
type roundTripFunc func(*http.Request) (*http.Response, error)

Expand Down Expand Up @@ -337,8 +339,8 @@ func TestResolveEmbeddedAgentSkillsVersion(t *testing.T) {
want string
}{
{version: "1.0.0", want: "0.2.10"},
{version: "1.22.0", want: build.AgentSkillsFallbackVersion},
{version: "0.0.0-dev+test", want: build.AgentSkillsFallbackVersion},
{version: "1.22.0", want: pinnedAgentSkillsVersion},
{version: "0.0.0-dev+test", want: pinnedAgentSkillsVersion},
} {
t.Run(tc.version, func(t *testing.T) {
original := build.GetInfo().Version
Expand Down Expand Up @@ -373,8 +375,8 @@ func TestEmbeddedManifest_IsWellFormed(t *testing.T) {

// Pinning the newest range (e.g. after a breaking skills release) must
// update this assertion in the same change.
assert.Equal(t, AgentSkillsLatest, m[keys[len(keys)-1]].AgentSkills,
"the newest CLI range must track the latest skills release")
assert.Equal(t, pinnedAgentSkillsVersion, m[keys[len(keys)-1]].AgentSkills,
"the newest CLI range must stay pinned until all callers support latest-release fallback")
assert.True(t, semver.IsValid("v"+build.AgentSkillsFallbackVersion),
"compiled skills fallback must be a concrete version")

Expand Down
Loading