Repository navigation
fix(ui): fetch each repository once when the dashboard updates skills - #931
Conversation
Updating many skills from the Updates tab cloned the repository once per skill and reinstalled every one, so 31 skills from 8 repositories took over a minute where `skillshare update --all` takes 16 seconds, and unchanged skills were reported as updated. The update stream and the update-all endpoint now group the request's skills by repository and branch and go through install.UpdateSkillsFromRepo, as the CLI does. A skill that already matches upstream is left alone and reported as up to date; the Updates tab shows and counts it that way. Results still arrive in request order, which the dashboard relies on. Updating a single skill and switching its branch still reinstall. Those paths now also pass the configured parse options to the installer.
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7234cc5923
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| opts := s.skillUpdateOpts(b.force, b.skipAudit) | ||
| opts.SourceFollow = b.follow | ||
| res, err := install.UpdateSkillsFromRepo(repoURL, branch, targets, opts) |
There was a problem hiding this comment.
Preserve Git checkouts when batching root-skill updates
For a root skill installed as a Git checkout, an upstream change or forced dashboard update now replaces the checkout with a discovery copy. InstallFromDiscovery skips .git and swaps that copy over the existing directory, deleting local branches, stashes, and repository configuration. This is reachable through supported operations: the unchanged single-skill update path can create a full clone through installFromGit. Previously, subsequent updates used handleUpdate to pull the checkout while retaining its Git state. The local-modification guard does not protect this state because file hashes exclude .git. Preserve the existing checkout-update path for these skills in both bulk endpoints.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in f9ebd72. A skill whose directory is a Git checkout no longer joins the shared fetch; it updates on its own by pulling, as before. TestHandleUpdateStream_RootSkillCheckoutKeepsItsRepository covers it.
|
|
||
| opts := s.skillUpdateOpts(b.force, b.skipAudit) | ||
| opts.SourceFollow = b.follow | ||
| res, err := install.UpdateSkillsFromRepo(repoURL, branch, targets, opts) |
There was a problem hiding this comment.
Preserve project declaration identity when rewriting sources
When a project skill actually changes, the grouped updater can rewrite its source from github.com/o/r/skills/demo to https://github.com/o/r.git/skills/demo, while the project declaration retains the original spelling: FollowRepairedSources deliberately ignores sources that already parsed correctly. This breaks the documented moved-copy recovery workflow. After moving the unchanged updated directory into a group, install -p rejects the copy because movedCopyOf calls MatchesDeclaration, which requires exact source equality, and reinstalls the skill at its old location instead; project sync rejects adoption for the same reason. Keep the recorded source identity stable or reconcile equivalent declarations when introducing this rewrite.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in f9ebd72. After a shared fetch, an updated skill keeps the source its record had, the same as updating one skill, so a project declaration still matches. TestHandleUpdateStream_KeepsRecordedSourceSpelling covers it.
Grouping a dashboard update by repository sent every skill through the discovery installer. A root skill kept as a Git checkout was replaced by a plain copy, losing its repository, and an updated skill had its source recorded in the repository's canonical spelling, which a project declaration written with another spelling no longer matches. A checkout now updates on its own by pulling, as before, and an updated skill keeps the source its record had, as updating one skill does.
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Type
proposals/only — see CONTRIBUTING.md)approvedlabel)Linked Issue
No issue; reported by the maintainer.
What
Updating skills from the dashboard cloned a repository once per skill and reinstalled every skill, changed or not.
skillshare update --allfetches each repository once and leaves unchanged skills alone, so the same update took far longer in the dashboard than in the CLI.The dashboard's bulk update (
GET /api/update/streamandPOST /api/updatewithall) now groups skills by repository and branch and callsinstall.UpdateSkillsFromRepoonce per group, as the CLI does. A skill that did not change upstream is reported asup-to-dateand shown as "Up to date" instead of being counted as skipped. Results still arrive one per requested name, in request order.Updating a single skill and switching a branch are unchanged.
A root skill kept as a Git checkout still updates on its own by pulling, and an updated skill keeps the source spelling its record had.
Verification
make checkin the devcontainer image: passed.TestHandleUpdateStream_SameRepoSkillsReportInRequestOrder(fails on the old code)TestHandleUpdate_AllReportsEachSkillOfSharedRepo,TestHandleUpdateStream_RootSkillCheckoutKeepsItsRepositoryandTestHandleUpdateStream_KeepsRecordedSourceSpelling; a UI test for the "up to date" tally.tsc -b --noEmit, i18n andUpdatePagetests passed.Not covered
install -prolls a dashboard update back; a client that disconnects mid-group leaves updated skills unreported.Checklist
make check) — for code changes