Skip to content

fix(extensions): support non-GitHub git URLs for extension installation#2539

Merged
LaZzyMan merged 1 commit intoQwenLM:mainfrom
d191:main
Mar 24, 2026
Merged

fix(extensions): support non-GitHub git URLs for extension installation#2539
LaZzyMan merged 1 commit intoQwenLM:mainfrom
d191:main

Conversation

@d191
Copy link
Copy Markdown
Contributor

@d191 d191 commented Mar 20, 2026

TLDR

Fixes extension installation from local domain git servers (GitLab, Bitbucket, etc.) by catching errors from parseGitHubRepoForReleases and falling back to use the source URL directly.

Dive Deeper

When installing an extension from a self-hosted git server (e.g., https://gitlab.company.com/team/my-extension), the installation failed after user confirmation with:

 Invalid GitHub repository source: https://gitlab.company.com/team/my-extension. Expected "owner/repo" or a github repo uri.

The root cause was in packages/core/src/extension/extensionManager.ts - the getExtensionId function unconditionally called parseGitHubRepoForReleases() which only supports GitHub URLs.

Solution: Wrapped the call in try-catch. If parsing fails (non-GitHub URL), use the source URL as-is for generating the extension ID - same behavior as local type installations.

Reviewer Test Plan

  1. Run npm install and npm run build
  2. Try installing an extension from a non-GitHub git URL:
    qwen extensions install https://gitlab.company.com/team/test-extension
  3. Verify the extension installs successfully
  4. Run qwen extensions list to confirm the extension appears

Testing Matrix

🍏 🪟 🐧
npm run
npx
Docker
Podman - -
Seatbelt - -

Linked issues / bugs

Fixes #2538

Fixes extension installation from local domain git servers (GitLab, Bitbucket, etc.)
by catching errors from parseGitHubRepoForReleases and falling back to use the source URL directly.

- Add unit test for non-GitHub git URLs
@LaZzyMan
Copy link
Copy Markdown
Collaborator

@d191 Thank you for your contribution. After making the changes, did you test the installation of this extension locally? Since I cannot access the URL you provided, I cannot verify whether this bug has been fixed.

@LaZzyMan LaZzyMan self-assigned this Mar 23, 2026
@d191
Copy link
Copy Markdown
Contributor Author

d191 commented Mar 23, 2026

@LaZzyMan I created a public URL for testing https://gitlab.com/d1912060813/qwen.

Here's my local verification:

$ npm run start extensions install https://gitlab.com/d1912060813/qwen
> @qwen-code/qwen-code@0.13.0 start
> cross-env node scripts/start.js extensions install https://gitlab.com/d1912060813/qwen

Checking build status...
Build is up-to-date.
Installing extension "d191".
**Extensions may introduce unexpected behavior. Ensure you have investigated the extension source and trust the author.**
This extension will add the following commands: review-code.
This extension will install the following skills:
  * hello-skill: A simple skill that demonstrates basic skill functionality
Do you want to continue? [Y/n]: y
Extension "d191" installed successfully and enabled.

Copy link
Copy Markdown
Collaborator

@LaZzyMan LaZzyMan left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

Extension installation fails from non-GitHub git servers

2 participants