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,18 +6767,22 @@ function fetchCheckSuiteId(runId) {
.catch((e) => {
throw `Unable to fetch Workflow Run: ${e}`;
});
if (currentRun.status === `in_progress`) {
// 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;
// The following SHOULD work, but alas
// currentCheckSuiteId = currentRun.check_suite_id
if (currentCheckSuiteId <= 0) {
throw `Error extracting Check Suite ID from: ${currentRun.check_suite_url}`;
}
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`
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
// currentCheckSuiteId = currentRun.check_suite_id
if (currentCheckSuiteId <= 0) {
throw `Error extracting Check Suite ID from: ${currentRun.check_suite_url}`;
}
}
catch (e) {
core.info(`::error::Error Fetching Current Run: ${e}`);
core.info(`::error::Error Fetching Current Run (${runId}): ${e}`);
}
}
return currentCheckSuiteId;
@ -6890,7 +6894,6 @@ function resolveCheckRunId(checkRunIdent) {
}
catch (e) {
core.info(`::error::Unable to resolve Check Run ID: ${e}`);
core.info(`checkRunIdent = ` + util_1.inspect(checkRunIdent));
}
}
}

23
dist/pre/index.js vendored
View file

@ -6767,18 +6767,22 @@ function fetchCheckSuiteId(runId) {
.catch((e) => {
throw `Unable to fetch Workflow Run: ${e}`;
});
if (currentRun.status === `in_progress`) {
// 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;
// The following SHOULD work, but alas
// currentCheckSuiteId = currentRun.check_suite_id
if (currentCheckSuiteId <= 0) {
throw `Error extracting Check Suite ID from: ${currentRun.check_suite_url}`;
}
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`
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
// currentCheckSuiteId = currentRun.check_suite_id
if (currentCheckSuiteId <= 0) {
throw `Error extracting Check Suite ID from: ${currentRun.check_suite_url}`;
}
}
catch (e) {
core.info(`::error::Error Fetching Current Run: ${e}`);
core.info(`::error::Error Fetching Current Run (${runId}): ${e}`);
}
}
return currentCheckSuiteId;
@ -6890,7 +6894,6 @@ function resolveCheckRunId(checkRunIdent) {
}
catch (e) {
core.info(`::error::Unable to resolve Check Run ID: ${e}`);
core.info(`checkRunIdent = ` + util_1.inspect(checkRunIdent));
}
}
}

23
dist/run/index.js vendored
View file

@ -6777,18 +6777,22 @@ function fetchCheckSuiteId(runId) {
.catch((e) => {
throw `Unable to fetch Workflow Run: ${e}`;
});
if (currentRun.status === `in_progress`) {
// 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;
// The following SHOULD work, but alas
// currentCheckSuiteId = currentRun.check_suite_id
if (currentCheckSuiteId <= 0) {
throw `Error extracting Check Suite ID from: ${currentRun.check_suite_url}`;
}
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`
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
// currentCheckSuiteId = currentRun.check_suite_id
if (currentCheckSuiteId <= 0) {
throw `Error extracting Check Suite ID from: ${currentRun.check_suite_url}`;
}
}
catch (e) {
core.info(`::error::Error Fetching Current Run: ${e}`);
core.info(`::error::Error Fetching Current Run (${runId}): ${e}`);
}
}
return currentCheckSuiteId;
@ -6900,7 +6904,6 @@ function resolveCheckRunId(checkRunIdent) {
}
catch (e) {
core.info(`::error::Unable to resolve Check Run ID: ${e}`);
core.info(`checkRunIdent = ` + util_1.inspect(checkRunIdent));
}
}
}

View file

@ -117,17 +117,23 @@ async function fetchCheckSuiteId(runId: number): Promise<number> {
throw `Unable to fetch Workflow Run: ${e}`
})
if (currentRun.status === `in_progress`) {
// 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
// The following SHOULD work, but alas
// currentCheckSuiteId = currentRun.check_suite_id
if (currentCheckSuiteId <= 0) {
throw `Error extracting Check Suite ID from: ${currentRun.check_suite_url}`
}
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`
currentCheckSuiteId = parseInt(currentRun.check_suite_url.substr(1 + currentRun.check_suite_url.lastIndexOf(`/`))) ?? -1
// The following SHOULD work, but alas
// currentCheckSuiteId = currentRun.check_suite_id
if (currentCheckSuiteId <= 0) {
throw `Error extracting Check Suite ID from: ${currentRun.check_suite_url}`
}
} catch (e) {
core.info(`::error::Error Fetching Current Run: ${e}`)
core.info(`::error::Error Fetching Current Run (${runId}): ${e}`)
}
}
return currentCheckSuiteId
@ -260,7 +266,6 @@ async function resolveCheckRunId(checkRunIdent: CheckRunIdent): Promise<number>
}
} catch (e) {
core.info(`::error::Unable to resolve Check Run ID: ${e}`)
core.info(`checkRunIdent = ` + inspect(checkRunIdent))
}
}
} else {