Failover debugging.

It is indicating it is not getting Check Suite Information, which is unlikely.
This commit is contained in:
Michael J Mulligan 2021-04-07 21:10:35 +01:00
parent db5738640c
commit 4449bb8588
4 changed files with 54 additions and 40 deletions

View file

@ -6767,7 +6767,12 @@ function fetchCheckSuiteId(runId) {
.catch((e) => { .catch((e) => {
throw `Unable to fetch Workflow Run: ${e}`; throw `Unable to fetch Workflow Run: ${e}`;
}); });
if (currentRun.status === `in_progress`) { if (!currentRun) {
throw `Unexpected error: No run returned`;
}
if (currentRun.status !== `in_progress`) {
throw `Unexpected error: Expected status of 'in_progress', got '${currentRun.status}': ` + util_1.inspect(currentRun);
}
// The GitHub API it's self does present the `check_suite_id` property, but it is not documented or present returned object's `type` // The GitHub API it's self does present the `check_suite_id` property, but it is not documented or present returned object's `type`
currentCheckSuiteId = (_a = parseInt(currentRun.check_suite_url.substr(1 + currentRun.check_suite_url.lastIndexOf(`/`)))) !== null && _a !== void 0 ? _a : -1; currentCheckSuiteId = (_a = parseInt(currentRun.check_suite_url.substr(1 + currentRun.check_suite_url.lastIndexOf(`/`)))) !== null && _a !== void 0 ? _a : -1;
// The following SHOULD work, but alas // The following SHOULD work, but alas
@ -6776,9 +6781,8 @@ function fetchCheckSuiteId(runId) {
throw `Error extracting Check Suite ID from: ${currentRun.check_suite_url}`; throw `Error extracting Check Suite ID from: ${currentRun.check_suite_url}`;
} }
} }
}
catch (e) { catch (e) {
core.info(`::error::Error Fetching Current Run: ${e}`); core.info(`::error::Error Fetching Current Run (${runId}): ${e}`);
} }
} }
return currentCheckSuiteId; return currentCheckSuiteId;
@ -6890,7 +6894,6 @@ function resolveCheckRunId(checkRunIdent) {
} }
catch (e) { catch (e) {
core.info(`::error::Unable to resolve Check Run ID: ${e}`); core.info(`::error::Unable to resolve Check Run ID: ${e}`);
core.info(`checkRunIdent = ` + util_1.inspect(checkRunIdent));
} }
} }
} }

11
dist/pre/index.js vendored
View file

@ -6767,7 +6767,12 @@ function fetchCheckSuiteId(runId) {
.catch((e) => { .catch((e) => {
throw `Unable to fetch Workflow Run: ${e}`; throw `Unable to fetch Workflow Run: ${e}`;
}); });
if (currentRun.status === `in_progress`) { if (!currentRun) {
throw `Unexpected error: No run returned`;
}
if (currentRun.status !== `in_progress`) {
throw `Unexpected error: Expected status of 'in_progress', got '${currentRun.status}': ` + util_1.inspect(currentRun);
}
// The GitHub API it's self does present the `check_suite_id` property, but it is not documented or present returned object's `type` // The GitHub API it's self does present the `check_suite_id` property, but it is not documented or present returned object's `type`
currentCheckSuiteId = (_a = parseInt(currentRun.check_suite_url.substr(1 + currentRun.check_suite_url.lastIndexOf(`/`)))) !== null && _a !== void 0 ? _a : -1; currentCheckSuiteId = (_a = parseInt(currentRun.check_suite_url.substr(1 + currentRun.check_suite_url.lastIndexOf(`/`)))) !== null && _a !== void 0 ? _a : -1;
// The following SHOULD work, but alas // The following SHOULD work, but alas
@ -6776,9 +6781,8 @@ function fetchCheckSuiteId(runId) {
throw `Error extracting Check Suite ID from: ${currentRun.check_suite_url}`; throw `Error extracting Check Suite ID from: ${currentRun.check_suite_url}`;
} }
} }
}
catch (e) { catch (e) {
core.info(`::error::Error Fetching Current Run: ${e}`); core.info(`::error::Error Fetching Current Run (${runId}): ${e}`);
} }
} }
return currentCheckSuiteId; return currentCheckSuiteId;
@ -6890,7 +6894,6 @@ function resolveCheckRunId(checkRunIdent) {
} }
catch (e) { catch (e) {
core.info(`::error::Unable to resolve Check Run ID: ${e}`); core.info(`::error::Unable to resolve Check Run ID: ${e}`);
core.info(`checkRunIdent = ` + util_1.inspect(checkRunIdent));
} }
} }
} }

11
dist/run/index.js vendored
View file

@ -6777,7 +6777,12 @@ function fetchCheckSuiteId(runId) {
.catch((e) => { .catch((e) => {
throw `Unable to fetch Workflow Run: ${e}`; throw `Unable to fetch Workflow Run: ${e}`;
}); });
if (currentRun.status === `in_progress`) { if (!currentRun) {
throw `Unexpected error: No run returned`;
}
if (currentRun.status !== `in_progress`) {
throw `Unexpected error: Expected status of 'in_progress', got '${currentRun.status}': ` + util_1.inspect(currentRun);
}
// The GitHub API it's self does present the `check_suite_id` property, but it is not documented or present returned object's `type` // The GitHub API it's self does present the `check_suite_id` property, but it is not documented or present returned object's `type`
currentCheckSuiteId = (_a = parseInt(currentRun.check_suite_url.substr(1 + currentRun.check_suite_url.lastIndexOf(`/`)))) !== null && _a !== void 0 ? _a : -1; currentCheckSuiteId = (_a = parseInt(currentRun.check_suite_url.substr(1 + currentRun.check_suite_url.lastIndexOf(`/`)))) !== null && _a !== void 0 ? _a : -1;
// The following SHOULD work, but alas // The following SHOULD work, but alas
@ -6786,9 +6791,8 @@ function fetchCheckSuiteId(runId) {
throw `Error extracting Check Suite ID from: ${currentRun.check_suite_url}`; throw `Error extracting Check Suite ID from: ${currentRun.check_suite_url}`;
} }
} }
}
catch (e) { catch (e) {
core.info(`::error::Error Fetching Current Run: ${e}`); core.info(`::error::Error Fetching Current Run (${runId}): ${e}`);
} }
} }
return currentCheckSuiteId; return currentCheckSuiteId;
@ -6900,7 +6904,6 @@ function resolveCheckRunId(checkRunIdent) {
} }
catch (e) { catch (e) {
core.info(`::error::Unable to resolve Check Run ID: ${e}`); core.info(`::error::Unable to resolve Check Run ID: ${e}`);
core.info(`checkRunIdent = ` + util_1.inspect(checkRunIdent));
} }
} }
} }

View file

@ -117,7 +117,14 @@ async function fetchCheckSuiteId(runId: number): Promise<number> {
throw `Unable to fetch Workflow Run: ${e}` throw `Unable to fetch Workflow Run: ${e}`
}) })
if (currentRun.status === `in_progress`) { if (!currentRun) {
throw `Unexpected error: No run returned`
}
if (currentRun.status !== `in_progress`) {
throw `Unexpected error: Expected status of 'in_progress', got '${currentRun.status}': ` + inspect(currentRun)
}
// The GitHub API it's self does present the `check_suite_id` property, but it is not documented or present returned object's `type` // The GitHub API it's self does present the `check_suite_id` property, but it is not documented or present returned object's `type`
currentCheckSuiteId = parseInt(currentRun.check_suite_url.substr(1 + currentRun.check_suite_url.lastIndexOf(`/`))) ?? -1 currentCheckSuiteId = parseInt(currentRun.check_suite_url.substr(1 + currentRun.check_suite_url.lastIndexOf(`/`))) ?? -1
// The following SHOULD work, but alas // The following SHOULD work, but alas
@ -125,9 +132,8 @@ async function fetchCheckSuiteId(runId: number): Promise<number> {
if (currentCheckSuiteId <= 0) { if (currentCheckSuiteId <= 0) {
throw `Error extracting Check Suite ID from: ${currentRun.check_suite_url}` throw `Error extracting Check Suite ID from: ${currentRun.check_suite_url}`
} }
}
} catch (e) { } catch (e) {
core.info(`::error::Error Fetching Current Run: ${e}`) core.info(`::error::Error Fetching Current Run (${runId}): ${e}`)
} }
} }
return currentCheckSuiteId return currentCheckSuiteId
@ -260,7 +266,6 @@ async function resolveCheckRunId(checkRunIdent: CheckRunIdent): Promise<number>
} }
} catch (e) { } catch (e) {
core.info(`::error::Unable to resolve Check Run ID: ${e}`) core.info(`::error::Unable to resolve Check Run ID: ${e}`)
core.info(`checkRunIdent = ` + inspect(checkRunIdent))
} }
} }
} else { } else {