refactor(github): remove ghe compatibility checks (#7540)

Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Jamie Magee <JamieMagee@users.noreply.github.com>
This commit is contained in:
Nils Plaschke 2020-10-25 00:02:41 +02:00 committed by GitHub
parent 769dede4fb
commit 8b7dbe5d33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -484,13 +484,7 @@ async function getClosedPrs(): Promise<PrList> {
} }
async function getOpenPrs(): Promise<PrList> { async function getOpenPrs(): Promise<PrList> {
// istanbul ignore if // The graphql query is supported in the current oldest GHE version 2.19
if (config.isGhe) {
logger.debug(
'Skipping unsupported graphql PullRequests.mergeStateStatus query on GHE'
);
return {};
}
if (!config.openPrList) { if (!config.openPrList) {
config.openPrList = {}; config.openPrList = {};
let query; let query;
@ -795,7 +789,7 @@ export async function getBranchStatus(
'branch status check result' 'branch status check result'
); );
let checkRuns: { name: string; status: string; conclusion: string }[] = []; let checkRuns: { name: string; status: string; conclusion: string }[] = [];
if (!config.isGhe) { // API is supported in oldest available GHE version 2.19
try { try {
const checkRunsUrl = `repos/${config.repository}/commits/${escapeHash( const checkRunsUrl = `repos/${config.repository}/commits/${escapeHash(
branchName branchName
@ -834,7 +828,6 @@ export async function getBranchStatus(
logger.warn({ err }, 'Error retrieving check runs'); logger.warn({ err }, 'Error retrieving check runs');
} }
} }
}
if (checkRuns.length === 0) { if (checkRuns.length === 0) {
if (commitStatus.state === 'success') { if (commitStatus.state === 'success') {
return BranchStatus.green; return BranchStatus.green;