From 56e6bd32b5bfb584d1904eeca64f08194f1efde2 Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@keylocation.sg>
Date: Wed, 1 Nov 2017 11:42:20 +0100
Subject: [PATCH] refactor: log if repository is a configured fork (#1071)

---
 lib/workers/repository/index.js       | 12 ++++++++----
 test/workers/repository/index.spec.js |  9 +++++++++
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/lib/workers/repository/index.js b/lib/workers/repository/index.js
index a590265bb1..a2b003e656 100644
--- a/lib/workers/repository/index.js
+++ b/lib/workers/repository/index.js
@@ -47,10 +47,14 @@ async function renovateRepository(repoConfig, token) {
       await cleanup.pruneStaleBranches(config, []);
       return null;
     }
-    if (config.isFork && !config.renovateJsonPresent) {
-      logger.debug('repository is a fork and not manually configured');
-      await cleanup.pruneStaleBranches(config, []);
-      return null;
+    if (config.isFork) {
+      if (config.renovateJsonPresent) {
+        logger.info('Processing forked repository');
+      } else {
+        logger.debug('repository is a fork and not manually configured');
+        await cleanup.pruneStaleBranches(config, []);
+        return null;
+      }
     }
     if (config.baseBranch) {
       // Renovate should read content and target PRs here
diff --git a/test/workers/repository/index.spec.js b/test/workers/repository/index.spec.js
index bed7d6c8cd..3f1e87bae3 100644
--- a/test/workers/repository/index.spec.js
+++ b/test/workers/repository/index.spec.js
@@ -76,6 +76,15 @@ describe('workers/repository', () => {
       await repositoryWorker.renovateRepository(config);
       expect(manager.detectPackageFiles.mock.calls.length).toBe(0);
     });
+    it('does not skip repository if its a configured fork', async () => {
+      config.isFork = true;
+      config.renovateJsonPresent = true;
+      manager.detectPackageFiles.mockImplementationOnce(input => ({
+        ...input,
+        ...{ packageFiles: [] },
+      }));
+      await repositoryWorker.renovateRepository(config);
+    });
     it('sets custom base branch', async () => {
       config.baseBranch = 'some-branch';
       config.api.branchExists.mockReturnValueOnce(true);
-- 
GitLab