renovate 39.7.2 → 39.7.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -43,6 +43,7 @@ async function autodiscoverRepositories(config) {
|
|
43
43
|
return config;
|
44
44
|
}
|
45
45
|
logger_1.logger.debug(`Autodiscovered ${discovered.length} repositories`);
|
46
|
+
logger_1.logger.trace({ length: discovered.length, repositories: discovered }, `Autodiscovered repositories`);
|
46
47
|
if (autodiscoverFilter) {
|
47
48
|
logger_1.logger.debug({ autodiscoverFilter }, 'Applying autodiscoverFilter');
|
48
49
|
discovered = applyFilters(discovered, is_1.default.string(autodiscoverFilter) ? [autodiscoverFilter] : autodiscoverFilter);
|
@@ -92,6 +93,6 @@ function applyFilters(repos, filters) {
|
|
92
93
|
matched.add(repository);
|
93
94
|
}
|
94
95
|
}
|
95
|
-
return
|
96
|
+
return repos.filter((repository) => matched.has(repository));
|
96
97
|
}
|
97
98
|
//# sourceMappingURL=autodiscover.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"autodiscover.js","sourceRoot":"","sources":["../../../lib/workers/global/autodiscover.ts"],"names":[],"mappings":";;AAYA,
|
1
|
+
{"version":3,"file":"autodiscover.js","sourceRoot":"","sources":["../../../lib/workers/global/autodiscover.ts"],"names":[],"mappings":";;AAYA,4DA0FC;AAED,oCAmBC;;AA3HD,kEAAkC;AAElC,yCAAsC;AACtC,qDAAkD;AAClD,oDAAuD;AACvD,0DAA0E;AAE1E,uBAAuB;AACvB,SAAS,QAAQ,CAAC,KAAsC;IACtD,OAAO,MAAM,CAAC,YAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE,CAAC;AAC3E,CAAC;AAEM,KAAK,UAAU,wBAAwB,CAC5C,MAAiB;IAEjB,MAAM,EAAE,kBAAkB,EAAE,GAAG,MAAM,CAAC;IACtC,IAAI,MAAM,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;Q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AAU,EAAE,EACd,sDAAsD,CACvD,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,EAAE,GAAG,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC;AACjD,CAAC;AAED,SAAgB,YAAY,CAAC,KAAe,EAAE,OAAiB;IAC7D,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAElC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,IAAI,GAAa,CAAC;QAClB,IAAI,IAAA,2BAAY,EAAC,MAAM,CAAC,EAAE,CAAC;YACzB,MAAM,iBAAiB,GAAG,IAAA,gCAAiB,EAAC,MAAM,CAAC,CAAC;YACpD,IAAI,CAAC,iBAAiB,EAAE,CAAC;gBACvB,MAAM,IAAI,KAAK,CAAC,kCAAkC,MAAM,GAAG,CAAC,CAAC;YAC/D,CAAC;YACD,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;QACxC,CAAC;aAAM,CAAC;YACN,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,IAAA,2BAAe,EAAC,MAAM,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC3E,CAAC;QACD,KAAK,MAAM,UAAU,IAAI,GAAG,EAAE,CAAC;YAC7B,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;AAC/D,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport type { AllConfig } from '../../config/types';\nimport { logger } from '../../logger';\nimport { platform } from '../../modules/platform';\nimport { minimatchFilter } from '../../util/minimatch';\nimport { getRegexPredicate, isRegexMatch } from '../../util/string-match';\n\n// istanbul ignore next\nfunction repoName(value: string | { repository: string }): string {\n return String(is.string(value) ? value : value.repository).toLowerCase();\n}\n\nexport async function autodiscoverRepositories(\n config: AllConfig,\n): Promise<AllConfig> {\n const { autodiscoverFilter } = config;\n if (config.platform === 'local') {\n if (config.repositories?.length) {\n logger.debug(\n { repositories: config.repositories },\n 'Found repositories when in local mode',\n );\n throw new Error(\n 'Invalid configuration: repositories list not supported when platform=local',\n );\n }\n config.repositories = ['local'];\n return config;\n }\n if (!config.autodiscover) {\n if (!config.repositories?.length) {\n logger.warn(\n 'No repositories found - did you want to run with flag --autodiscover?',\n );\n }\n return config;\n }\n // Autodiscover list of repositories\n let discovered = await platform.getRepos({\n topics: config.autodiscoverTopics,\n sort: config.autodiscoverRepoSort,\n order: config.autodiscoverRepoOrder,\n includeMirrors: config.includeMirrors,\n namespaces: config.autodiscoverNamespaces,\n projects: config.autodiscoverProjects,\n });\n if (!discovered?.length) {\n // Soft fail (no error thrown) if no accessible repositories\n logger.debug('No repositories were autodiscovered');\n return config;\n }\n\n logger.debug(`Autodiscovered ${discovered.length} repositories`);\n logger.trace(\n { length: discovered.length, repositories: discovered },\n `Autodiscovered repositories`,\n );\n\n if (autodiscoverFilter) {\n logger.debug({ autodiscoverFilter }, 'Applying autodiscoverFilter');\n discovered = applyFilters(\n discovered,\n is.string(autodiscoverFilter) ? [autodiscoverFilter] : autodiscoverFilter,\n );\n\n if (!discovered.length) {\n // Soft fail (no error thrown) if no accessible repositories match the filter\n logger.debug('None of the discovered repositories matched the filter');\n return config;\n }\n }\n\n logger.info(\n { length: discovered.length, repositories: discovered },\n `Autodiscovered repositories`,\n );\n\n // istanbul ignore if\n if (config.repositories?.length) {\n logger.debug(\n 'Checking autodiscovered repositories against configured repositories',\n );\n for (const configuredRepo of config.repositories) {\n const repository = repoName(configuredRepo);\n let found = false;\n for (let i = discovered.length - 1; i > -1; i -= 1) {\n if (repository === repoName(discovered[i])) {\n found = true;\n logger.debug({ repository }, 'Using configured repository settings');\n // TODO: fix typings\n discovered[i] = configuredRepo as never;\n }\n }\n if (!found) {\n logger.warn(\n { repository },\n 'Configured repository is in not in autodiscover list',\n );\n }\n }\n }\n return { ...config, repositories: discovered };\n}\n\nexport function applyFilters(repos: string[], filters: string[]): string[] {\n const matched = new Set<string>();\n\n for (const filter of filters) {\n let res: string[];\n if (isRegexMatch(filter)) {\n const autodiscoveryPred = getRegexPredicate(filter);\n if (!autodiscoveryPred) {\n throw new Error(`Failed to parse regex pattern \"${filter}\"`);\n }\n res = repos.filter(autodiscoveryPred);\n } else {\n res = repos.filter(minimatchFilter(filter, { dot: true, nocase: true }));\n }\n for (const repository of res) {\n matched.add(repository);\n }\n }\n return repos.filter((repository) => matched.has(repository));\n}\n"]}
|