Repository navigation
fix(install): record a per-skill source every host can install again - #863
Conversation
`install <repo> -s <skill>` joined the repository and the skill path with a single "/". GitLab and Bitbucket URLs have no fixed depth, so the parser read the result as a longer repository path, and file:// URLs only split on "//". The recorded string is what a project's config.yaml shares, so `install -p` on a fresh clone tried to clone a repository that does not exist. Whole-repo file:// sources now join with "//", and GitLab or Bitbucket sources typed without ".git" or a web URL marker join with ".git/". The other hosts keep their form. `install --update` still recognises a record in the old form, but only when its recorded repository and path agree, because on these hosts the same string can also name a repository of its own. The dashboard's install dialog matched installed skills by rebuilding the old form, so it now accepts each form the server writes. Closes #859
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: 7e661692aa
ℹ️ 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".
| // GitLab and Bitbucket paths have no fixed depth: without ".git" or a web | ||
| // URL marker the parser takes every segment as the repository. | ||
| case source.webHost != "" && !strings.HasSuffix(repo, ".git") && !hasWebURLMarker(source.webHost, repo): | ||
| return repo + ".git/" + skillPath |
There was a problem hiding this comment.
Update hub-result matching for the new recorded source format
For a supported Hub entry with source https://gitlab.com/team/skills and skill selector pdf, installing now records https://gitlab.com/team/skills.git/pdf, but InstallDialog.tsx's isInstalledResult still requires an exact source match or a ${source}/ prefix. Neither matches the new format. Consequently, both the search row and preview continue offering Install after installation, and clicking it again attempts a duplicate installation and produces an already-exists warning. Update this consumer alongside the discovery-selection matcher so GitLab and Bitbucket Hub results recognize the new recorded sources.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in b52e12a. The scenario holds: isInstalledResult accepted only an exact source or a <source>/ prefix, so a GitLab or Bitbucket hub entry with a skill selector kept showing Install after the skill was recorded as <source>.git/<skill>.
The matcher now also accepts the .git/ join (the / prefix already covers the // join used for SSH and file://). This is the same class as the discovery-list matcher changed in the first commit; I checked the rest of the dashboard and the Go code and found no other place that matches a recorded source by prefix.
Covered by a new test in ui/src/components/InstallDialog.test.tsx ("shows a hub entry as installed when its skill is recorded under the source the server writes for its host"), which failed before the change.
A hub entry that names a repository and a skill was matched against the installed skills by an exact source or a "<source>/" prefix. A GitLab or Bitbucket repository typed without ".git" is now recorded as "<source>.git/<skill>", so the search row and the preview kept offering Install, and a second install hit the already-exists warning. The matcher now accepts the ".git/" join as well. This is the same class as the discovery list fixed in the previous commit: both rebuild the recorded source in the dashboard. No other dashboard or Go code matches a recorded source by prefix.
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? 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". |
…e fix (#866) 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
Type
proposals/only — see CONTRIBUTING.md)approvedlabel)Linked Issue
Closes #859
What and why
install <repo> -s <skill>records one source string per skill. Project mode shares that string through.skillshare/config.yaml, andinstall -pon another machine parses it again. The string was built by joining the repository and the skill path with a single/, which the parser cannot split on every host:.gitthe parser takes every segment as the repository.file://URLs split only on//.Bitbucket was not in the issue's table; it fails the same way.
file:///srv/skillsfile:///srv/skills/xfile:///srv/skills//xhttps://gitlab.com/team/skillshttps://gitlab.com/team/skills/xhttps://gitlab.com/team/skills.git/xhttps://bitbucket.org/team/skillshttps://bitbucket.org/team/skills/xhttps://bitbucket.org/team/skills.git/x.git, SSH, web URLs (/-/tree/...,/src/...)Agents picked out of a repository use the same builder, so their recorded source changes the same way.
AgentRepoSourcerecovers the repository from both forms.Consumers of the string that needed to follow:
install <repo> -s <skill> --updatecompares the recorded source to decide whether the folder is the same skill. It still accepts a record in the old form, but only when the recordedrepo_urlandsubdiragree: on these hosts the old string can also name a repository of its own. The next install rewrites the record, and the project config follows it.ai_docs/tests/move_installed_skill_runbook.mdasserted the oldfile://string in two steps.Tests
internal/install: a round-trip test parses 16 typed sources (GitHub, generic host, GitLab with subgroups, a configuredgitlab_hostshost, GitLab and Bitbucket web URLs, a Bitbucket workspace namedsrc, Azure DevOps, SSH,file://), builds the per-skill source and parses it back to the same repository, path and branch. A second test covers the old form: accepted for the same repository, refused for a repository installed from the same URL.ui: the install dialog leaves a skill unselected when it is installed under the.git/form. It failed before the dialog change.make checkpasses. All UI tests pass (108 files, 884 tests);tsc -bandeslinton the changed files are clean.file://steps in the devcontainer image: the config recordsfile://.../skills//xandinstall -pon a fresh clone installs it. A record edited back to the old form is rewritten byinstall ... -s x --update.Not run: GitLab and Bitbucket against a real repository (parser tests only), the website build, the move runbook itself, and a dashboard screenshot (logic-only change).
Not covered
update; it fails for them as it did before this change. Tracked in update fails for skills recorded with a per-skill source the parser cannot split (records from before #859) #862. Runninginstall <repo> -s <skill> --updateonce rewrites the record.gitlab.com/team/skills) still does not match the recordedhttps://source. This was the case before this change.Checklist
make check) — for code changes