mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 06:56:24 +00:00
fix(automerge): force PR creation on dashboard approval (#21924)
This commit is contained in:
parent
168b872423
commit
d6edbb2e2d
2 changed files with 23 additions and 1 deletions
|
@ -396,6 +396,23 @@ describe('workers/repository/update/pr/index', () => {
|
||||||
expect(prCache.setPrCache).not.toHaveBeenCalled();
|
expect(prCache.setPrCache).not.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('forces PR on dashboard check', async () => {
|
||||||
|
platform.createPr.mockResolvedValueOnce(pr);
|
||||||
|
|
||||||
|
const res = await ensurePr({
|
||||||
|
...config,
|
||||||
|
automerge: true,
|
||||||
|
automergeType: 'branch',
|
||||||
|
reviewers: ['somebody'],
|
||||||
|
dependencyDashboardChecks: {
|
||||||
|
'renovate-branch': 'approvePr',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(res).toEqual({ type: 'with-pr', pr });
|
||||||
|
expect(prCache.setPrCache).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
|
||||||
it('adds assignees for PR automerge with red status', async () => {
|
it('adds assignees for PR automerge with red status', async () => {
|
||||||
const changedPr: Pr = {
|
const changedPr: Pr = {
|
||||||
...pr,
|
...pr,
|
||||||
|
|
|
@ -143,6 +143,11 @@ export async function ensurePr(
|
||||||
config.forcePr = true;
|
config.forcePr = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dependencyDashboardCheck === 'approvePr') {
|
||||||
|
logger.debug('Forcing PR because of dependency dashboard approval');
|
||||||
|
config.forcePr = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (!existingPr) {
|
if (!existingPr) {
|
||||||
// Only create a PR if a branch automerge has failed
|
// Only create a PR if a branch automerge has failed
|
||||||
if (
|
if (
|
||||||
|
@ -172,7 +177,7 @@ export async function ensurePr(
|
||||||
return { type: 'without-pr', prBlockedBy: 'BranchAutomerge' };
|
return { type: 'without-pr', prBlockedBy: 'BranchAutomerge' };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!existingPr && config.prCreation === 'status-success') {
|
if (config.prCreation === 'status-success') {
|
||||||
logger.debug('Checking branch combined status');
|
logger.debug('Checking branch combined status');
|
||||||
if ((await getBranchStatus()) !== 'green') {
|
if ((await getBranchStatus()) !== 'green') {
|
||||||
logger.debug(`Branch status isn't green - not creating PR`);
|
logger.debug(`Branch status isn't green - not creating PR`);
|
||||||
|
|
Loading…
Reference in a new issue