Repository navigation
fix(plugins): accept plain repo, release and tag page URLs in Git install - #36525
Conversation
…tall The Git URL install dialog refused anything without a #ref suffix, so pasting a repository or GitHub release link failed with "Add a #tag or #commit". It now reads owner/repo, repository URLs with or without .git, SSH URLs and GitHub / GitLab release, tag, tree and commit pages, pins the newest version tag (or the default branch's commit when there is none) with git ls-remote, shows that version and commit, and installs only that exact commit.
|
No actionable comments were generated in the recent review.
|
There was a problem hiding this comment.
Actionable comments posted: 2

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
21575ad8-ed9a-4faf-bfc8-cb4e2ae4631d
Files selected for processing: 31-
src/main/ipc/plugins.test.tssrc/main/ipc/plugins.tssrc/main/plugins/installation/plugin-git-ref-resolution.integration.test.tssrc/main/plugins/installation/plugin-git-ref-resolution.test.tssrc/main/plugins/installation/plugin-git-ref-resolution.tssrc/main/plugins/installation/plugin-install.test.tssrc/main/plugins/installation/plugin-install.tssrc/preload/api/plugin-host-api.tssrc/preload/api/plugins-bridge.tssrc/renderer/src/components/plugins/dialogs/PluginInstallDialog.test.tsxsrc/renderer/src/components/plugins/dialogs/PluginInstallDialog.tsxsrc/renderer/src/components/plugins/presentation/plugin-error-presentation.tssrc/renderer/src/components/plugins/presentation/plugin-git-install-presentation.tssrc/renderer/src/components/plugins/presentation/plugin-install-source.test.tssrc/renderer/src/components/plugins/presentation/plugin-install-source.tssrc/renderer/src/i18n/locales/de.jsonsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/pt.jsonsrc/renderer/src/i18n/locales/ru.jsonsrc/renderer/src/i18n/locales/tr.jsonsrc/renderer/src/i18n/locales/zh-Hant.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/shared/plugin-git-download-binary-compatibility.test-cases.tssrc/shared/plugins/installation/plugin-git-arguments.tssrc/shared/plugins/installation/plugin-git-install-input.test.tssrc/shared/plugins/installation/plugin-git-install-input.tssrc/shared/plugins/installation/plugin-git-resolution.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
-
ELI5
Installing a plugin from Git only worked if you typed the repository link with
#v0.1.0(or another version) glued to the end. People paste the normal repository link or the GitHub release page, and Orca just said "Add a #tag or #commit". Now Orca works out the version itself, shows you which version and commit it found, and installs exactly that.What Changed
Before:
https://github.com/kolebayev/orca-md-layoutand.../releases/tag/v0.1.0both failed with "Add a #tag or #commit, like #v0.1.0."After: the Git URL tab accepts:
owner/repo(GitHub shorthand),github.com/owner/repo, repository URLs with or without.git, and SSH URLs (git@host:owner/repo.git,ssh://…)/releases/tag/<tag>,/releases/latest,/tree/<ref>,/commit/<sha>, and GitLab/-/tree/<ref>,/-/tags/<tag>,/-/releases/<tag>,/-/commit/<sha>page links#tag/#commitsuffix, which still wins over a link with no versionInstall is now two clicks. Continue runs
git ls-remote(with the same locked-down Git settings as the download) and shows what will be installed, for example "Installs v0.1.0, the latest version, at commit 6060a67." Install then downloads that ref. Main checks that it got the exact commit it showed you, and fails with "The repository changed after Orca checked it. Try again." if it got a different one.If you don't give a version, Orca picks the newest
vX.Y.Z/X.Y.Ztag. It only picks a prerelease when the repository has no stable tag. With no version tag at all, it pins the default branch's current commit and says so. Error messages now say what is wrong: credentials in the URL, a bad#ref, "This repository has no tag or branch named X", or a repository Orca can't reach.Mechanism:
src/shared/plugins/installation/plugin-git-install-input.ts: the input parser and Git ref safety rules (check-ref-formatrules, plus no leading-).src/main/plugins/installation/plugin-git-ref-resolution.ts+plugins:resolveGitSourceIPC: turns the ref into an exact commit.plugins:installtakes a new optionalexpectedCommitfield.plugin-git-arguments.tsbuilds thels-remotearguments, and the real-Git compatibility matrix now covers them.Why
Users copy whatever URL is in the browser, so the dialog should accept it. I considered letting install fetch the default branch directly. Main already allowed that, but the user would never see what they were getting, and the version could change between clicking and downloading. Instead the dialog checks the version first and pins it to a commit. That keeps install reproducible and lets the user see the exact commit, without changing the approval step. I kept credentials in a URL refused, not stripped, so a token pasted by mistake never ends up in the lockfile. Private repositories still work through the user's own Git credential helper or SSH keys. There is no
orca plugin installCLI command, andorca://pluginsdeep links only take catalog URLs, so neither needed this parser.Linked Issue
Reported internally in Slack (teammate couldn't install
kolebayev/orca-md-layout).Visual Proof
Before (reporter's screenshot):
(screenshot removed: contained real product data)
After: plain repository URL, checked before install:
(screenshot removed: contained real product data)
After: the release page URL from the report:
(screenshot removed: contained real product data)
After: Install lands on the usual review/enable step (approval unchanged):
(screenshot removed: contained real product data)
Testing
Dev build (macOS, background launch through CDP): pasted the plain repo URL and then the
/releases/tag/v0.1.0URL from the report. Both resolved to v0.1.0 @ 6060a67. Install worked and opened the Enable/review step forkolebayev.narrow-markdown.Ran the real install path against the real GitHub repository for the plain URL, the release URL and the
owner/reposhorthand. All three installedkolebayev.narrow-markdown0.1.0 at the pinned commit.New unit tests for the parser (all URL shapes, credentials,
-/..refs) and for picking the version fromls-remoteoutput (annotated-tag peeling, newest stable tag). New SSH-fixture integration test for latest tag, default-branch fallback, missing ref and unreachable repo. Added a test that install fails when the ref moved. Added dialog tests for the two-step flow, re-checking after an edit, and refusing a token without any network call. Updated the IPC schema tests.pnpm tc,oxlint,check:code-quality:changed, localization catalog/extraction/coverage checks, and the plugin-git real-binary compatibility case against local Git. CI runs the Git 2.25+ matrix.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Agent skill upstream boundary
Notes
ls-remoteruns with the same-cprotocol policy andGIT_ALLOW_PROTOCOLas the download. Refs that start with-or contain..are refused. Install still pins and records the exact commit.expectedCommitis a new optional field, andplugins:resolveGitSourceis a new renderer→main channel inside one app build.ls-remote --tags --heads -- <url>andls-remote -- <url> HEADare both baseline-safe. They are in the compatibility matrix.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)