fix(nuget): always coalesce sourceUrl and homepage if homepage available (#30227)

Co-authored-by: Rhys Arkins <rhys@arkins.net>
This commit is contained in:
Nathanael Marchand 2024-07-22 15:49:48 +02:00 committed by GitHub
parent 6ef9445fc9
commit 7dd6325673
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 8 deletions

View file

@ -1497,6 +1497,7 @@ exports[`modules/datasource/nuget/index getReleases processes real data (v3) nus
"version": "3.12.0",
},
],
"sourceUrl": "https://nunit.org/",
}
`;
@ -1686,6 +1687,7 @@ exports[`modules/datasource/nuget/index getReleases processes real data (v3) nus
"version": "3.12.0",
},
],
"sourceUrl": "https://nunit.org/",
}
`;

View file

@ -714,7 +714,7 @@ describe('modules/datasource/nuget/index', () => {
});
expect(res).not.toBeNull();
expect(res).toMatchSnapshot();
expect(res?.sourceUrl).toBeUndefined();
expect(res?.sourceUrl).toBeDefined();
});
it('processes real data (v3) nuspec fetch 404 error', async () => {
@ -732,7 +732,7 @@ describe('modules/datasource/nuget/index', () => {
});
expect(res).not.toBeNull();
expect(res).toMatchSnapshot();
expect(res?.sourceUrl).toBeUndefined();
expect(res?.sourceUrl).toBeDefined();
});
it('processes real data (v2)', async () => {

View file

@ -240,13 +240,12 @@ export class NugetV3Api {
{ registryUrl, pkgName, pkgVersion: latestStable },
`package manifest (.nuspec) not found`,
);
return dep;
} else {
logger.debug(
{ err, registryUrl, pkgName, pkgVersion: latestStable },
`Cannot obtain sourceUrl`,
);
}
logger.debug(
{ err, registryUrl, pkgName, pkgVersion: latestStable },
`Cannot obtain sourceUrl`,
);
return dep;
}
// istanbul ignore else: not easy testable