FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

More readable error message for invalid `queries` block and invalid `query-filters` block by aeisenberg · Pull Request #1208 · github/codeql-action · GitHub

More readable error message for invalid queries block and invalid query-filters block - #1208

Merged
aeisenberg merged 5 commits into
mainfrom
aeisenberg/better-error-message
Aug 23, 2022
Merged

aeisenberg merged 5 commits into
mainfrom
aeisenberg/better-error-message

Conversation

Copy link
Copy Markdown
Contributor

Query-filters block:

Throws a more coherent error message when the query-filters block is not an array.

Queries block:

When someone creates an invalid queries entry in the codeql config
file, like this:

queries:
  - foo.ql

The error message is confusing, looking like this:

  Error: Cannot use 'in' operator to search for 'uses' in ql/ql/src
  TypeError: Cannot use 'in' operator to search for 'uses' in ql/ql/src
      at loadConfig (/home/runner/work/_actions/github/codeql-action/71a8b35ff4c80fcfcd05bc1cd932fe3c08f943ca/lib/config-utils.js:577:41)

With this change, the error message is more comprehensible:

queries must be an array, with each entry having a 'uses' property

Merge / deployment checklist

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

When someone creates an invalid `queries` entry in the codeql config
file, like this:

```
queries:
  - foo.ql
```

THe error message is confusing, looking like this:

```
  Error: Cannot use 'in' operator to search for 'uses' in ql/ql/src
  TypeError: Cannot use 'in' operator to search for 'uses' in ql/ql/src
      at loadConfig (/home/runner/work/_actions/github/codeql-action/71a8b35ff4c80fcfcd05bc1cd932fe3c08f943ca/lib/config-utils.js:577:41)
```

With this change, the error message is more comprehensible:

`queries must be an array, with each entry having a 'uses' property`
Handle other cases where the config is invalid.
aeisenberg requested a review from a team as a code owner August 23, 2022 16:28

henrymercer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

Comment thread CHANGELOG.md Outdated
Co-authored-by: Henry Mercer <henrymercer@github.com>
aeisenberg enabled auto-merge August 23, 2022 17:06
aeisenberg merged commit 1cd5043 into main Aug 23, 2022
aeisenberg deleted the aeisenberg/better-error-message branch August 23, 2022 18:29
github-actions Bot mentioned this pull request Aug 25, 2022
6 tasks
aeisenberg changed the title More readable error message for invalid queries block and invalid query-filters blocl More readable error message for invalid queries block and invalid query-filters block Aug 26, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

2 participants


Back | FazBrowse Home | New Git URL