Skip to content

fix(ui): fetch each repository once when the dashboard updates skills - #931

Merged
runkids merged 2 commits into
mainfrom
runkids/ui-update-group-by-repo
Nov 16, 2026
Merged

runkids merged 2 commits into
mainfrom
runkids/ui-update-group-by-repo

Conversation

@runkids

@runkids runkids commented Nov 16, 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

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 --all fetches 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/stream and POST /api/update with all) now groups skills by repository and branch and calls install.UpdateSkillsFromRepo once per group, as the CLI does. A skill that did not change upstream is reported as up-to-date and 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 check in the devcontainer image: passed.
  • New tests: TestHandleUpdateStream_SameRepoSkillsReportInRequestOrder (fails on the old code) TestHandleUpdate_AllReportsEachSkillOfSharedRepo, TestHandleUpdateStream_RootSkillCheckoutKeepsItsRepository and TestHandleUpdateStream_KeepsRecordedSourceSpelling; a UI test for the "up to date" tally.
  • UI: tsc -b --noEmit, i18n and UpdatePage tests passed.
  • Timed in a throwaway container with 27 skills from 2 repositories: 37.6s before (22 reinstalled, 5 audit errors on reinstall), 6.7s after (27 up to date).
  • Seen in a browser: after an all-current run every row reads "Up to date" and the card reads "Update finished. 7 up to date".

Not covered

  • No tests for the grouped path in project mode, on a non-default branch, or when a whole repository fails to fetch.
  • Pre-existing and left alone: the stream handler does not record the project lockfile, so in project mode a later install -p rolls a dashboard update back; a client that disconnects mid-group leaves updated skills unreported.

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

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

chatgpt-codex-connector Bot commented Nov 16, 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-16T18:42:33.312861Z f9ebd72 Manual request
ℹ️ 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.

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

💡 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

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.
@runkids

runkids commented Nov 16, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

An unknown error occurred
ℹ️ 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".

@runkids

runkids commented Nov 16, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: f9ebd72477

ℹ️ 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".

@runkids
runkids merged commit 310478c into main Nov 16, 2026
9 checks passed
@runkids
runkids deleted the runkids/ui-update-group-by-repo branch November 18, 2026 02:02
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.

1 participant