GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — More readable error message for invalid `queries` block and invalid `query-filters` block by aeisenberg · Pull Request #1208 · github/codeql-action

Conversation

@aeisenberg

@aeisenberg aeisenberg commented Aug 23, 2022

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
aeisenberg added 2 commits August 15, 2022 07:56
@aeisenberg
More readable error message for invalid queries block
fba13b0
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`
@aeisenberg
Better error messages for invalid queries and query filters blocks
5861352
Handle other cases where the config is invalid.
@aeisenberg
aeisenberg requested a review from a team as a code owner August 23, 2022 16:28
aeisenberg added 2 commits August 23, 2022 09:29
@aeisenberg
Merge remote-tracking branch 'upstream/main' into aeisenberg/better-e…
ac92a02
…rror-message
@aeisenberg
Update changelog
9af066e
henrymercer
henrymercer approved these changes Aug 23, 2022
View reviewed changes

@henrymercer henrymercer left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread CHANGELOG.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@aeisenberg @henrymercer
Update CHANGELOG.md
e379edd
Co-authored-by: Henry Mercer <[email protected]>
@aeisenberg
aeisenberg enabled auto-merge August 23, 2022 17:06
@aeisenberg
aeisenberg merged commit 1cd5043 into main Aug 23, 2022
@aeisenberg
aeisenberg deleted the aeisenberg/better-error-message branch August 23, 2022 18:29
@github-actions github-actions Bot mentioned this pull request Aug 25, 2022
Merge main into releases/v2 #1212
Merged
4 of 6 tasks
@henrymercer henrymercer mentioned this pull request Aug 25, 2022
Merge releases/v2 into releases/v1 #1214
Merged
4 tasks done
@aeisenberg 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
@aliscco aliscco mentioned this pull request Jun 22, 2023
[Snyk] Fix for 1 vulnerabilities aliscco/codeql-action#613
Open
This was referenced Dec 1, 2023
[Snyk] Fix for 1 vulnerabilities aliscco/codeql-action#1115
Open
[Snyk] Fix for 1 vulnerabilities aliscco/codeql-action#1207
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@henrymercer henrymercer henrymercer approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@aeisenberg @henrymercer
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.