Skip to content

Plugins: treat self-hosted repository paths that differ in case as different repositories - #35640

Merged
nwparker merged 2 commits into
mainfrom
nwparker/plugin-repo-case
Oct 29, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/plugin-repo-case

Conversation

@nwparker

@nwparker nwparker commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​7 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​7
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​11 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​7

ELI5

When a plugin update comes from a different Git repository than the installed one, Orca asks the user to review it again. Orca decided "same repository" while ignoring upper/lower case, but some self-hosted Git servers treat team/Plugin and team/plugin as two different repositories. A catalog could point at the other one and skip the review.

What Changed

  • Before: repository paths were always compared ignoring case, on every host.
  • After: case is ignored only on github.com, gitlab.com and bitbucket.org (which route paths case-insensitively). On any other host, a path that differs only in case counts as a different repository, so an update from it is flagged as moved and needs approval again.
  • Owner labels shown in the UI are unchanged (still lowercased).

Why

Follow-up from a review thread on #35470. Being strict on unknown hosts errs toward asking the user again, which is the safe direction; a catalog that merely respells a URL's case on a self-hosted server costs one extra review. Keeping the big hosts case-insensitive avoids spurious re-reviews where case truly does not matter.

Linked Issue

Follow-up from #35470.

Visual Proof

N/A — comparison logic only.

Testing

  • Unit test: a self-hosted path differing only in case is a different repository; existing respelling and moved-repository tests still pass.

Notes

Applies equally to HTTPS and SSH URLs; no wire or settings change.

A self-hosted Git server can serve team/Plugin and team/plugin as two
repositories, so treating them as one let a catalog switch repositories
without the moved-repository review. Case is still ignored on GitHub,
GitLab.com and Bitbucket, which route paths case-insensitively.
@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issues were found.

Summary

This PR keeps repository paths case-sensitive on self-hosted Git servers while preserving case-insensitive comparisons on the three listed public hosts.

  • Plugin repository paths match by case only on three named public hosts.

Reviews (2) · Last reviewed commit: "refactor(plugins): keep the marketplace ..." · Reviewed by Greptile

@coderabbitai

coderabbitai Bot commented Oct 29, 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: 056e5892-1c0e-4eaa-889d-610b8e6cc62d
Commits

Reviewing files that changed from the base of the PR and between c751322 and 960936a.

Files selected for processing: 1
  • src/shared/plugins/catalog/plugin-marketplace.ts
Files skipped from review as they are similar to previous changes: 1
  • src/shared/plugins/catalog/plugin-marketplace.ts

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

Walkthrough

Repository identity normalization preserves path casing for hosts other than GitHub, GitLab, and Bitbucket. Hostnames remain lowercased. Owner labels are lowercased. A test checks that repository URLs on another host with differently cased repository names are not equivalent.

Priority: Low

Merge Risk: Low · up to 96093

Ordinary self-hosted repository case changes are distinguished as intended. A pre-existing suffix-casing edge case remains open, but this change does not worsen it; merging is reasonable with owner awareness.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 66.67% 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: self-hosted repository paths that differ only by case are treated as different repositories.
Description check Passed The description is mostly complete and covers the user impact, implementation, rationale, testing, visual proof, and compatibility considerations. It should still provide an actual linked issue URL in…
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 mostly complete and covers the user impact, implementation, rationale, testing, visual proof, and compatibility considerations. It should still provide an actual linked issue URL instead of only referencing #35470, and the remaining template checklist sections are omitted.

Full details: Docstring Coverage

Explanation

Docstring coverage is 66.67% 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 3 functions across 2 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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Preserve the suffix case on case-sensitive hosts. · plugin-marketplace.ts:304

src/shared/plugins/catalog/plugin-marketplace.ts:304
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Preserve the suffix case on case-sensitive hosts.

On non-listed hosts, repo.git and repo.GIT currently produce the same identity. A case-sensitive Git HTTP server can map those paths to distinct repository directories. Keep repo and repo.git equivalent, but strip .git case-insensitively only for the listed case-insensitive hosts.

Suggested fix
-  const repository = segments.at(-1)!.replace(/\.git$/i, '')
-  if (!repository) {
-    return null
-  }
   const normalizedHost = host.toLowerCase()
+  const repository = segments.at(-1)!.replace(
+    CASE_INSENSITIVE_GIT_HOSTS.has(normalizedHost) ? /\.git$/i : /\.git$/,
+    ''
+  )
+  if (!repository) {
+    return null
+  }

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: b3e984ce-3df4-4cbe-94e7-3eb5330653da
Commits

Reviewing files that changed from the base of the PR and between 110c427 and c751322.

Files selected for processing: 2
  • src/shared/plugins/catalog/plugin-marketplace.test.ts
  • src/shared/plugins/catalog/plugin-marketplace.ts

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

@nwparker
nwparker merged commit 0fd3172 into main Oct 29, 2026
49 checks passed
@nwparker
nwparker deleted the nwparker/plugin-repo-case branch October 29, 2026 04:40
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