Skip to content

Commit 1b3c69e

Browse files
aitools: warn when --experimental is set but manifest has none
The default DATABRICKS_SKILLS_REF pin is a release tag that pre-dates the experimental_skills manifest section (see databricks/databricks-agent-skills#73). Users who pass --experimental against that ref today silently get no experimental skills installed. Log a Warnf at install time pointing them at the env var override (=main, or a future release that includes the section). Helper: manifestHasExperimental(), unit-tested in source_test.go. Co-authored-by: Isaac
1 parent 60f5f7d commit 1b3c69e

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

experimental/aitools/lib/installer/installer.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@ const (
3030
experimentalSuffix = "-experimental"
3131
)
3232

33+
// manifestHasExperimental reports whether the flattened manifest contains
34+
// at least one entry marked Experimental=true.
35+
func manifestHasExperimental(m *Manifest) bool {
36+
for _, meta := range m.Skills {
37+
if meta.Experimental {
38+
return true
39+
}
40+
}
41+
return false
42+
}
43+
3344
// alternateVariantKey returns the manifest key of the same logical skill
3445
// under the opposite experimental status. For "databricks-jobs" it returns
3546
// "databricks-jobs-experimental"; for "databricks-jobs-experimental" it
@@ -135,6 +146,12 @@ func InstallSkillsForAgents(ctx context.Context, src ManifestSource, targetAgent
135146
return err
136147
}
137148

149+
// Helpful nudge for users testing --experimental against a ref that
150+
// pre-dates the experimental_skills manifest section.
151+
if opts.IncludeExperimental && !manifestHasExperimental(manifest) {
152+
log.Warnf(ctx, "--experimental was set but the manifest at %s exposes no experimental skills. Set DATABRICKS_SKILLS_REF to a release that includes them (or =main for the latest).", ref)
153+
}
154+
138155
scope := opts.Scope
139156
if scope == "" {
140157
scope = ScopeGlobal

experimental/aitools/lib/installer/source_test.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,25 @@ func TestFlattenManifestCollidingNamesCoexist(t *testing.T) {
6060
assert.Equal(t, "databricks-jobs", exp.SourceName, "SourceName is the un-suffixed name for the fetch URL")
6161
}
6262

63+
func TestManifestHasExperimental(t *testing.T) {
64+
stableOnly := &Manifest{Skills: map[string]SkillMeta{
65+
"databricks-apps": {Version: "0.1.0"},
66+
}}
67+
flattenManifest(stableOnly)
68+
assert.False(t, manifestHasExperimental(stableOnly))
69+
70+
withExperimental := &Manifest{
71+
Skills: map[string]SkillMeta{
72+
"databricks-apps": {Version: "0.1.0"},
73+
},
74+
ExperimentalSkills: map[string]SkillMeta{
75+
"databricks-iceberg": {Version: "0.0.1"},
76+
},
77+
}
78+
flattenManifest(withExperimental)
79+
assert.True(t, manifestHasExperimental(withExperimental))
80+
}
81+
6382
func TestAlternateVariantKey(t *testing.T) {
6483
assert.Equal(t, "databricks-jobs-experimental", alternateVariantKey("databricks-jobs"))
6584
assert.Equal(t, "databricks-jobs", alternateVariantKey("databricks-jobs-experimental"))

0 commit comments

Comments
 (0)