Repository navigation
Fill the bundled skills snapshot in release builds - #8200
Draft
simonfaltum wants to merge 15 commits into
Draft
simonfaltum wants to merge 15 commits into
simonfaltum wants to merge 15 commits into
Conversation
Skill sources need the manifest type and its path checks, and the libs-no-aitools lint rule keeps shared libs from importing the installer. Move Manifest, SkillMeta, NormalizeManifest, CheckManifestPaths, EscapesDir and ErrUnsafeManifestPath down into libs/skills; the installer uses them from there through aliases. Add the Skill and Catalog types, the Source interface, sentinel errors, and NewFSSource over any fs.FS laid out like a skills release. The manifest accepts optional per-skill commands and a top-level catalog_rules file. Co-authored-by: Isaac <no-reply@databricks.com>
The installer and libs/skills both reserve .state.json. Define the name once in libs/skills and have the installer use it. Co-authored-by: Isaac <no-reply@databricks.com>
The Windows CI checkout turns the LF fixtures into CRLF, so the exact content assertions failed. Normalize line endings before comparing. Co-authored-by: Isaac <no-reply@databricks.com>
Clean catalog_rules before reading it, expose min_cli_version on Skill, document the Catalog fields and the release-relative paths the manifest may name. Co-authored-by: Isaac <no-reply@databricks.com>
The skills commands fall back to a snapshot compiled into the binary when the published release cannot be reached and nothing is cached. The repo holds only an empty placeholder manifest; release builds fill the snapshot. NewBundledSource reads the snapshot through the file-system source, labelled as the bundled copy. An empty snapshot reports ErrSourceUnreachable, so development builds behave as if there were no bundled copy. Nothing calls it yet, so behaviour is unchanged. Co-authored-by: Isaac <no-reply@databricks.com>
Release binaries should carry the skills release that is current when they are built, without committing skill files. A new command, internal/build/skillssnapshot, fills libs/skills/snapshot from the latest skills release, or from the tag given with -ref. The GoReleaser before hooks run it before the binaries compile, so every release build fills the snapshot, and development builds do not. The command reads the manifest with the same path checks every source applies (skills.CheckManifest, now shared by the manifest reader), and refuses a file that go:embed would skip. It stages the release beside the snapshot and replaces the snapshot only when every file is in place and the staged release reads back through the file-system source, so a failed download fails the release build and leaves the snapshot as it was. Nothing reads the bundled snapshot yet, so command behaviour is unchanged. Co-authored-by: Isaac <no-reply@databricks.com>
Take main's squashed skills source and fetch code, and keep this branch's own change on top: the release lookup and base URL come from libs/skills, and the manifest checks are one exported CheckManifest that the source and the snapshot command both run. Co-authored-by: Isaac <no-reply@databricks.com>
Bundle files starting with '.' or '_', skip the hook when the fill package is absent or on snapshot builds, authenticate the latest-release lookup with GITHUB_TOKEN, use the shared skills fetch helpers and escape URL path segments. Co-authored-by: Isaac <no-reply@databricks.com>
Collaborator
✅ Integration test reportCommit: 8138a3a
Top 3 slowest tests (at least 2 minutes):
|
Move the skip decision into run so a test proves a skipped run makes no request and leaves the snapshot alone. Rename the old snapshot aside while swapping so a failed rename restores it, and make the staged folder 0755. Fix comments that overstated what is checked and read back. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
go:embed skips a directory that holds a go.mod and names that are not valid module file paths, but the readback uses os.DirFS, so such a release passed and shipped a catalog listing files the binary lacks. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release binaries carry an empty bundled skills snapshot today. This pull request fills it from the latest skills release when GoReleaser builds a release, so a released binary can serve the bundled skills. #8199 has landed, so the binary serves the bundled skills once this pull request fills the snapshot. It replaces #8075, which carries the same work without the fixes below and which the owner closes by hand.
Changes
internal/build/skillssnapshotdownloads the latest skills release (or-ref <tag>), checks the manifest paths, and replaceslibs/skills/snapshotonly after the release lists at least one skill and after every file is in place and the staged manifest and rules read back through the bundled source. A failed swap restores the old snapshot.beforehook in.goreleaser.yamlruns it. Development builds do not, and GoReleaser snapshot builds (main CI) pass-skip, so they keep the empty placeholder and a cleangit statusand need no token.internal/build/skillssnapshot. The release workflow builds older tags with the current.goreleaser.yaml, so rebuilding an older tag skips the fill and ships the empty snapshot as that release did..or_are bundled (the embed usesall:) instead of failing the build.GITHUB_TOKENas a bearer token when set, through a newskills.FetchLatestSkillsReleaseRefWithToken. The CLI itself still calls it without a token.skills.HTTPClient,FetchConcurrency,MaxFetchBodySize,NewHTTPFetchErrorandEscapeFilePath.The bundled release's skill names now appear in the User-Agent
skill/<name>pairs of release binaries. No.nextchangesfragment is added; maintainers, is one wanted for that User-Agent change?Binary size: a build with the snapshot filled (skills release v0.2.56) is 3,559,424 bytes (about 3.4 MiB) larger than one with the placeholder (61,874,439 vs 58,315,015 bytes, linux amd64,
-s -w). The owner accepted this growth.Decisions to review
go:embedwould drop part of it (ago.modin any directory, names that failmodule.CheckFilePath,.git/.hg/.svn/.bzrelements), because the readback reads the folder directly and would otherwise pass while the binary lacks the files..goreleaser.yaml, becausego runof a missing package would otherwise fail the old-tag rebuild.Tests
go test ./internal/build/skillssnapshot/ ./libs/skills/covers bundling and reading back_- and.-prefixed files, a#in a file name, the bearer header with and without a token, a rate-limited lookup leaving the snapshot untouched, a failed download, unsafe manifests, and a release listingexamples/go.modor another pathgo:embeddrops failing with the snapshot untouched, a release without skills leaving the snapshot untouched.-skipleavesgit statusclean, andTestRunSkipMakesNoRequestAndKeepsSnapshotproves a skipped run makes no HTTP request and leaves the snapshot untouched. The skip check for a tree without the package was run in an empty directory. GoReleaser itself was not run here../task fmt-q lint-qandgo test ./acceptance -run 'TestAccept/cmd/skills'pass.This pull request and its description were written by Isaac.