diff --git a/lib/modules/manager/composer/extract.spec.ts b/lib/modules/manager/composer/extract.spec.ts index bee3f2ec6cbd7accbc90aa3ac95ca85bfcb92405..617db0e7245fe2bd0e6d752de35936803f3422f7 100644 --- a/lib/modules/manager/composer/extract.spec.ts +++ b/lib/modules/manager/composer/extract.spec.ts @@ -1,3 +1,4 @@ +import { codeBlock } from 'common-tags'; import { Fixtures } from '../../../../test/fixtures'; import { fs } from '../../../../test/util'; import { extractPackageFile } from '.'; @@ -248,6 +249,35 @@ describe('modules/manager/composer/extract', () => { }); }); + it('skips path dependencies', async () => { + const res = await extractPackageFile( + codeBlock` + { + "name": "acme/path-sources", + "description": "Fetch Packages via path", + "repositories": { + "acme/path1": { + "type": "path", + "url": "packages/acme/path1" + } + }, + "require": { + "acme/path1": "*" + } + } + `, + packageFile + ); + expect(res?.deps).toEqual([ + { + currentValue: '*', + depName: 'acme/path1', + depType: 'require', + skipReason: 'path-dependency', + }, + ]); + }); + it('extracts dependencies with lock file', async () => { fs.readLocalFile.mockResolvedValue('some content'); const res = await extractPackageFile(requirements1, packageFile); diff --git a/lib/modules/manager/composer/extract.ts b/lib/modules/manager/composer/extract.ts index 2b8588b7bb57164af8774523828f1bd66ccc86a8..ae40abec46924968a463626b2ddd7a4e9c10ec40 100644 --- a/lib/modules/manager/composer/extract.ts +++ b/lib/modules/manager/composer/extract.ts @@ -46,6 +46,7 @@ function parseRepositories( switch (repo.type) { case 'vcs': case 'git': + case 'path': repositories[name!] = repo; break; case 'composer': @@ -144,6 +145,14 @@ export async function extractPackageFile( datasource = GitTagsDatasource.id; packageName = repositories[depName].url; break; + case 'path': + deps.push({ + depType, + depName, + currentValue, + skipReason: 'path-dependency', + }); + continue; } } const dep: PackageDependency = { diff --git a/lib/modules/manager/composer/types.ts b/lib/modules/manager/composer/types.ts index 896ff7bd8b0deef3824edd17984260084d4960a4..c46f294d0cf861be30aa6e0156b01d7cc09f13cf 100644 --- a/lib/modules/manager/composer/types.ts +++ b/lib/modules/manager/composer/types.ts @@ -1,7 +1,7 @@ // istanbul ignore file: types only export interface Repo { name?: string; - type: 'composer' | 'git' | 'package' | 'vcs'; + type: 'composer' | 'git' | 'package' | 'path' | 'vcs'; packagist?: boolean; 'packagist.org'?: boolean; url: string;