Skip to content

fix(update): repair skill sources recorded before the per-skill source fix - #866

Merged
runkids merged 1 commit into
mainfrom
runkids/fix-update-old-source-records
Nov 11, 2026
Merged

runkids merged 1 commit into
mainfrom
runkids/fix-update-old-source-records

Conversation

@runkids

@runkids runkids commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Type

  • Bug fix
  • Small improvement (docs, typo, minor refactor)
  • Feature proposal (proposals/ only — see CONTRIBUTING.md)
  • Approved feature or large change (the linked issue has the approved label)

Linked Issue

Closes #862

What and why

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. #863 changed what new installs record, but a skill installed earlier keeps the old string, and every path that parsed it failed with failed to clone repository.

The record still holds repo_url and subdir. install.RecordedSource rebuilds 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 whose repo_url names another repository).

Consumer of the recorded source Before Now
update <skill>, and update --all when the repository has one installed skill failed to clone updates, and the record is rewritten in the form that parses
install <name> --update failed to clone same
Dashboard update and branch switch of one skill failed to clone same
Local-changes diff (check --diff, dashboard) could not fetch the installed version fetches it
hub draft, hub index published the old string publish the source that installs the skill
Batch update (two or more skills of one repository) already worked from repo_url unchanged

In 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:

  • only an entry whose source equals the record's source from before the update, and only when that source needed repair;
  • an entry a teammate changed stays as it is;
  • a record a batch update only respelled (org/skills/x to 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 --prune saves 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: RecordedSource over old-form file://, 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 -p on an old-form record updates the skill and rewrites the config entry; update --all --prune -p with an old-form record keeps the pruned skill out of the config. Both failed before their fix.
  • make check passes.
  • Manual matrix in the devcontainer image, old-form file:// records: project update x and update --all with one skill, batch update with two skills, a teammate-edited config, a new-form record (config byte-identical afterwards), global update x and update --all, and install -p on 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 shares RecordedSource and FollowRepairedSources with the CLI; no server test was added).

Not covered

  • A machine without the install record cannot repair an old-form entry in config.yaml: on GitLab and Bitbucket the string alone can also name a nested repository. install -p there keeps failing until a machine that has the record runs update and commits the config.
  • list, the dashboard and the uninstall hint still display the old string until an update rewrites the record.
  • A record that exists only in a legacy per-skill metadata file is repaired by the update, but its config entry is not followed on that first run.

Checklist

  • I've read CONTRIBUTING.md, including its AI-assisted contributions section
  • I've reviewed every line of the diff and can explain it
  • Tests included and passing (make check) — for code changes
  • No unrelated changes in the diff
  • Scope is focused — one concern per PR

…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
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T15:30:07.794644Z 67e2221 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@runkids
runkids merged commit 9f43310 into main Nov 11, 2026
9 checks passed
@runkids
runkids deleted the runkids/fix-update-old-source-records branch November 11, 2026 15:35
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.

update fails for skills recorded with a per-skill source the parser cannot split (records from before #859)

1 participant