Skip to content

Commit

Permalink
refactor: move changelog retrieval to renovateRepository
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed May 8, 2020
1 parent 010df05 commit 6a8ceab
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
7 changes: 7 additions & 0 deletions lib/workers/repository/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { ensureMasterIssue } from './master-issue';
import { ensureOnboardingPr } from './onboarding/pr';
import { extractDependencies, updateRepo } from './process';
import { ProcessResult, processResult } from './result';
import { getChangeLogJSON } from '../pr/changelog';

let renovateVersion = 'unknown';
try {
Expand Down Expand Up @@ -38,6 +39,12 @@ export async function renovateRepository(
config
);
await ensureOnboardingPr(config, packageFiles, branches);
for (const branch of branches) {
for (const upgrade of branch.upgrades) {
upgrade.logJSON = await getChangeLogJSON(upgrade);
}
}
addSplit('changelogs');
const res = await updateRepo(config, branches, branchList);
addSplit('update');
if (res !== 'automerged') {
Expand Down
5 changes: 1 addition & 4 deletions lib/workers/repository/process/extract-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ export async function extract(config: RenovateConfig): Promise<ExtractResult> {
);
logger.trace({ config: packageFiles }, 'packageFiles');
await fetchUpdates(config, packageFiles);
addSplit(
config.baseBranches?.length ? `lookup:${config.baseBranch}` : 'lookup'
);
logger.debug({ config: packageFiles }, 'packageFiles with updates');
await raiseDeprecationWarnings(config, packageFiles);
const { branches, branchList } = await branchifyUpgrades(
Expand All @@ -68,7 +65,7 @@ export async function extract(config: RenovateConfig): Promise<ExtractResult> {
);
sortBranches(branches);
addSplit(
config.baseBranches?.length ? `branchify:${config.baseBranch}` : 'branchify'
config.baseBranches?.length ? `lookup:${config.baseBranch}` : 'lookup'
);
return { branches, branchList, packageFiles };
}
Expand Down
4 changes: 0 additions & 4 deletions lib/workers/repository/updates/branchify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { RenovateConfig, ValidationMessage } from '../../../config';
import { addMeta, logger, removeMeta } from '../../../logger';
import * as template from '../../../util/template';
import { BranchConfig, BranchUpgradeConfig } from '../../common';
import { getChangeLogJSON } from '../../pr/changelog';
import { flattenUpdates } from './flatten';
import { generateBranchConfig } from './generate';
import { Merge } from 'type-fest';
Expand Down Expand Up @@ -115,9 +114,6 @@ export async function branchifyUpgrades(
addMeta({
branch: branchName,
});
for (const upgrade of branchUpgrades[branchName]) {
upgrade.logJSON = await getChangeLogJSON(upgrade);
}
const seenUpdates = {};
// Filter out duplicates
branchUpgrades[branchName] = branchUpgrades[branchName].filter(
Expand Down

0 comments on commit 6a8ceab

Please sign in to comment.