mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 06:56:24 +00:00
feat(repo/lookup): log registry urls used at the lookup phase (#19332)
This commit is contained in:
parent
645f5d5194
commit
66159ac549
7 changed files with 49 additions and 17 deletions
|
@ -139,10 +139,12 @@ async function mergeRegistries(
|
|||
for (const registryUrl of registryUrls) {
|
||||
try {
|
||||
const res = await getRegistryReleases(datasource, config, registryUrl);
|
||||
if (res) {
|
||||
if (!res) {
|
||||
continue;
|
||||
}
|
||||
if (combinedRes) {
|
||||
for (const existingRelease of combinedRes.releases || []) {
|
||||
existingRelease.registryUrl = combinedRes.registryUrl;
|
||||
existingRelease.registryUrl ??= combinedRes.registryUrl;
|
||||
}
|
||||
for (const additionalRelease of res.releases || []) {
|
||||
additionalRelease.registryUrl = res.registryUrl;
|
||||
|
@ -153,7 +155,6 @@ async function mergeRegistries(
|
|||
} else {
|
||||
combinedRes = res;
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
if (err instanceof ExternalHostError) {
|
||||
throw err;
|
||||
|
|
|
@ -135,6 +135,7 @@ export interface LookupUpdate {
|
|||
checksumUrl?: string;
|
||||
downloadUrl?: string;
|
||||
releaseTimestamp?: any;
|
||||
registryUrl?: string;
|
||||
}
|
||||
|
||||
export interface PackageDependency<T = Record<string, any>> extends Package<T> {
|
||||
|
|
|
@ -8,6 +8,7 @@ exports[`workers/repository/process/lookup/index .lookupUpdates() handles digest
|
|||
"fixedVersion": "8.0.0",
|
||||
"homepage": undefined,
|
||||
"isSingleVersion": true,
|
||||
"registryUrl": undefined,
|
||||
"sourceUrl": "https://github.com/nodejs/node",
|
||||
"updates": [
|
||||
{
|
||||
|
@ -53,6 +54,7 @@ exports[`workers/repository/process/lookup/index .lookupUpdates() handles digest
|
|||
"dependencyUrl": undefined,
|
||||
"fixedVersion": "8.1.0",
|
||||
"homepage": undefined,
|
||||
"registryUrl": undefined,
|
||||
"sourceUrl": "https://github.com/nodejs/node",
|
||||
"updates": [
|
||||
{
|
||||
|
@ -75,6 +77,7 @@ exports[`workers/repository/process/lookup/index .lookupUpdates() handles digest
|
|||
"fixedVersion": "8.0.0",
|
||||
"homepage": undefined,
|
||||
"isSingleVersion": true,
|
||||
"registryUrl": undefined,
|
||||
"sourceUrl": "https://github.com/nodejs/node",
|
||||
"updates": [
|
||||
{
|
||||
|
@ -132,6 +135,7 @@ exports[`workers/repository/process/lookup/index .lookupUpdates() handles replac
|
|||
"dependencyUrl": undefined,
|
||||
"fixedVersion": "1.4.1",
|
||||
"homepage": undefined,
|
||||
"registryUrl": "https://registry.npmjs.org",
|
||||
"sourceUrl": "https://github.com/kriskowal/q",
|
||||
"updates": [
|
||||
{
|
||||
|
@ -153,6 +157,7 @@ exports[`workers/repository/process/lookup/index .lookupUpdates() handles source
|
|||
"fixedVersion": "0.9.99",
|
||||
"homepage": undefined,
|
||||
"isSingleVersion": true,
|
||||
"registryUrl": "https://registry.npmjs.org",
|
||||
"sourceUrl": "https://github.com/kriskowal/q",
|
||||
"updates": [
|
||||
{
|
||||
|
@ -215,6 +220,7 @@ Marking the latest version of an npm package as deprecated results in the entire
|
|||
"fixedVersion": "1.3.0",
|
||||
"homepage": undefined,
|
||||
"isSingleVersion": true,
|
||||
"registryUrl": "https://registry.npmjs.org",
|
||||
"sourceUrl": "https://github.com/kriskowal/q",
|
||||
"updates": [
|
||||
{
|
||||
|
@ -240,6 +246,7 @@ exports[`workers/repository/process/lookup/index .lookupUpdates() is deprecated
|
|||
"fixedVersion": "1.3.0",
|
||||
"homepage": undefined,
|
||||
"isSingleVersion": true,
|
||||
"registryUrl": "https://registry.npmjs.org",
|
||||
"sourceDirectory": "test",
|
||||
"sourceUrl": "https://github.com/kriskowal/q",
|
||||
"updates": [
|
||||
|
@ -298,6 +305,7 @@ exports[`workers/repository/process/lookup/index .lookupUpdates() returns comple
|
|||
"fixedVersion": "1.3.0",
|
||||
"homepage": undefined,
|
||||
"isSingleVersion": true,
|
||||
"registryUrl": "https://registry.npmjs.org",
|
||||
"sourceUrl": "https://github.com/kriskowal/q",
|
||||
"updates": [
|
||||
{
|
||||
|
@ -464,6 +472,7 @@ exports[`workers/repository/process/lookup/index .lookupUpdates() should downgra
|
|||
"newMajor": 1,
|
||||
"newValue": "1.16.0",
|
||||
"newVersion": "1.16.0",
|
||||
"registryUrl": undefined,
|
||||
"updateType": "rollback",
|
||||
}
|
||||
`;
|
||||
|
@ -517,6 +526,7 @@ exports[`workers/repository/process/lookup/index .lookupUpdates() should roll ba
|
|||
"newMajor": 3,
|
||||
"newValue": "3.0.1-insiders.20180726",
|
||||
"newVersion": "3.0.1-insiders.20180726",
|
||||
"registryUrl": undefined,
|
||||
"updateType": "rollback",
|
||||
},
|
||||
]
|
||||
|
@ -546,6 +556,7 @@ exports[`workers/repository/process/lookup/index .lookupUpdates() skips uncompat
|
|||
"fixedVersion": "8",
|
||||
"homepage": undefined,
|
||||
"isSingleVersion": true,
|
||||
"registryUrl": undefined,
|
||||
"sourceUrl": "https://github.com/nodejs/node",
|
||||
"updates": [
|
||||
{
|
||||
|
@ -570,6 +581,7 @@ exports[`workers/repository/process/lookup/index .lookupUpdates() skips uncompat
|
|||
"fixedVersion": "8.1",
|
||||
"homepage": undefined,
|
||||
"isSingleVersion": true,
|
||||
"registryUrl": undefined,
|
||||
"sourceUrl": "https://github.com/nodejs/node",
|
||||
"updates": [
|
||||
{
|
||||
|
@ -602,6 +614,7 @@ exports[`workers/repository/process/lookup/index .lookupUpdates() skips uncompat
|
|||
"fixedVersion": "8.1.0",
|
||||
"homepage": undefined,
|
||||
"isSingleVersion": true,
|
||||
"registryUrl": undefined,
|
||||
"sourceUrl": "https://github.com/nodejs/node",
|
||||
"updates": [
|
||||
{
|
||||
|
|
|
@ -37,6 +37,15 @@ export function generateUpdate(
|
|||
if (release.releaseTimestamp !== undefined) {
|
||||
update.releaseTimestamp = release.releaseTimestamp;
|
||||
}
|
||||
// istanbul ignore if
|
||||
if (release.registryUrl !== undefined) {
|
||||
/**
|
||||
* This means:
|
||||
* - registry strategy is set to merge
|
||||
* - releases were fetched from multiple registry urls
|
||||
*/
|
||||
update.registryUrl = release.registryUrl;
|
||||
}
|
||||
|
||||
const { currentValue } = config;
|
||||
if (currentValue) {
|
||||
|
|
|
@ -95,6 +95,7 @@ export async function lookupUpdates(
|
|||
}
|
||||
|
||||
res.sourceUrl = dependency?.sourceUrl;
|
||||
res.registryUrl = dependency?.registryUrl; // undefined when we fetched releases from multiple registries
|
||||
if (dependency.sourceDirectory) {
|
||||
res.sourceDirectory = dependency.sourceDirectory;
|
||||
}
|
||||
|
|
|
@ -40,14 +40,19 @@ export function getRollbackUpdate(
|
|||
);
|
||||
|
||||
lessThanVersions.sort((a, b) => version.sortVersions(a.version, b.version));
|
||||
let newVersion;
|
||||
let newRelease;
|
||||
if (currentValue && version.isStable(currentValue)) {
|
||||
newVersion = lessThanVersions
|
||||
newRelease = lessThanVersions
|
||||
.filter((v) => version.isStable(v.version))
|
||||
.pop()?.version;
|
||||
.pop();
|
||||
}
|
||||
let newVersion = newRelease?.version;
|
||||
let registryUrl = newRelease?.registryUrl;
|
||||
|
||||
if (!newVersion) {
|
||||
newVersion = lessThanVersions.pop()?.version;
|
||||
newRelease = lessThanVersions.pop();
|
||||
newVersion = newRelease?.version;
|
||||
registryUrl = newRelease?.registryUrl;
|
||||
}
|
||||
// istanbul ignore if
|
||||
if (!newVersion) {
|
||||
|
@ -66,6 +71,7 @@ export function getRollbackUpdate(
|
|||
newMajor: version.getMajor(newVersion)!,
|
||||
newValue: newValue!,
|
||||
newVersion,
|
||||
registryUrl,
|
||||
updateType: 'rollback',
|
||||
};
|
||||
}
|
||||
|
|
|
@ -59,6 +59,7 @@ export interface UpdateResult {
|
|||
currentVersion?: string;
|
||||
isSingleVersion?: boolean;
|
||||
skipReason?: SkipReason;
|
||||
registryUrl?: string;
|
||||
releases: Release[];
|
||||
fixedVersion?: string;
|
||||
updates: LookupUpdate[];
|
||||
|
|
Loading…
Reference in a new issue