Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Merged multiple skipReasons into unspecified-version. #22409

Merged
merged 4 commits into from May 25, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -46,15 +46,15 @@ exports[`modules/manager/ansible-galaxy/extract extractPackageFile() check colle
"registryUrls": [
"https://cloud.redhat.com/api/automation-hub/",
],
"skipReason": "no-version",
"skipReason": "unspecified-version",
},
{
"currentValue": null,
"datasource": "git-tags",
"depName": "foo.bar/organization/repo_name",
"depType": "galaxy-collection",
"packageName": "https://foo.bar/organization/repo_name.git",
"skipReason": "no-version",
"skipReason": "unspecified-version",
},
{
"currentValue": "1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/manager/ansible-galaxy/collections.ts
Expand Up @@ -124,7 +124,7 @@ function finalize(dependency: AnsibleGalaxyPackageDependency): boolean {
}

if (!dependency.currentValue && !dep.skipReason) {
dep.skipReason = 'no-version';
dep.skipReason = 'unspecified-version';
}
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/manager/ansible-galaxy/roles.ts
Expand Up @@ -47,7 +47,7 @@ function interpretLine(
function finalize(dependency: AnsibleGalaxyPackageDependency): boolean {
const dep = dependency;
if (dependency.managerData.version === null) {
dep.skipReason = 'no-version';
dep.skipReason = 'unspecified-version';
return false;
}
const source = dep.managerData.src ?? '';
Expand Down
12 changes: 6 additions & 6 deletions lib/modules/manager/cpanfile/extract.spec.ts
Expand Up @@ -59,7 +59,7 @@ describe('modules/manager/cpanfile/extract', () => {
{
datasource: 'cpan',
depName: 'Try::Tiny',
skipReason: 'no-version',
skipReason: 'unspecified-version',
},
{
datasource: 'cpan',
Expand Down Expand Up @@ -124,7 +124,7 @@ describe('modules/manager/cpanfile/extract', () => {
{
datasource: 'cpan',
depName: 'Crypt::URandom',
skipReason: 'no-version',
skipReason: 'unspecified-version',
},
{
datasource: 'cpan',
Expand Down Expand Up @@ -154,7 +154,7 @@ describe('modules/manager/cpanfile/extract', () => {
{
datasource: 'cpan',
depName: 'Authen::Simple::Passwd',
skipReason: 'no-version',
skipReason: 'unspecified-version',
},
],
});
Expand Down Expand Up @@ -228,7 +228,7 @@ describe('modules/manager/cpanfile/extract', () => {
datasource: 'cpan',
depName: 'Test::Requires',
depType: 'test',
skipReason: 'no-version',
skipReason: 'unspecified-version',
},
],
});
Expand All @@ -251,13 +251,13 @@ describe('modules/manager/cpanfile/extract', () => {
datasource: 'cpan',
depName: 'FCGI',
depType: 'runtime',
skipReason: 'no-version',
skipReason: 'unspecified-version',
},
{
datasource: 'cpan',
depName: 'FCGI::ProcManager',
depType: 'runtime',
skipReason: 'no-version',
skipReason: 'unspecified-version',
},
],
});
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/manager/cpanfile/parser.ts
Expand Up @@ -89,7 +89,7 @@ const moduleMatch = q
if (currentValue) {
dep.currentValue = currentValue;
} else {
dep.skipReason = 'no-version';
dep.skipReason = 'unspecified-version';
}
if (phase) {
dep.depType = phase;
Expand Down
6 changes: 3 additions & 3 deletions lib/modules/manager/fleet/extract.spec.ts
Expand Up @@ -118,7 +118,7 @@ kind: Fleet
packageName: 'cert-manager',
registryUrls: ['https://charts.jetstack.io'],
depType: 'fleet',
skipReason: 'no-version',
skipReason: 'unspecified-version',
},
]);
});
Expand All @@ -129,7 +129,7 @@ kind: Fleet
expect(result).not.toBeNull();
expect(result?.deps).toMatchObject([
{
skipReason: 'no-version',
skipReason: 'unspecified-version',
datasource: 'helm',
depName: 'cert-manager',
registryUrls: ['https://charts.jetstack.io'],
Expand Down Expand Up @@ -204,7 +204,7 @@ kind: Fleet
datasource: 'git-tags',
depName: 'https://github.com/rancher/rancher',
depType: 'git_repo',
skipReason: 'no-version',
skipReason: 'unspecified-version',
sourceUrl: 'https://github.com/rancher/rancher',
},
]);
Expand Down
4 changes: 2 additions & 2 deletions lib/modules/manager/fleet/extract.ts
Expand Up @@ -28,7 +28,7 @@ function extractGitRepo(doc: GitRepo): PackageDependency {
if (!currentValue) {
return {
...dep,
skipReason: 'no-version',
skipReason: 'unspecified-version',
};
}

Expand Down Expand Up @@ -71,7 +71,7 @@ function extractFleetHelmBlock(doc: FleetHelmBlock): PackageDependency {
if (!doc.version) {
return {
...dep,
skipReason: 'no-version',
skipReason: 'unspecified-version',
};
}

Expand Down
6 changes: 3 additions & 3 deletions lib/modules/manager/gradle/extract.spec.ts
Expand Up @@ -667,21 +667,21 @@ describe('modules/manager/gradle/extract', () => {
managerData: {
packageFile: 'gradle/libs.versions.toml',
},
skipReason: 'no-version',
skipReason: 'unspecified-version',
},
{
depName: 'google-firebase-crashlytics',
managerData: {
packageFile: 'gradle/libs.versions.toml',
},
skipReason: 'no-version',
skipReason: 'unspecified-version',
},
{
depName: 'google-firebase-messaging',
managerData: {
packageFile: 'gradle/libs.versions.toml',
},
skipReason: 'no-version',
skipReason: 'unspecified-version',
},
{
depName: 'org.jetbrains.kotlin.jvm',
Expand Down
4 changes: 2 additions & 2 deletions lib/modules/manager/gradle/extract/catalog.ts
Expand Up @@ -113,7 +113,7 @@ function extractLiteralVersion({
sectionKey: string;
}): VersionExtract {
if (!version) {
return { skipReason: 'no-version' };
return { skipReason: 'unspecified-version' };
} else if (is.string(version)) {
const fileReplacePosition =
depStartIndex + findVersionIndex(depSubContent, sectionKey, version);
Expand Down Expand Up @@ -179,7 +179,7 @@ function extractDependency({
if (!currentValue) {
return {
depName,
skipReason: 'no-version',
skipReason: 'unspecified-version',
};
}
return {
Expand Down
Expand Up @@ -51,7 +51,7 @@ exports[`modules/manager/helmsman/extract extractPackageFile() extract deps 1`]
{
"datasource": "helm",
"depName": "strimzi-operator-missing-version",
"skipReason": "no-version",
"skipReason": "unspecified-version",
},
{
"currentValue": "2.6.0",
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/manager/helmsman/extract.ts
Expand Up @@ -26,7 +26,7 @@ function createDep(
}

if (!anApp.version) {
dep.skipReason = 'no-version';
dep.skipReason = 'unspecified-version';
return dep;
}
dep.currentValue = anApp.version;
Expand Down
Expand Up @@ -75,7 +75,7 @@ exports[`modules/manager/jenkins/extract extractPackageFile() extracts multiple
{
"datasource": "jenkins-plugins",
"depName": "docker",
"skipReason": "no-version",
"skipReason": "unspecified-version",
"versioning": "maven",
},
{
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/manager/jenkins/extract.ts
Expand Up @@ -27,7 +27,7 @@ function getDependency(plugin: JenkinsPlugin): PackageDependency {
);
}
} else {
dep.skipReason = 'no-version';
dep.skipReason = 'unspecified-version';
}

if (
Expand Down
8 changes: 4 additions & 4 deletions lib/modules/manager/mint/extract.spec.ts
Expand Up @@ -43,11 +43,11 @@ describe('modules/manager/mint/extract', () => {
deps: [
{
depName: 'yonaskolb/xcodegen',
skipReason: 'no-version',
skipReason: 'unspecified-version',
},
{
depName: 'realm/SwiftLint',
skipReason: 'no-version',
skipReason: 'unspecified-version',
},
],
});
Expand All @@ -69,7 +69,7 @@ describe('modules/manager/mint/extract', () => {
},
{
depName: 'yonaskolb/xcodegen',
skipReason: 'no-version',
skipReason: 'unspecified-version',
},
{
depName: 'realm/SwiftLint',
Expand Down Expand Up @@ -99,7 +99,7 @@ describe('modules/manager/mint/extract', () => {
},
{
depName: 'yonaskolb/xcodegen',
skipReason: 'no-version',
skipReason: 'unspecified-version',
},
{
depName: 'realm/SwiftLint',
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/manager/mint/extract.ts
Expand Up @@ -31,7 +31,7 @@ function handleDepInMintfile(line: string): PackageDependency {
if (!line.includes('@')) {
return {
depName: line,
skipReason: 'no-version',
skipReason: 'unspecified-version',
};
}
const [depName, currentVersion] = line.split('@').map((s) => s.trim());
Expand Down
14 changes: 7 additions & 7 deletions lib/modules/manager/pep621/extract.spec.ts
Expand Up @@ -35,7 +35,7 @@ describe('modules/manager/pep621/extract', () => {
depName: 'blinker',
datasource: 'pypi',
depType: 'project.dependencies',
skipReason: 'any-version',
skipReason: 'unspecified-version',
},
{
packageName: 'packaging',
Expand Down Expand Up @@ -63,7 +63,7 @@ describe('modules/manager/pep621/extract', () => {
depName: 'pyproject-hooks',
datasource: 'pypi',
depType: 'project.dependencies',
skipReason: 'any-version',
skipReason: 'unspecified-version',
},
{
packageName: 'unearth',
Expand Down Expand Up @@ -105,7 +105,7 @@ describe('modules/manager/pep621/extract', () => {
depName: 'typing-extensions',
datasource: 'pypi',
depType: 'project.dependencies',
skipReason: 'any-version',
skipReason: 'unspecified-version',
},
{
packageName: 'importlib-metadata',
Expand All @@ -131,7 +131,7 @@ describe('modules/manager/pep621/extract', () => {
packageName: 'pytest-mock',
datasource: 'pypi',
depType: 'project.optional-dependencies',
skipReason: 'any-version',
skipReason: 'unspecified-version',
depName: 'pytest/pytest-mock',
},
]);
Expand All @@ -144,7 +144,7 @@ describe('modules/manager/pep621/extract', () => {
packageName: 'pdm',
datasource: 'pypi',
depType: 'tool.pdm.dev-dependencies',
skipReason: 'any-version',
skipReason: 'unspecified-version',
depName: 'test/pdm',
},
{
Expand All @@ -158,7 +158,7 @@ describe('modules/manager/pep621/extract', () => {
packageName: 'tox',
datasource: 'pypi',
depType: 'tool.pdm.dev-dependencies',
skipReason: 'any-version',
skipReason: 'unspecified-version',
depName: 'tox/tox',
},
{
Expand All @@ -180,7 +180,7 @@ describe('modules/manager/pep621/extract', () => {
depName: 'blinker',
datasource: 'pypi',
depType: 'project.dependencies',
skipReason: 'any-version',
skipReason: 'unspecified-version',
registryUrls: [
'https://private-site.org/pypi/simple',
'https://private.pypi.org/simple',
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/manager/pep621/utils.ts
Expand Up @@ -58,7 +58,7 @@ export function pep508ToPackageDependency(
};

if (is.nullOrUndefined(parsed.currentValue)) {
dep.skipReason = 'any-version';
dep.skipReason = 'unspecified-version';
} else {
dep.currentValue = parsed.currentValue;
}
Expand Down
6 changes: 3 additions & 3 deletions lib/modules/manager/pipenv/__snapshots__/extract.spec.ts.snap
Expand Up @@ -68,7 +68,7 @@ exports[`modules/manager/pipenv/extract extractPackageFile() extracts example pi
"depName": "requests",
"depType": "packages",
"managerData": {},
"skipReason": "any-version",
"skipReason": "unspecified-version",
},
{
"currentValue": ">0.5.0",
Expand Down Expand Up @@ -105,14 +105,14 @@ exports[`modules/manager/pipenv/extract extractPackageFile() extracts example pi
"registryUrls": [
"https://pypi.python.org/simple",
],
"skipReason": "any-version",
"skipReason": "unspecified-version",
},
{
"currentValue": "*",
"depName": "nose",
"depType": "dev-packages",
"managerData": {},
"skipReason": "any-version",
"skipReason": "unspecified-version",
},
{
"currentValue": ">=1.0,<3.0",
Expand Down
8 changes: 4 additions & 4 deletions lib/modules/manager/pipenv/extract.spec.ts
Expand Up @@ -28,7 +28,7 @@ describe('modules/manager/pipenv/extract', () => {
expect(res?.deps.filter((dep) => !dep.skipReason)).toHaveLength(4);
});

it('marks packages with "extras" as skipReason === any-version', async () => {
it('marks packages with "extras" as skipReason === unspecified-version', async () => {
const res = await extractPackageFile(pipfile3, 'Pipfile');
expect(res?.deps.filter((r) => !r.skipReason)).toHaveLength(0);
expect(res?.deps.filter((r) => r.skipReason)).toHaveLength(6);
Expand Down Expand Up @@ -83,7 +83,7 @@ describe('modules/manager/pipenv/extract', () => {
expect(res).toMatchSnapshot({
extractedConstraints: { python: '== 2.7.*' },
deps: [
{ depName: 'requests', skipReason: 'any-version' },
{ depName: 'requests', skipReason: 'unspecified-version' },
{
currentValue: '>0.5.0',
datasource: 'pypi',
Expand All @@ -93,8 +93,8 @@ describe('modules/manager/pipenv/extract', () => {
{ depName: 'django', skipReason: 'git-dependency' },
{ depName: 'e682b37', skipReason: 'file-dependency' },
{ depName: 'e1839a8', skipReason: 'local-dependency' },
{ depName: 'pywinusb', skipReason: 'any-version' },
{ currentValue: '*', skipReason: 'any-version' },
{ depName: 'pywinusb', skipReason: 'unspecified-version' },
{ currentValue: '*', skipReason: 'unspecified-version' },
{
currentValue: '>=1.0,<3.0',
datasource: 'pypi',
Expand Down