From e10f590c9a78c83ca08197689eaf2cae730a1814 Mon Sep 17 00:00:00 2001
From: Edd Armitage <edward.armitage@gmail.com>
Date: Thu, 22 Aug 2019 18:34:50 +0100
Subject: [PATCH] fix(gitlab): follow pagination in getbranchstatus for gitlab
 (#4342)

There are cases where the first page of results is not representative of the entire branch's status, so we need to follow all pages in the result.

Closes #4340
---
 lib/platform/gitlab/index.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/platform/gitlab/index.ts b/lib/platform/gitlab/index.ts
index db7094b2a7..5bb7b797dc 100644
--- a/lib/platform/gitlab/index.ts
+++ b/lib/platform/gitlab/index.ts
@@ -329,7 +329,7 @@ export async function getBranchStatus(
   const branchSha = await config.storage.getBranchCommit(branchName);
   // Now, check the statuses for that commit
   const url = `projects/${config.repository}/repository/commits/${branchSha}/statuses`;
-  const res = await api.get(url);
+  const res = await api.get(url, { paginate: true });
   logger.debug(`Got res with ${res.body.length} results`);
   if (res.body.length === 0) {
     // Return 'pending' if we have no status checks
-- 
GitLab