diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index 62954f7dffe049e002c3d3a7609e0b5832e55d0b..faaed8762b27890cad31e7025d8e02cefc2f454c 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -436,6 +436,10 @@ The above will change a raw version of `release-2.0.0` to `2.0.0`, for example. } ``` +## fetchReleaseNotes + +Configure this to `false` if you want to disable release notes fetching + ## fileMatch `fileMatch` is used by Renovate to know which files in a repository to parse and extract, and it is possible to override defaults values to customize for your project's needs. diff --git a/lib/config/common.ts b/lib/config/common.ts index f91a223820ab9781c72ad17ed5727da1601cc817..4bbee3aa5ece2d8bde00210962eb05403b51cf4e 100644 --- a/lib/config/common.ts +++ b/lib/config/common.ts @@ -176,6 +176,8 @@ export interface RenovateConfig warnings?: ValidationMessage[]; vulnerabilityAlerts?: RenovateSharedConfig; regexManagers?: CustomManager[]; + + fetchReleaseNotes?: boolean; } export interface AssigneesAndReviewersConfig { diff --git a/lib/config/definitions.ts b/lib/config/definitions.ts index 15655724b145e9b32108c8921700c3631631620e..a4efd5a1447e6acd594434acc995c40750009820 100644 --- a/lib/config/definitions.ts +++ b/lib/config/definitions.ts @@ -1836,6 +1836,14 @@ const options: RenovateOptions[] = [ cli: false, env: false, }, + { + name: 'fetchReleaseNotes', + description: 'Allow to disable release notes fetching', + type: 'boolean', + default: true, + cli: false, + env: false, + }, ]; export function getOptions(): RenovateOptions[] { diff --git a/lib/workers/repository/updates/branchify.spec.ts b/lib/workers/repository/updates/branchify.spec.ts index 717991de72c8e54fed591e9af40a504dce3089da..37ec32683888e4c4d7c01648c5f3fbf3a3516fda 100644 --- a/lib/workers/repository/updates/branchify.spec.ts +++ b/lib/workers/repository/updates/branchify.spec.ts @@ -1,10 +1,14 @@ import { RenovateConfig, mocked } from '../../../../test/util'; import { getConfig } from '../../../config/defaults'; +import * as _changelog from '../changelog'; import { branchifyUpgrades } from './branchify'; import * as _flatten from './flatten'; const flattenUpdates = mocked(_flatten).flattenUpdates; +const embedChangelogs = mocked(_changelog).embedChangelogs; + jest.mock('./flatten'); +jest.mock('../changelog'); let config: RenovateConfig; beforeEach(() => { @@ -113,5 +117,35 @@ describe('workers/repository/updates/branchify', () => { const res = await branchifyUpgrades(config, {}); expect(Object.keys(res.branches)).toHaveLength(2); }); + it('no fetch changelogs', async () => { + config.fetchReleaseNotes = false; + flattenUpdates.mockResolvedValueOnce([ + { + depName: 'foo', + branchName: 'foo', + prTitle: 'some-title', + version: '1.1.0', + groupName: 'My Group', + group: { branchName: 'renovate/{{groupSlug}}' }, + }, + { + depName: 'foo', + branchName: 'foo', + prTitle: 'some-title', + version: '2.0.0', + }, + { + depName: 'bar', + branchName: 'bar-{{version}}', + prTitle: 'some-title', + version: '1.1.0', + groupName: 'My Group', + group: { branchName: 'renovate/my-group' }, + }, + ]); + const res = await branchifyUpgrades(config, {}); + expect(embedChangelogs).not.toHaveBeenCalled(); + expect(Object.keys(res.branches)).toHaveLength(2); + }); }); }); diff --git a/lib/workers/repository/updates/branchify.ts b/lib/workers/repository/updates/branchify.ts index e3f1630af598640d49cc3b60473ea02b4b27a305..7b6961647990dfbff08bc2b8c3333e52c4a81487 100644 --- a/lib/workers/repository/updates/branchify.ts +++ b/lib/workers/repository/updates/branchify.ts @@ -37,7 +37,9 @@ export async function branchifyUpgrades( ); } logger.debug(`Returning ${Object.keys(branchUpgrades).length} branch(es)`); - await embedChangelogs(branchUpgrades); + if (config.fetchReleaseNotes) { + await embedChangelogs(branchUpgrades); + } for (const branchName of Object.keys(branchUpgrades)) { // Add branch name to metadata before generating branch config addMeta({