Skip to content

Fix large sarif handling #1004

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Nov 22, 2021

Conversation

marcnjaramillo
Copy link
Contributor

@marcnjaramillo marcnjaramillo commented Nov 15, 2021

Replace this with a description of the changes your pull request makes.

Checklist

  • CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • Issues have been created for any UI or other user-facing changes made by this pull request.
  • @github/docs-content-codeql has been cc'd in all issues for UI or other user-facing changes made by this pull request.

@marcnjaramillo marcnjaramillo requested a review from a team as a code owner November 15, 2021 22:45
@marcnjaramillo marcnjaramillo force-pushed the fix-large-sarif-handling branch from 0c07819 to 59682d4 Compare November 15, 2021 23:20
@aeisenberg aeisenberg linked an issue Nov 16, 2021 that may be closed by this pull request
6 tasks
Copy link
Contributor

@aeisenberg aeisenberg left a comment

Choose a reason for hiding this comment

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

This is looking great. A few comments to clean things up. Since this is new behaviour, I'd like to see some unit tests for this. We can chat tomorrow about this.

@aeisenberg
Copy link
Contributor

aeisenberg commented Nov 16, 2021

I think the test failures are because you are using an older version of npm. Could you try upgrading to version 8? And then try re-running npm install.

@aeisenberg
Copy link
Contributor

Actually, try rebasing on this PR #1003

The problem is that for some reason, fsevents is not marked as optional.


it('should throw an error if the file fails to parse', async () => {
const result = await CodeQLCliServer.parseSarif(__dirname + '/data/sarif/invalidSarif.sarif');
await expect(result).to.rejectedWith(/Error: Parsing output of interpretation failed: /);
Copy link
Contributor

Choose a reason for hiding this comment

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

Semantics are the same, but reads a little nicer.

Suggested change
await expect(result).to.rejectedWith(/Error: Parsing output of interpretation failed: /);
await expect(result).to.be.rejectedWith(/Error: Parsing output of interpretation failed: /);

describe.only('cliServerTests', () => {
it('should parse a valid SARIF file', async () => {
const result = await CodeQLCliServer.parseSarif(__dirname + '/data/sarif/validSarif.sarif');
expect(result.runs.length).to.eq(1);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you want a different expectation here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated this. Hopefully it's a better test.

@marcnjaramillo marcnjaramillo force-pushed the fix-large-sarif-handling branch from 9369f77 to fe40ebf Compare November 18, 2021 00:20
@marcnjaramillo marcnjaramillo force-pushed the fix-large-sarif-handling branch from fe40ebf to ca5e5e2 Compare November 18, 2021 00:39
Copy link
Contributor

@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.

This looks promising! Some suggestions on organisation.

Copy link
Contributor

@aeisenberg aeisenberg left a comment

Choose a reason for hiding this comment

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

Nice work!

@aeisenberg aeisenberg merged commit 16c0bea into github:main Nov 22, 2021
asfgit pushed a commit to apache/ofbiz-framework that referenced this pull request Nov 23, 2021
asfgit pushed a commit to apache/ofbiz-framework that referenced this pull request Nov 23, 2021
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.

Handle large (>4GB) SARIF results files
3 participants