Skip to content

skills: report the release tag as the release source's catalog version - #8191

Open
simonfaltum wants to merge 6 commits into
mainfrom
skills/relver-the-release-skills-source-reports-the-re
Open

simonfaltum wants to merge 6 commits into
mainfrom
skills/relver-the-release-skills-source-reports-the-re

Conversation

@simonfaltum

@simonfaltum simonfaltum commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

Changes

The release skills source now sets Catalog.Version to the release tag it resolved, without the leading v, instead of the manifest's version field. A local folder source (DATABRICKS_SKILLS_DIR) keeps the manifest value. The Catalog.Version doc now covers the release, a local folder, and a pinned branch or commit ref.

Why

The manifest's version field is the manifest schema version ("2" in every release), not the release. Any cache keyed by Catalog.Version would give two different releases one entry. This lands the release-source half of the fix asked for in the blocking thread on libs/skills/chain.go line 82 of #8115: #8115 (comment). The other parts of that thread, recording the tag in the bundled snapshot and a chain-level test with two releases that share a manifest version, follow in a later change. It lands on main on its own, so #8076 and #8115 do not change.

The feature stays behind DATABRICKS_SKILLS_PREVIEW: the skills commands are hidden without it, so default CLI behaviour and existing goldens are unchanged. The guard test is the existing acceptance case acceptance/cmd/skills/disabled: it runs skills list with DATABRICKS_SKILLS_PREVIEW unset and expects unknown command "skills", and checks the root help does not list skills. Nothing outside the gated command group reaches the changed code, so no further guard test is needed. No changelog entry is added, because the feature is preview-gated.

Tests

  • Two releases whose manifests both say "version": "2" report different catalog versions, equal to their tags.
  • A pinned ref with and without a leading v reports the version without it. A ref that is not a semantic version, such as vendor-fix, is reported as given.
  • The release catalog test serves the shared fixture (manifest version 1.2.0) under tag v3.4.5 and expects 3.4.5, so it fails if the manifest version is used.
  • The existing local folder test still reports the manifest value.
  • go test ./libs/skills/..., go test ./acceptance -run 'TestAccept/cmd/skills', ./task fmt-q lint-q.

This pull request and its description were written by Isaac.

The manifest's version field is the manifest schema version, the same in
every release. The release source now sets Catalog.Version to the resolved
release tag without its leading v. A local folder keeps the manifest value.

Co-authored-by: Isaac <no-reply@databricks.com>
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: bfd4c24

Run: 46428075348

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 90 6 2:37
💚​ aws-windows-latest-4core-16gb 1 90 6 3:11
💚​ azure linux-2core-8gb 1 90 6 1:57
💚​ azure-windows-latest-4core-16gb 1 90 6 2:47
💚​ gcp linux-2core-8gb 1 90 6 2:37
💚​ gcp-windows-latest-4core-16gb 1 90 6 3:09
Test Name aws linux-2core-8gb aws-windows-latest-4core-16gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:10 aws-windows-latest-4core-16gb TestAccept
3:07 gcp-windows-latest-4core-16gb TestAccept
2:46 azure-windows-latest-4core-16gb TestAccept

simonfaltum and others added 2 commits November 30, 2026 09:52
…on for all sources

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
@simonfaltum
simonfaltum marked this pull request as ready for review November 30, 2026 11:12
@simonfaltum
simonfaltum requested a review from a team as a code owner November 30, 2026 11:12
@simonfaltum
simonfaltum requested review from denik and rclarey November 30, 2026 11:13

@review-oss-bot review-oss-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review at c519cfe. Each finding was verified against the code.

No blocking issues found. 4 non-blocking comment(s) below.

This PR makes the release skills source report the resolved release tag, without its leading "v", as Catalog.Version, so the value stops coming from the manifest's schema version field. The core change is small and correct for full semver tags. The issues below are about how refs get mapped to versions: shorthand semver refs like v2 lose their v even though the docs say branches are reported as given, and this mapping now disagrees with installer.DisplaySkillsVersion. There are also two smaller points: the doc comment names a bundled copy that doesn't exist yet, and the new test helper duplicates one that's already there.

Comment thread libs/skills/release_source.go Outdated
// releaseVersion strips the leading "v" from a semantic version tag. Any other
// ref, such as a branch named vendor-fix, is returned as given.
func releaseVersion(ref string) string {
if semver.IsValid(ref) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nice to have] semver.IsValid also accepts the shorthand forms v2 and v1.2, so DATABRICKS_SKILLS_REF=v2 (a branch) is reported as 2. That contradicts this function's comment and the Catalog.Version doc in skills.go, which say a branch is reported as given. Should the check require a full vMAJOR.MINOR.PATCH (for example semver.Canonical(ref) == ref, adjusted if prerelease or build metadata matters)? If not, the docs should say that short semver-looking refs lose their v too.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 59e43af: releaseVersion now strips the v only when semver.Canonical(ref) == ref, so v2 and v1.2 are reported as given. A test case for v2 covers it. A tag with build metadata is also kept as given, which is fine for release tags.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correction to my earlier reply: a tag with build metadata is not kept as given. Since ad95dc5 the build part is ignored for the check, so v1.2.3+build.1 is reported with the v stripped (1.2.3+build.1). bfd4c24 also requires the full ref to be valid semver, so v1.2.3+ is kept as given.


// releaseVersion strips the leading "v" from a semantic version tag. Any other
// ref, such as a branch named vendor-fix, is returned as given.
func releaseVersion(ref string) string {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nice to have] installer.DisplaySkillsVersion in libs/aitools/installer/installer.go already turns a skills ref into a display version, but it strips the v from every ref, so the two now disagree. With DATABRICKS_SKILLS_REF=vendor-fix, this catalog reports vendor-fix while aitools install shows endor-fix. installer already imports libs/skills, so could this become the exported helper, with DisplaySkillsVersion calling it? If they're meant to differ, the doc comment should say how.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, they disagree for non-tag refs. I left DisplaySkillsVersion alone: it feeds aitools install state, update and downgrade checks, which are not behind the skills preview gate, so changing it would alter existing behaviour in a PR meant to be gated. The releaseVersion comment now says the two differ on purpose. Making DisplaySkillsVersion call this helper (which also fixes vendor-fix showing as endor-fix) is better done as its own change with its own tests.

Comment thread libs/skills/skills.go Outdated
// Version is the release version: the release tag without its leading "v"
// for the published release (a pinned DATABRICKS_SKILLS_REF that is a
// branch or commit is reported as given). A local
// folder and the bundled copy have no release tag here and report the

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] The doc says what "the bundled copy" reports, but this tree has no bundled source: Resolve in resolve.go only knows DATABRICKS_SKILLS_DIR, and fsSource.Catalog is the only other place that sets Version. Can you drop the bundled copy here and add it back with the change that adds that source?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 59e43af: the Catalog.Version doc no longer mentions a bundled copy. It will be added back with the change that adds that source.

}
}

// serveReleases serves one tree per release tag under the base URL.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] serveReleases repeats the StripPrefix + FileServer setup that serveRelease/serveReleaseFS (lines 22-34) already do for a single tag. Could serveReleaseFS take the tag instead, or could those two helpers be built on serveReleases, so there's one way to serve a test release?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 59e43af: serveReleaseFS now calls serveReleases with the single tag v1.2.0 and sets the ref, so the StripPrefix + FileServer setup lives in one place. serveRelease stays for the tests that need a custom handler.

simonfaltum and others added 2 commits November 30, 2026 11:24
… helpers

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>

@rugpanov rugpanov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve. I found no blocking problems. There is 1 nice-to-have finding and there are 3 nits, as inline comments.

Risk: LOW. The change touches only the release source in libs/skills. No command reaches it at this head: Resolve returns only the DATABRICKS_SKILLS_DIR folder source, and the skills command group is hidden behind DATABRICKS_SKILLS_PREVIEW. It is a small change in three files, with unit tests, and a revert rolls it back.

Notes on the stack (no change needed in this PR):

  • #8076 also rewrites the // Version is the release version. line in libs/skills/skills.go. The second PR to merge gets a text conflict. The #8076 text says that a release source "sets it to the release tag". After this PR, the value is the tag without its leading "v".
  • In #8115, readBundled compares bundled.Version with cat.Version. After this PR, the live and cached catalogs report the release tag, but the bundled copy still reports the manifest's version field. Then the check always fails, and the bundled fallback never serves a file. This fails closed, so it is safe. The bundled snapshot must record its release tag before #8115 depends on that fallback.

CI: 17 of 27 check runs pass and 10 are skipped. No check fails or is pending.

Comment thread libs/skills/skills.go
Skills []Skill

// Version is the release version.
// Version is the release version: the release tag without its leading "v"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nice to have] This doc names two cases: the published release and a local folder. The bundled copy is a third case. NewBundledSource in libs/skills/bundled_source.go builds its catalog with NewFSSource, so it also reports the manifest's version field. A reader can think that every source except a local folder reports a release tag. Add the bundled copy to the manifest-version case. For example: "A local folder and the bundled copy report the manifest's version field."

Note: the earlier bot comment said that this tree has no bundled source. That is not correct. libs/skills/bundled_source.go is on main since #8077, and this file still names the bundled copy in the package doc and in the FetchedAt and Stale docs.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in bfd4c24: the Catalog.Version doc now says a local folder and the bundled copy report the manifest's version field.

// vendor-fix would become endor-fix.
func releaseVersion(ref string) string {
// semver.Canonical drops build metadata, so compare without it.
base, _, _ := strings.Cut(ref, "+")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] releaseVersion removes the build part before the check, but it does not check that the full ref is valid. For v1.2.3+ (an empty build part, which is not valid semver), it returns 1.2.3+. The doc above says that only a full tag loses its "v". Only a mistyped DATABRICKS_SKILLS_REF gives this input, so the risk is low. Add semver.IsValid(ref) && to the condition.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in bfd4c24: the condition now starts with semver.IsValid(ref), so v1.2.3+ is returned as given. Added it as a test case.

Comment thread libs/skills/release_source_test.go Outdated
}

func TestReleaseSourceVersionIsReleaseTagNotManifestVersion(t *testing.T) {
manifest := func(skillVersion string) fs.FS {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] manifest is an inline closure that only names a repeated operation. It captures nothing. .agents/rules/style-guide-go.md says: "Do not declare inline function closures just to name a repeated operation. Extract a regular named function instead." Move it to a named test helper, for example func releaseWithSkillVersion(v string) fs.FS.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in bfd4c24: the closure is now the named helper releaseWithSkillVersion.

Comment thread libs/skills/release_source_test.go Outdated
}
serveReleases(t, map[string]fs.FS{"v1.2.0": release, "v1.2.3+build.1": release, "1.2.0": release, "vendor-fix": release, "v2": release})

for ref, want := range map[string]string{"v1.2.0": "1.2.0", "v1.2.3+build.1": "1.2.3+build.1", "1.2.0": "1.2.0", "vendor-fix": "vendor-fix", "v2": "v2"} {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] This loop goes over a map without t.Run. If require.NoError fails for one ref, the test stops, and the cases after it do not run. The map order is random, so the skipped cases change from run to run. Use t.Run(ref, ...), as the other table tests in this file do. Also add a pre-release case, for example v1.2.3-rc.1 gives 1.2.3-rc.1.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in bfd4c24: the cases run under t.Run per ref, and I added v1.2.3-rc.1 -> 1.2.3-rc.1 (plus v1.2.3+ as given).

…sion test

Co-authored-by: Isaac <no-reply@databricks.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants