From da8676decaf8290a682a87bc6d6581e4c17ac89e Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Tue, 1 Jun 2021 15:07:54 +0200
Subject: [PATCH] chore: rename ensureMasterIssue (#10260)

Closes #10254
---
 .../repository/dependency-dashboard.spec.ts   | 26 +++++++++----------
 .../repository/dependency-dashboard.ts        |  2 +-
 lib/workers/repository/index.ts               |  4 +--
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/lib/workers/repository/dependency-dashboard.spec.ts b/lib/workers/repository/dependency-dashboard.spec.ts
index c1c5e97462..3eba9b79b3 100644
--- a/lib/workers/repository/dependency-dashboard.spec.ts
+++ b/lib/workers/repository/dependency-dashboard.spec.ts
@@ -37,7 +37,7 @@ async function dryRun(
 ) {
   jest.clearAllMocks();
   setAdminConfig({ dryRun: true });
-  await dependencyDashboard.ensureMasterIssue(config, branches);
+  await dependencyDashboard.ensureDependencyDashboard(config, branches);
   expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(
     ensureIssueClosingCalls
   );
@@ -53,7 +53,7 @@ describe(getName(), () => {
     });
     it('do nothing if masterissue is disable', async () => {
       const branches: BranchConfig[] = [];
-      await dependencyDashboard.ensureMasterIssue(config, branches);
+      await dependencyDashboard.ensureDependencyDashboard(config, branches);
       expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(0);
       expect(platform.ensureIssue).toHaveBeenCalledTimes(0);
       expect(platform.getBranchPr).toHaveBeenCalledTimes(0);
@@ -75,7 +75,7 @@ describe(getName(), () => {
           dependencyDashboardApproval: false,
         },
       ];
-      await dependencyDashboard.ensureMasterIssue(config, branches);
+      await dependencyDashboard.ensureDependencyDashboard(config, branches);
       expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(0);
       expect(platform.ensureIssue).toHaveBeenCalledTimes(0);
       expect(platform.getBranchPr).toHaveBeenCalledTimes(0);
@@ -89,7 +89,7 @@ describe(getName(), () => {
       const branches: BranchConfig[] = [];
       config.dependencyDashboard = true;
       config.dependencyDashboardAutoclose = true;
-      await dependencyDashboard.ensureMasterIssue(config, branches);
+      await dependencyDashboard.ensureDependencyDashboard(config, branches);
       expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(1);
       expect(platform.ensureIssueClosing.mock.calls[0][0]).toBe(
         config.dependencyDashboardTitle
@@ -118,7 +118,7 @@ describe(getName(), () => {
       ];
       config.dependencyDashboard = true;
       config.dependencyDashboardAutoclose = true;
-      await dependencyDashboard.ensureMasterIssue(config, branches);
+      await dependencyDashboard.ensureDependencyDashboard(config, branches);
       expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(1);
       expect(platform.ensureIssueClosing.mock.calls[0][0]).toBe(
         config.dependencyDashboardTitle
@@ -135,7 +135,7 @@ describe(getName(), () => {
       const branches: BranchConfig[] = [];
       config.dependencyDashboard = true;
       config.dependencyDashboardFooter = 'And this is a footer';
-      await dependencyDashboard.ensureMasterIssue(config, branches);
+      await dependencyDashboard.ensureDependencyDashboard(config, branches);
       expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(0);
       expect(platform.ensureIssue).toHaveBeenCalledTimes(1);
       expect(platform.ensureIssue.mock.calls[0][0].title).toBe(
@@ -158,7 +158,7 @@ describe(getName(), () => {
         {},
       ];
       config.dependencyDashboardFooter = 'And this is a footer';
-      await dependencyDashboard.ensureMasterIssue(config, branches);
+      await dependencyDashboard.ensureDependencyDashboard(config, branches);
       expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(0);
       expect(platform.ensureIssue).toHaveBeenCalledTimes(1);
       expect(platform.ensureIssue.mock.calls[0][0].title).toBe(
@@ -232,7 +232,7 @@ describe(getName(), () => {
         },
       ];
       config.dependencyDashboard = true;
-      await dependencyDashboard.ensureMasterIssue(config, branches);
+      await dependencyDashboard.ensureDependencyDashboard(config, branches);
       expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(0);
       expect(platform.ensureIssue).toHaveBeenCalledTimes(1);
       expect(platform.ensureIssue.mock.calls[0][0].title).toBe(
@@ -272,7 +272,7 @@ describe(getName(), () => {
       platform.getBranchPr
         .mockResolvedValueOnce({ ...mock<Pr>(), number: 1 })
         .mockResolvedValueOnce(undefined);
-      await dependencyDashboard.ensureMasterIssue(config, branches);
+      await dependencyDashboard.ensureDependencyDashboard(config, branches);
       expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(0);
       expect(platform.ensureIssue).toHaveBeenCalledTimes(1);
       expect(platform.ensureIssue.mock.calls[0][0].title).toBe(
@@ -322,7 +322,7 @@ describe(getName(), () => {
         .mockResolvedValueOnce({ ...mock<Pr>(), number: 1 })
         .mockResolvedValueOnce(undefined)
         .mockResolvedValueOnce({ ...mock<Pr>(), number: 3 });
-      await dependencyDashboard.ensureMasterIssue(config, branches);
+      await dependencyDashboard.ensureDependencyDashboard(config, branches);
       expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(0);
       expect(platform.ensureIssue).toHaveBeenCalledTimes(1);
       expect(platform.ensureIssue.mock.calls[0][0].title).toBe(
@@ -366,7 +366,7 @@ describe(getName(), () => {
         .mockResolvedValueOnce({ ...mock<Pr>(), number: 1 })
         .mockResolvedValueOnce(undefined)
         .mockResolvedValueOnce({ ...mock<Pr>(), number: 3 });
-      await dependencyDashboard.ensureMasterIssue(config, branches);
+      await dependencyDashboard.ensureDependencyDashboard(config, branches);
       expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(0);
       expect(platform.ensureIssue).toHaveBeenCalledTimes(1);
       expect(platform.ensureIssue.mock.calls[0][0].title).toBe(
@@ -424,7 +424,7 @@ describe(getName(), () => {
       ];
       config.dependencyDashboard = true;
       config.dependencyDashboardPrApproval = true;
-      await dependencyDashboard.ensureMasterIssue(config, branches);
+      await dependencyDashboard.ensureDependencyDashboard(config, branches);
       expect(platform.ensureIssueClosing).toHaveBeenCalledTimes(0);
       expect(platform.ensureIssue).toHaveBeenCalledTimes(1);
       expect(platform.ensureIssue.mock.calls[0][0].title).toBe(
@@ -483,7 +483,7 @@ describe(getName(), () => {
         },
       ]);
       config.dependencyDashboard = true;
-      await dependencyDashboard.ensureMasterIssue(config, branches);
+      await dependencyDashboard.ensureDependencyDashboard(config, branches);
       expect(platform.ensureIssue).toHaveBeenCalledTimes(1);
       expect(platform.ensureIssue.mock.calls[0][0].body).toMatchSnapshot();
     });
diff --git a/lib/workers/repository/dependency-dashboard.ts b/lib/workers/repository/dependency-dashboard.ts
index 8e75e00599..74abd1e887 100644
--- a/lib/workers/repository/dependency-dashboard.ts
+++ b/lib/workers/repository/dependency-dashboard.ts
@@ -49,7 +49,7 @@ function appendRepoProblems(config: RenovateConfig, issueBody: string): string {
   return newIssueBody;
 }
 
-export async function ensureMasterIssue(
+export async function ensureDependencyDashboard(
   config: RenovateConfig,
   branches: BranchConfig[]
 ): Promise<void> {
diff --git a/lib/workers/repository/index.ts b/lib/workers/repository/index.ts
index 8ec13a53de..8e53c45100 100644
--- a/lib/workers/repository/index.ts
+++ b/lib/workers/repository/index.ts
@@ -6,7 +6,7 @@ import { deleteLocalFile, privateCacheDir } from '../../util/fs';
 import * as queue from '../../util/http/queue';
 import { addSplit, getSplits, splitInit } from '../../util/split';
 import { setBranchCache } from './cache';
-import { ensureMasterIssue } from './dependency-dashboard';
+import { ensureDependencyDashboard } from './dependency-dashboard';
 import handleError from './error';
 import { finaliseRepo } from './finalise';
 import { initRepo } from './init';
@@ -56,7 +56,7 @@ export async function renovateRepository(
       }
       logger.debug(`Automerged but already retried once`);
     } else {
-      await ensureMasterIssue(config, branches);
+      await ensureDependencyDashboard(config, branches);
     }
     await finaliseRepo(config, branchList);
     repoResult = processResult(config, res);
-- 
GitLab