Skip to content

Conversation

@asgerf
Copy link
Contributor

@asgerf asgerf commented Apr 12, 2021

Diagnostic queries for showing files that were extracted and files with extraction errors, based on those from C++.

In general it's possible for a file to be partially extracted, e.g. an HTML file with an event attribute we couldn't parse, or a JS file with an invalid regexp literal. However, the format of the SuccessfullyExtractedFiles.ql query requires us to make a binary decision for each file and say whether it was successful or not. So we're classifying errors as "fatal" based on a how likely it is that the main parts of the enclosing file couldn't be extracted.

cc @adityasharad

@asgerf asgerf added the JS label Apr 12, 2021
@asgerf asgerf requested a review from a team as a code owner April 12, 2021 13:42
@asgerf asgerf added the no-change-note-required This PR does not need a change note label Apr 12, 2021
esbena
esbena previously approved these changes Apr 12, 2021
erik-krogh
erik-krogh previously approved these changes Apr 12, 2021
Copy link
Contributor

@erik-krogh erik-krogh left a comment

Choose a reason for hiding this comment

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

I think it would be nice to have tests for these new queries.
But if you don't think so, that's also fine with me.

Otherwise LGTM.

@asgerf asgerf dismissed stale reviews from erik-krogh and esbena via d2fad18 April 12, 2021 14:07
Copy link
Collaborator

@adityasharad adityasharad left a comment

Choose a reason for hiding this comment

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

Looks good!
Toolchain support for the new kind is underway in the coming weeks (cc @henrymercer). If you'd like to merge this PR before that's ready, then you may wish to turn off the fail-on-warnings mode for your language tests.

RasmusWL added a commit to RasmusWL/codeql that referenced this pull request Apr 23, 2021
This is basically just a port of the C++/JS queries added in:

- github#5414 (C++)
- github#5656 (JS)

SyntaxError should capture all errors we have information about. At least in
`python/ql/src/semmlecode.python.dbscheme` the only match for `error` is
`py_syntax_error_versioned` (which `SyntaxError` is based on).
RasmusWL added a commit to RasmusWL/codeql that referenced this pull request Apr 23, 2021
This is basically just a port of the C++/JS queries added in:

- github#5414 (C++)
- github#5656 (JS)

SyntaxError should capture all errors we have information about. At least in
`python/ql/src/semmlecode.python.dbscheme` the only match for `error` is
`py_syntax_error_versioned` (which `SyntaxError` is based on).
@RasmusWL
Copy link
Member

Internal tools have been updated to allow using @kind diagnostic now (and after rerunning tests, all is green) so based on all those approving reviews, I'm going to merge this PR 😉

@RasmusWL RasmusWL merged commit af0723c into github:main Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

JS no-change-note-required This PR does not need a change note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants