github / codeql-coding-standards

This repository contains CodeQL queries and libraries which support various Coding Standards.
MIT License
121 stars 55 forks source link

Ensure a failed CodeQL compilation causes the test check status to fail #712

Closed lcartey closed 14 hours ago

lcartey commented 1 week ago

Description

PR #690 was merged last week despite having CodeQL compilation issues. This PR ensures the Validate test results job reports failure in the case that a dependent matrix job fails to execute (e.g. due to a CodeQL compilation error). Previously it reported "skipped", which was sufficient for the status check on the PR to pass and to allow it to be merged.

This is achieved by ensuring the Validate test results job is always run, and then checking if the run-test-suites job failed to complete, and aborting early if it did.

To test that the new approach works, I introduced a compilation failure in commit https://github.com/github/codeql-coding-standards/pull/712/commits/1651c1f30dda8df6f2e8553174b7e89fa1087886. This actions job shows the new approach correctly

Change request type

Rules with added or modified queries

Release change checklist

A change note (development_handbook.md#change-notes) is required for any pull request which modifies:

If you are only adding new rule queries, a change note is not required.

Author: Is a change note required?

🚨🚨🚨 Reviewer: Confirm that format of shared queries (not the .qll file, the .ql file that imports it) is valid by running them within VS Code.

Reviewer: Confirm that either a change note is not required or the change note is required and has been added.

Query development review checklist

For PRs that add new queries or modify existing queries, the following checklist should be completed by both the author and reviewer:

Author

Reviewer