mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-28 03:30:40 +00:00
Merge pull request #2539 from d191/main
Some checks are pending
Qwen Code CI / Lint (push) Waiting to run
Qwen Code CI / Test (push) Blocked by required conditions
Qwen Code CI / Test-1 (push) Blocked by required conditions
Qwen Code CI / Test-2 (push) Blocked by required conditions
Qwen Code CI / Test-3 (push) Blocked by required conditions
Qwen Code CI / Test-4 (push) Blocked by required conditions
Qwen Code CI / Test-5 (push) Blocked by required conditions
Qwen Code CI / Test-6 (push) Blocked by required conditions
Qwen Code CI / Test-7 (push) Blocked by required conditions
Qwen Code CI / Test-8 (push) Blocked by required conditions
Qwen Code CI / Post Coverage Comment (push) Blocked by required conditions
Qwen Code CI / CodeQL (push) Waiting to run
E2E Tests / E2E Test (Linux) - sandbox:docker (push) Waiting to run
E2E Tests / E2E Test (Linux) - sandbox:none (push) Waiting to run
E2E Tests / E2E Test - macOS (push) Waiting to run
Some checks are pending
Qwen Code CI / Lint (push) Waiting to run
Qwen Code CI / Test (push) Blocked by required conditions
Qwen Code CI / Test-1 (push) Blocked by required conditions
Qwen Code CI / Test-2 (push) Blocked by required conditions
Qwen Code CI / Test-3 (push) Blocked by required conditions
Qwen Code CI / Test-4 (push) Blocked by required conditions
Qwen Code CI / Test-5 (push) Blocked by required conditions
Qwen Code CI / Test-6 (push) Blocked by required conditions
Qwen Code CI / Test-7 (push) Blocked by required conditions
Qwen Code CI / Test-8 (push) Blocked by required conditions
Qwen Code CI / Post Coverage Comment (push) Blocked by required conditions
Qwen Code CI / CodeQL (push) Waiting to run
E2E Tests / E2E Test (Linux) - sandbox:docker (push) Waiting to run
E2E Tests / E2E Test (Linux) - sandbox:none (push) Waiting to run
E2E Tests / E2E Test - macOS (push) Waiting to run
fix(extensions): support non-GitHub git URLs for extension installation
This commit is contained in:
commit
3776825c2d
2 changed files with 23 additions and 3 deletions
|
|
@ -755,6 +755,20 @@ describe('extension tests', () => {
|
|||
const id = getExtensionId(config, metadata);
|
||||
expect(id).toBe(hashValue('https://github.com/owner/repo'));
|
||||
});
|
||||
|
||||
it('should use source as-is for non-GitHub git URLs (e.g., GitLab)', () => {
|
||||
// For non-GitHub git servers, fall back to using the source URL directly
|
||||
const config: ExtensionConfig = { name: 'test-ext', version: '1.0.0' };
|
||||
const metadata = {
|
||||
type: 'git' as const,
|
||||
source: 'https://gitlab.company.com/team/extension-repo',
|
||||
};
|
||||
|
||||
const id = getExtensionId(config, metadata);
|
||||
expect(id).toBe(
|
||||
hashValue('https://gitlab.company.com/team/extension-repo'),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1358,12 +1358,18 @@ export function getExtensionId(
|
|||
installMetadata?: ExtensionInstallMetadata,
|
||||
): string {
|
||||
let idValue = config.name;
|
||||
const githubUrlParts =
|
||||
let githubUrlParts = null;
|
||||
if (
|
||||
installMetadata &&
|
||||
(installMetadata.type === 'git' ||
|
||||
installMetadata.type === 'github-release')
|
||||
? parseGitHubRepoForReleases(installMetadata.source)
|
||||
: null;
|
||||
) {
|
||||
try {
|
||||
githubUrlParts = parseGitHubRepoForReleases(installMetadata.source);
|
||||
} catch {
|
||||
// Non-GitHub URL (GitLab, Bitbucket, etc.) - use source as-is
|
||||
}
|
||||
}
|
||||
if (githubUrlParts) {
|
||||
idValue = `https://github.com/${githubUrlParts.owner}/${githubUrlParts.repo}`;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue