Repository navigation
fix(update): repair skill sources recorded before the per-skill source fix - #866
Merged
Merged
Conversation
…e fix Before #863, `install <repo> -s <skill>` recorded "<repo>/<path>" as the skill's source. GitLab, Bitbucket and file:// sources parse that string as another repository, so every path that parsed the recorded source failed for those skills: `update` of a single skill, `install <name> --update`, the dashboard update, and the local-changes diff. #863 only changed what new installs record. The record still holds the repository and the path, so RecordedSource rebuilds the source from them when the written string parses as a different repository, and the reinstall writes the record back in the form that parses. In project mode the config entry that declared the old string follows the rewritten record, because teammates install from the config. An entry a teammate changed stays as it is, and so does a record a batch update only respelled. The config is reloaded first: `update --prune` saves it through another copy, and saving the stale one brought pruned skills back. `hub draft` and `hub index` published the old string as it was written; they now publish the source that installs the skill. Closes #862
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Type
proposals/only — see CONTRIBUTING.md)approvedlabel)Linked Issue
Closes #862
What and why
Before #863,
install <repo> -s <skill>recorded<repo>/<path>as the skill's source. GitLab, Bitbucket andfile://sources parse that string as another repository. #863 changed what new installs record, but a skill installed earlier keeps the old string, and every path that parsed it failed withfailed to clone repository.The record still holds
repo_urlandsubdir.install.RecordedSourcerebuilds the source from them when the written string parses as a different repository, and leaves every other record as written (a repository of its own at that URL, web URLs with a ref, local paths, records whoserepo_urlnames another repository).update <skill>, andupdate --allwhen the repository has one installed skillinstall <name> --updatecheck --diff, dashboard)hub draft,hub indexrepo_urlIn project mode, teammates install from
.skillshare/config.yaml, so after an update (CLI and dashboard) the config entry that declared the old string follows the rewritten record (config.FollowRepairedSources). It is narrow on purpose:org/skills/xto the clone URL form) does not touch the config.The lockfile pins by the config's source, so it is written after the config follows and the pin is taken again.
One bug found in review and fixed here:
update --prunesaves the config through its own copy, so saving the copy loaded at the start of the command brought pruned skills back. The follow step reloads the config first.Tests
internal/install:RecordedSourceover old-formfile://, GitLab and Bitbucket records, a repository of its own at the same URL, a source that already parses, and a record that names another repository.internal/config: the config follows a repaired record; a teammate's change and a respelled record are kept.internal/hub: draft and index publish the repaired source, without a redundant skill selector.tests/integration:update x -pon an old-form record updates the skill and rewrites the config entry;update --all --prune -pwith an old-form record keeps the pruned skill out of the config. Both failed before their fix.make checkpasses.file://records: projectupdate xandupdate --allwith one skill, batch update with two skills, a teammate-edited config, a new-form record (config byte-identical afterwards), globalupdate xandupdate --all, andinstall -pon a fresh clone after the repair.Not run: GitLab and Bitbucket against a real repository (parser-level tests only), UI tests and website build beyond
make check, and the dashboard update path by hand (it sharesRecordedSourceandFollowRepairedSourceswith the CLI; no server test was added).Not covered
config.yaml: on GitLab and Bitbucket the string alone can also name a nested repository.install -pthere keeps failing until a machine that has the record runsupdateand commits the config.list, the dashboard and the uninstall hint still display the old string until an update rewrites the record.Checklist
make check) — for code changes