Skip to content
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

Fix location Uri and number of artifact in work item description #2391

Merged
merged 4 commits into from
Oct 6, 2021

Conversation

yongyan-gh
Copy link
Collaborator

@yongyan-gh yongyan-gh commented Oct 4, 2021

Fixes #2385

Existing code calculate total artifacts using global artifacts, which includes all artifacts if referenced by result's codeFlows/relatedLocations, and pick first artifact uri in description, which may not be the result's location uri.

The change is only calculate artifacts based on results.

@lgtm-com
Copy link

lgtm-com bot commented Oct 4, 2021

This pull request introduces 2 alerts when merging 713df2d into b262841 - view on LGTM.com

new alerts:

  • 2 for Dereferenced variable may be null

@yongyan-gh yongyan-gh marked this pull request as ready for review October 4, 2021 22:38
Copy link
Collaborator

@shaopeng-gh shaopeng-gh left a comment

Choose a reason for hiding this comment

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

:shipit:

@yongyan-gh
Copy link
Collaborator Author

This is for #2385

}

[Fact]
public void SarifWorkItemExtensions_CreateWorkItemDescription_SingleResultWithMultipleArtifacts()
Copy link
Collaborator

Choose a reason for hiding this comment

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

SarifWorkItemExtensions_CreateWorkItemDescription_SingleResultWithMultipleArtifacts

Let's also create two more tests:

  1. multiple results and count the number of issues
  2. one result with multiple locations

@eddynaka eddynaka enabled auto-merge (squash) October 6, 2021 01:31
@eddynaka eddynaka merged commit d31bc91 into main Oct 6, 2021
@eddynaka eddynaka deleted the users/yongyan-gh/optimizeArtifacts branch October 6, 2021 01:39
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.

Partitioning is not partitioning the artifacts
3 participants