refactor(github): log graphql pr numbers

This commit is contained in:
Rhys Arkins 2018-09-11 06:33:39 +02:00
parent dc038b3962
commit b4fe18dbbd

View file

@ -882,6 +882,7 @@ async function getOpenPrs() {
json: false, json: false,
}; };
const res = JSON.parse((await get.post(url, options)).body); const res = JSON.parse((await get.post(url, options)).body);
const prNumbers = [];
for (const pr of res.data.repository.pullRequests.nodes) { for (const pr of res.data.repository.pullRequests.nodes) {
// https://developer.github.com/v4/object/pullrequest/ // https://developer.github.com/v4/object/pullrequest/
pr.displayNumber = `Pull Request #${pr.number}`; pr.displayNumber = `Pull Request #${pr.number}`;
@ -935,7 +936,10 @@ async function getOpenPrs() {
delete pr.mergeStateStatus; delete pr.mergeStateStatus;
delete pr.commits; delete pr.commits;
openPrList[pr.number] = pr; openPrList[pr.number] = pr;
prNumbers.push(pr.number);
} }
prNumbers.sort();
logger.info({ prNumbers }, 'Retrieved open PR list with graphql');
} catch (err) /* istanbul ignore next */ { } catch (err) /* istanbul ignore next */ {
logger.warn({ err }, 'getOpenPrs error'); logger.warn({ err }, 'getOpenPrs error');
} }