Merge pull request #1007 from github/wait-for-processing-2
Re-enable waiting for processing by default, using the new API semantics.
This commit is contained in:
commit
c5c5bdabb9
6 changed files with 13 additions and 26 deletions
|
|
@ -3,6 +3,7 @@
|
||||||
## [UNRELEASED]
|
## [UNRELEASED]
|
||||||
|
|
||||||
- Add `working-directory` input to the `autobuild` action. [#1024](https://github.com/github/codeql-action/pull/1024)
|
- Add `working-directory` input to the `autobuild` action. [#1024](https://github.com/github/codeql-action/pull/1024)
|
||||||
|
- The `analyze` and `upload-sarif` actions will now wait up to 2 minutes for processing to complete after they have uploaded the results so they can report any processing errors that occurred. This behavior can be disabled by setting the `wait-for-processing` action input to `"false"`. [#1007](https://github.com/github/codeql-action/pull/1007)
|
||||||
|
|
||||||
## 2.1.8 - 08 Apr 2022
|
## 2.1.8 - 08 Apr 2022
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ inputs:
|
||||||
wait-for-processing:
|
wait-for-processing:
|
||||||
description: If true, the Action will wait for the uploaded SARIF to be processed before completing.
|
description: If true, the Action will wait for the uploaded SARIF to be processed before completing.
|
||||||
required: true
|
required: true
|
||||||
default: "false"
|
default: "true"
|
||||||
token:
|
token:
|
||||||
default: ${{ github.token }}
|
default: ${{ github.token }}
|
||||||
matrix:
|
matrix:
|
||||||
|
|
|
||||||
16
lib/upload-lib.js
generated
16
lib/upload-lib.js
generated
|
|
@ -322,23 +322,15 @@ async function waitForProcessing(repositoryNwo, sarifID, apiDetails, logger) {
|
||||||
if (status === "complete") {
|
if (status === "complete") {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
else if (status === "pending") {
|
||||||
|
logger.debug("Analysis processing is still pending...");
|
||||||
|
}
|
||||||
else if (status === "failed") {
|
else if (status === "failed") {
|
||||||
throw new Error(`Code Scanning could not process the submitted SARIF file:\n${response.data.errors}`);
|
throw new Error(`Code Scanning could not process the submitted SARIF file:\n${response.data.errors}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
if (util.isHTTPError(e)) {
|
logger.warning(`An error occurred checking the status of the delivery. ${e} It should still be processed in the background, but errors that occur during processing may not be reported.`);
|
||||||
switch (e.status) {
|
|
||||||
case 404:
|
|
||||||
logger.debug("Analysis is not found yet...");
|
|
||||||
break; // Note this breaks from the case statement, not the outer loop.
|
|
||||||
default:
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
await util.delay(STATUS_CHECK_FREQUENCY_MILLISECONDS);
|
await util.delay(STATUS_CHECK_FREQUENCY_MILLISECONDS);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -485,23 +485,17 @@ export async function waitForProcessing(
|
||||||
logger.info(`Analysis upload status is ${status}.`);
|
logger.info(`Analysis upload status is ${status}.`);
|
||||||
if (status === "complete") {
|
if (status === "complete") {
|
||||||
break;
|
break;
|
||||||
|
} else if (status === "pending") {
|
||||||
|
logger.debug("Analysis processing is still pending...");
|
||||||
} else if (status === "failed") {
|
} else if (status === "failed") {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Code Scanning could not process the submitted SARIF file:\n${response.data.errors}`
|
`Code Scanning could not process the submitted SARIF file:\n${response.data.errors}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (util.isHTTPError(e)) {
|
logger.warning(
|
||||||
switch (e.status) {
|
`An error occurred checking the status of the delivery. ${e} It should still be processed in the background, but errors that occur during processing may not be reported.`
|
||||||
case 404:
|
);
|
||||||
logger.debug("Analysis is not found yet...");
|
|
||||||
break; // Note this breaks from the case statement, not the outer loop.
|
|
||||||
default:
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
await util.delay(STATUS_CHECK_FREQUENCY_MILLISECONDS);
|
await util.delay(STATUS_CHECK_FREQUENCY_MILLISECONDS);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ inputs:
|
||||||
wait-for-processing:
|
wait-for-processing:
|
||||||
description: If true, the Action will wait for the uploaded SARIF to be processed before completing.
|
description: If true, the Action will wait for the uploaded SARIF to be processed before completing.
|
||||||
required: true
|
required: true
|
||||||
default: "false"
|
default: "true"
|
||||||
outputs:
|
outputs:
|
||||||
sarif-id:
|
sarif-id:
|
||||||
description: The ID of the uploaded SARIF file.
|
description: The ID of the uploaded SARIF file.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue