Skip to content

fix(plugins): accept plain repo, release and tag page URLs in Git install - #36525

Merged
nwparker merged 2 commits into
mainfrom
nwparker/git-url-install-accept-common-urls
Oct 31, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/git-url-install-accept-common-urls

Conversation

@nwparker

@nwparker nwparker commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​412 $\color{#cf222e}{\Huge{\mathbf{−}}}$​17 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​395
Prod 24 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​740 $\color{#cf222e}{\Huge{\mathbf{−}}}$​151 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​589

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-layout and .../releases/tag/v0.1.0 both 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://…)
  • GitHub/Gitea /releases/tag/<tag>, /releases/latest, /tree/<ref>, /commit/<sha>, and GitLab /-/tree/<ref>, /-/tags/<tag>, /-/releases/<tag>, /-/commit/<sha> page links
  • the existing #tag / #commit suffix, which still wins over a link with no version

Install 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.Z tag. 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-format rules, plus no leading -).
  • src/main/plugins/installation/plugin-git-ref-resolution.ts + plugins:resolveGitSource IPC: turns the ref into an exact commit.
  • plugins:install takes a new optional expectedCommit field.
  • plugin-git-arguments.ts builds the ls-remote arguments, 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 install CLI command, and orca://plugins deep 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.0 URL from the report. Both resolved to v0.1.0 @ 6060a67. Install worked and opened the Enable/review step for kolebayev.narrow-markdown.

  • Ran the real install path against the real GitHub repository for the plain URL, the release URL and the owner/repo shorthand. All three installed kolebayev.narrow-markdown 0.1.0 at the pinned commit.

  • New unit tests for the parser (all URL shapes, credentials, -/.. refs) and for picking the version from ls-remote output (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

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Security: the URL allowlist is still HTTPS/SSH only. ls-remote runs with the same -c protocol policy and GIT_ALLOW_PROTOCOL as the download. Refs that start with - or contain .. are refused. Install still pins and records the exact commit.
  • SSH/remote: installs run on the Orca host as before. Nothing local-only was added.
  • Wire compatibility: expectedCommit is a new optional field, and plugins:resolveGitSource is a new renderer→main channel inside one app build.
  • Git 2.25: ls-remote --tags --heads -- <url> and ls-remote -- <url> HEAD are both baseline-safe. They are in the compatibility matrix.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

…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.
@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent 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: 2ab12ce7-fb67-4602-b06b-322a238183ea
Commits

Reviewing files that changed from the base of the PR and between 3c48b6e and 82145cb.

Files selected for processing: 2
  • src/renderer/src/components/plugins/dialogs/PluginInstallDialog.test.tsx
  • src/renderer/src/components/plugins/dialogs/PluginInstallDialog.tsx
Files skipped from review as they are similar to previous changes: 2
  • src/renderer/src/components/plugins/dialogs/PluginInstallDialog.test.tsx
  • src/renderer/src/components/plugins/dialogs/PluginInstallDialog.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

Walkthrough

Git plugin installation now accepts repository links with optional refs. The main process resolves refs to version tags, branches, commits, or the default branch and returns a pinned commit. The install dialog displays the selected source and passes the expected commit to installation. Installation rejects a checkout if its commit differs from the expected commit. Tests cover input parsing, remote resolution, dialog behavior, and commit verification.

Merge Risk: Minimal · up to 82145

The dialog can now be closed while it checks a Git source, and no actionable merge risk is established from these changes.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: accepting plain repository, release, and tag page URLs for Git plugin installation.
Description check Passed The description is detailed and covers the user impact, implementation, rationale, visual proof, testing, security, compatibility, and checklist. It does not provide an actual linked issue, but it is …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is detailed and covers the user impact, implementation, rationale, visual proof, testing, security, compatibility, and checklist. It does not provide an actual linked issue, but it is otherwise mostly complete and directly related to the changes.

Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 18 functions across 20 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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
Commits

Reviewing files that changed from the base of the PR and between 2048245 and 3c48b6e.

Files selected for processing: 31
  • src/main/ipc/plugins.test.ts
  • src/main/ipc/plugins.ts
  • src/main/plugins/installation/plugin-git-ref-resolution.integration.test.ts
  • src/main/plugins/installation/plugin-git-ref-resolution.test.ts
  • src/main/plugins/installation/plugin-git-ref-resolution.ts
  • src/main/plugins/installation/plugin-install.test.ts
  • src/main/plugins/installation/plugin-install.ts
  • src/preload/api/plugin-host-api.ts
  • src/preload/api/plugins-bridge.ts
  • src/renderer/src/components/plugins/dialogs/PluginInstallDialog.test.tsx
  • src/renderer/src/components/plugins/dialogs/PluginInstallDialog.tsx
  • src/renderer/src/components/plugins/presentation/plugin-error-presentation.ts
  • src/renderer/src/components/plugins/presentation/plugin-git-install-presentation.ts
  • src/renderer/src/components/plugins/presentation/plugin-install-source.test.ts
  • src/renderer/src/components/plugins/presentation/plugin-install-source.ts
  • src/renderer/src/i18n/locales/de.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/pt.json
  • src/renderer/src/i18n/locales/ru.json
  • src/renderer/src/i18n/locales/tr.json
  • src/renderer/src/i18n/locales/zh-Hant.json
  • src/renderer/src/i18n/locales/zh.json
  • src/shared/plugin-git-download-binary-compatibility.test-cases.ts
  • src/shared/plugins/installation/plugin-git-arguments.ts
  • src/shared/plugins/installation/plugin-git-install-input.test.ts
  • src/shared/plugins/installation/plugin-git-install-input.ts
  • src/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.

@nwparker
nwparker merged commit 584e672 into main Oct 31, 2026
57 checks passed
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