Skip to content

Conversation

@Daverlo
Copy link
Contributor

@Daverlo Daverlo commented Oct 22, 2020

In analyze:runQueries we are warding the codeql call with a try, and if we catch something we set an error message, update the status report with the failed language and returning it. Just after that in runAnalyze we are always doing the upload without considering if the runQueries failed or not. This caused that we were uploading partial results, and that doesn't make sense. Partial results would mean that alerts could disappear without being fixed.

The reason why the action is not marked as failed is because this is only done at the topmost catch, in analyze-action, and we are not bubbling up the exception, just catching it and setting the status report.

As we want to keep the status report, I've created an Error subclass where we can attach it and submit it as a failed status report.

Here is a run with the old behaviour: https://github.com/dsp-testing/daverlo-test-fail-analyze/actions/runs/321647298
The job is green but it has an error saying the analysis failed.

Here is the same repo but it run with this branch: https://github.com/dsp-testing/daverlo-test-fail-analyze/actions/runs/321654493

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.

Copy link
Contributor

@robertbrignull robertbrignull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks for including the link to the test run.

@Daverlo Daverlo merged commit badb286 into main Oct 22, 2020
@Daverlo Daverlo deleted the daverlo/fail-analyze branch October 22, 2020 10:28
This was referenced Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants