mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 06:56:24 +00:00
feat: New Configuration option fetchReleaseNotes (#7404)
This commit is contained in:
parent
082f1ba03f
commit
bb9e30f64a
5 changed files with 51 additions and 1 deletions
|
@ -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.
|
||||
|
|
|
@ -176,6 +176,8 @@ export interface RenovateConfig
|
|||
warnings?: ValidationMessage[];
|
||||
vulnerabilityAlerts?: RenovateSharedConfig;
|
||||
regexManagers?: CustomManager[];
|
||||
|
||||
fetchReleaseNotes?: boolean;
|
||||
}
|
||||
|
||||
export interface AssigneesAndReviewersConfig {
|
||||
|
|
|
@ -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[] {
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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({
|
||||
|
|
Loading…
Reference in a new issue