renovate/lib/workers/repository/process/extract-update.js
Rhys Arkins 7c0a17e9d0 feat: group together deprecation warnings
Previously, deprecation warnings were done as part of dependency lookups, which were run concurrently. This meant the chance of duplicate issues was high, due to race conditions. Instead, raising the issues is done once all package are looked up, to ensure only one issue per manager/dependency. It also means we can list all of the affected package files, in case of a monorepo.

Closes #2224, Closes #2225
2018-07-05 14:23:28 +02:00

26 lines
998 B
JavaScript

const { writeUpdates } = require('./write');
const { sortBranches } = require('./sort');
const { fetchUpdates } = require('./fetch');
const { raiseDeprecationWarnings } = require('./deprecated');
const { branchifyUpgrades } = require('../updates/branchify');
const { extractAllDependencies } = require('../extract');
module.exports = {
extractAndUpdate,
};
async function extractAndUpdate(config) {
logger.debug('extractAndUpdate()');
const packageFiles = await extractAllDependencies(config);
logger.trace({ config: packageFiles }, 'packageFiles');
await fetchUpdates(config, packageFiles);
logger.debug({ config: packageFiles }, 'packageFiles with updates');
await raiseDeprecationWarnings(config, packageFiles);
const { branches, branchList } = branchifyUpgrades(config, packageFiles);
sortBranches(branches);
let res;
if (config.repoIsOnboarded) {
res = await writeUpdates(config, packageFiles, branches);
}
return { res, branches, branchList, packageFiles };
}