mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 23:16:26 +00:00
parent
0534aea2d8
commit
da8676deca
3 changed files with 16 additions and 16 deletions
|
@ -37,7 +37,7 @@ async function dryRun(
|
||||||
) {
|
) {
|
||||||
jest.clearAllMocks();
|
jest.clearAllMocks();
|
||||||
setAdminConfig({ dryRun: true });
|
setAdminConfig({ dryRun: true });
|
||||||
await dependencyDashboard.ensureMasterIssue(config, branches);
|
await dependencyDashboard.ensureDependencyDashboard(config, branches);
|
||||||
expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(
|
expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(
|
||||||
ensureIssueClosingCalls
|
ensureIssueClosingCalls
|
||||||
);
|
);
|
||||||
|
@ -53,7 +53,7 @@ describe(getName(), () => {
|
||||||
});
|
});
|
||||||
it('do nothing if masterissue is disable', async () => {
|
it('do nothing if masterissue is disable', async () => {
|
||||||
const branches: BranchConfig[] = [];
|
const branches: BranchConfig[] = [];
|
||||||
await dependencyDashboard.ensureMasterIssue(config, branches);
|
await dependencyDashboard.ensureDependencyDashboard(config, branches);
|
||||||
expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(0);
|
expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(0);
|
||||||
expect(platform.ensureIssue).toHaveBeenCalledTimes(0);
|
expect(platform.ensureIssue).toHaveBeenCalledTimes(0);
|
||||||
expect(platform.getBranchPr).toHaveBeenCalledTimes(0);
|
expect(platform.getBranchPr).toHaveBeenCalledTimes(0);
|
||||||
|
@ -75,7 +75,7 @@ describe(getName(), () => {
|
||||||
dependencyDashboardApproval: false,
|
dependencyDashboardApproval: false,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
await dependencyDashboard.ensureMasterIssue(config, branches);
|
await dependencyDashboard.ensureDependencyDashboard(config, branches);
|
||||||
expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(0);
|
expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(0);
|
||||||
expect(platform.ensureIssue).toHaveBeenCalledTimes(0);
|
expect(platform.ensureIssue).toHaveBeenCalledTimes(0);
|
||||||
expect(platform.getBranchPr).toHaveBeenCalledTimes(0);
|
expect(platform.getBranchPr).toHaveBeenCalledTimes(0);
|
||||||
|
@ -89,7 +89,7 @@ describe(getName(), () => {
|
||||||
const branches: BranchConfig[] = [];
|
const branches: BranchConfig[] = [];
|
||||||
config.dependencyDashboard = true;
|
config.dependencyDashboard = true;
|
||||||
config.dependencyDashboardAutoclose = true;
|
config.dependencyDashboardAutoclose = true;
|
||||||
await dependencyDashboard.ensureMasterIssue(config, branches);
|
await dependencyDashboard.ensureDependencyDashboard(config, branches);
|
||||||
expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(1);
|
expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(1);
|
||||||
expect(platform.ensureIssueClosing.mock.calls[0][0]).toBe(
|
expect(platform.ensureIssueClosing.mock.calls[0][0]).toBe(
|
||||||
config.dependencyDashboardTitle
|
config.dependencyDashboardTitle
|
||||||
|
@ -118,7 +118,7 @@ describe(getName(), () => {
|
||||||
];
|
];
|
||||||
config.dependencyDashboard = true;
|
config.dependencyDashboard = true;
|
||||||
config.dependencyDashboardAutoclose = true;
|
config.dependencyDashboardAutoclose = true;
|
||||||
await dependencyDashboard.ensureMasterIssue(config, branches);
|
await dependencyDashboard.ensureDependencyDashboard(config, branches);
|
||||||
expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(1);
|
expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(1);
|
||||||
expect(platform.ensureIssueClosing.mock.calls[0][0]).toBe(
|
expect(platform.ensureIssueClosing.mock.calls[0][0]).toBe(
|
||||||
config.dependencyDashboardTitle
|
config.dependencyDashboardTitle
|
||||||
|
@ -135,7 +135,7 @@ describe(getName(), () => {
|
||||||
const branches: BranchConfig[] = [];
|
const branches: BranchConfig[] = [];
|
||||||
config.dependencyDashboard = true;
|
config.dependencyDashboard = true;
|
||||||
config.dependencyDashboardFooter = 'And this is a footer';
|
config.dependencyDashboardFooter = 'And this is a footer';
|
||||||
await dependencyDashboard.ensureMasterIssue(config, branches);
|
await dependencyDashboard.ensureDependencyDashboard(config, branches);
|
||||||
expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(0);
|
expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(0);
|
||||||
expect(platform.ensureIssue).toHaveBeenCalledTimes(1);
|
expect(platform.ensureIssue).toHaveBeenCalledTimes(1);
|
||||||
expect(platform.ensureIssue.mock.calls[0][0].title).toBe(
|
expect(platform.ensureIssue.mock.calls[0][0].title).toBe(
|
||||||
|
@ -158,7 +158,7 @@ describe(getName(), () => {
|
||||||
{},
|
{},
|
||||||
];
|
];
|
||||||
config.dependencyDashboardFooter = 'And this is a footer';
|
config.dependencyDashboardFooter = 'And this is a footer';
|
||||||
await dependencyDashboard.ensureMasterIssue(config, branches);
|
await dependencyDashboard.ensureDependencyDashboard(config, branches);
|
||||||
expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(0);
|
expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(0);
|
||||||
expect(platform.ensureIssue).toHaveBeenCalledTimes(1);
|
expect(platform.ensureIssue).toHaveBeenCalledTimes(1);
|
||||||
expect(platform.ensureIssue.mock.calls[0][0].title).toBe(
|
expect(platform.ensureIssue.mock.calls[0][0].title).toBe(
|
||||||
|
@ -232,7 +232,7 @@ describe(getName(), () => {
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
config.dependencyDashboard = true;
|
config.dependencyDashboard = true;
|
||||||
await dependencyDashboard.ensureMasterIssue(config, branches);
|
await dependencyDashboard.ensureDependencyDashboard(config, branches);
|
||||||
expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(0);
|
expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(0);
|
||||||
expect(platform.ensureIssue).toHaveBeenCalledTimes(1);
|
expect(platform.ensureIssue).toHaveBeenCalledTimes(1);
|
||||||
expect(platform.ensureIssue.mock.calls[0][0].title).toBe(
|
expect(platform.ensureIssue.mock.calls[0][0].title).toBe(
|
||||||
|
@ -272,7 +272,7 @@ describe(getName(), () => {
|
||||||
platform.getBranchPr
|
platform.getBranchPr
|
||||||
.mockResolvedValueOnce({ ...mock<Pr>(), number: 1 })
|
.mockResolvedValueOnce({ ...mock<Pr>(), number: 1 })
|
||||||
.mockResolvedValueOnce(undefined);
|
.mockResolvedValueOnce(undefined);
|
||||||
await dependencyDashboard.ensureMasterIssue(config, branches);
|
await dependencyDashboard.ensureDependencyDashboard(config, branches);
|
||||||
expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(0);
|
expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(0);
|
||||||
expect(platform.ensureIssue).toHaveBeenCalledTimes(1);
|
expect(platform.ensureIssue).toHaveBeenCalledTimes(1);
|
||||||
expect(platform.ensureIssue.mock.calls[0][0].title).toBe(
|
expect(platform.ensureIssue.mock.calls[0][0].title).toBe(
|
||||||
|
@ -322,7 +322,7 @@ describe(getName(), () => {
|
||||||
.mockResolvedValueOnce({ ...mock<Pr>(), number: 1 })
|
.mockResolvedValueOnce({ ...mock<Pr>(), number: 1 })
|
||||||
.mockResolvedValueOnce(undefined)
|
.mockResolvedValueOnce(undefined)
|
||||||
.mockResolvedValueOnce({ ...mock<Pr>(), number: 3 });
|
.mockResolvedValueOnce({ ...mock<Pr>(), number: 3 });
|
||||||
await dependencyDashboard.ensureMasterIssue(config, branches);
|
await dependencyDashboard.ensureDependencyDashboard(config, branches);
|
||||||
expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(0);
|
expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(0);
|
||||||
expect(platform.ensureIssue).toHaveBeenCalledTimes(1);
|
expect(platform.ensureIssue).toHaveBeenCalledTimes(1);
|
||||||
expect(platform.ensureIssue.mock.calls[0][0].title).toBe(
|
expect(platform.ensureIssue.mock.calls[0][0].title).toBe(
|
||||||
|
@ -366,7 +366,7 @@ describe(getName(), () => {
|
||||||
.mockResolvedValueOnce({ ...mock<Pr>(), number: 1 })
|
.mockResolvedValueOnce({ ...mock<Pr>(), number: 1 })
|
||||||
.mockResolvedValueOnce(undefined)
|
.mockResolvedValueOnce(undefined)
|
||||||
.mockResolvedValueOnce({ ...mock<Pr>(), number: 3 });
|
.mockResolvedValueOnce({ ...mock<Pr>(), number: 3 });
|
||||||
await dependencyDashboard.ensureMasterIssue(config, branches);
|
await dependencyDashboard.ensureDependencyDashboard(config, branches);
|
||||||
expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(0);
|
expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(0);
|
||||||
expect(platform.ensureIssue).toHaveBeenCalledTimes(1);
|
expect(platform.ensureIssue).toHaveBeenCalledTimes(1);
|
||||||
expect(platform.ensureIssue.mock.calls[0][0].title).toBe(
|
expect(platform.ensureIssue.mock.calls[0][0].title).toBe(
|
||||||
|
@ -424,7 +424,7 @@ describe(getName(), () => {
|
||||||
];
|
];
|
||||||
config.dependencyDashboard = true;
|
config.dependencyDashboard = true;
|
||||||
config.dependencyDashboardPrApproval = true;
|
config.dependencyDashboardPrApproval = true;
|
||||||
await dependencyDashboard.ensureMasterIssue(config, branches);
|
await dependencyDashboard.ensureDependencyDashboard(config, branches);
|
||||||
expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(0);
|
expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(0);
|
||||||
expect(platform.ensureIssue).toHaveBeenCalledTimes(1);
|
expect(platform.ensureIssue).toHaveBeenCalledTimes(1);
|
||||||
expect(platform.ensureIssue.mock.calls[0][0].title).toBe(
|
expect(platform.ensureIssue.mock.calls[0][0].title).toBe(
|
||||||
|
@ -483,7 +483,7 @@ describe(getName(), () => {
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
config.dependencyDashboard = true;
|
config.dependencyDashboard = true;
|
||||||
await dependencyDashboard.ensureMasterIssue(config, branches);
|
await dependencyDashboard.ensureDependencyDashboard(config, branches);
|
||||||
expect(platform.ensureIssue).toHaveBeenCalledTimes(1);
|
expect(platform.ensureIssue).toHaveBeenCalledTimes(1);
|
||||||
expect(platform.ensureIssue.mock.calls[0][0].body).toMatchSnapshot();
|
expect(platform.ensureIssue.mock.calls[0][0].body).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
|
@ -49,7 +49,7 @@ function appendRepoProblems(config: RenovateConfig, issueBody: string): string {
|
||||||
return newIssueBody;
|
return newIssueBody;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function ensureMasterIssue(
|
export async function ensureDependencyDashboard(
|
||||||
config: RenovateConfig,
|
config: RenovateConfig,
|
||||||
branches: BranchConfig[]
|
branches: BranchConfig[]
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { deleteLocalFile, privateCacheDir } from '../../util/fs';
|
||||||
import * as queue from '../../util/http/queue';
|
import * as queue from '../../util/http/queue';
|
||||||
import { addSplit, getSplits, splitInit } from '../../util/split';
|
import { addSplit, getSplits, splitInit } from '../../util/split';
|
||||||
import { setBranchCache } from './cache';
|
import { setBranchCache } from './cache';
|
||||||
import { ensureMasterIssue } from './dependency-dashboard';
|
import { ensureDependencyDashboard } from './dependency-dashboard';
|
||||||
import handleError from './error';
|
import handleError from './error';
|
||||||
import { finaliseRepo } from './finalise';
|
import { finaliseRepo } from './finalise';
|
||||||
import { initRepo } from './init';
|
import { initRepo } from './init';
|
||||||
|
@ -56,7 +56,7 @@ export async function renovateRepository(
|
||||||
}
|
}
|
||||||
logger.debug(`Automerged but already retried once`);
|
logger.debug(`Automerged but already retried once`);
|
||||||
} else {
|
} else {
|
||||||
await ensureMasterIssue(config, branches);
|
await ensureDependencyDashboard(config, branches);
|
||||||
}
|
}
|
||||||
await finaliseRepo(config, branchList);
|
await finaliseRepo(config, branchList);
|
||||||
repoResult = processResult(config, res);
|
repoResult = processResult(config, res);
|
||||||
|
|
Loading…
Reference in a new issue