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

Partitioning is not partitioning the artifacts #2385

Closed
eddynaka opened this issue Sep 21, 2021 · 2 comments · Fixed by #2391
Closed

Partitioning is not partitioning the artifacts #2385

eddynaka opened this issue Sep 21, 2021 · 2 comments · Fixed by #2391

Comments

@eddynaka
Copy link
Collaborator

Below is one example
rust.zip

If you partition by rule, each sarif will have 1 rule with 1 result but 2 artifacts.

The ideal SARIF would have 1 rule, 1 result, and 1 artifact each.

@yongyan-gh @harleenkohli @michaelcfanning

@yongyan-gh
Copy link
Collaborator

The issue occurs when creating vsts work item, after partitioned by PerRun splitting strategy, the partitioned sarif log has 1 result, but have 7 artifacts, and description points to a wrong artifact:
This work item contains 1 'semmle' issue(s) detected in src/DeploymentLibrary/Common/RobocopyUtility.cs (+7 locations).

There are 2 issues:

  1. all the artifacts are assigned indexes, so they are considered as global artifacts (mentioned out side of any result), and they will be added to partitioned log even they are not mentioned by any result.
    see comments here:

    // Construct a mapping from the indices in the original run to the indices
    // in the partition run. This includes both the indices relevant to the
    // results in this partition, and indices that appear in all partitions
    // because they are mentioned outside of any result (we refer to these as
    // "global" indices).

  2. The result has mentioned couple other artifacts in codeFlows/relatedLocations sections.
    e.g total 7 artifacts, 1 is the result's artifacts (src/OneboxWorker/OneboxWorker.cs), and other 4 are mentioned by the result's codeFlows/relatedLocations sections. In this case, should we keep 5 artifacts or just 1? Now the work item description uses first artifact as detected target it may be an artifact in codeflow, not the real target has issue.

This work item contains 1 'semmle' issue(s) detected in src/DeploymentLibrary/Common/RobocopyUtility.cs (+7 locations)

The RobocopyUtility.cs is not the result's artifact in this case

@eddynaka
Copy link
Collaborator Author

eddynaka commented Oct 4, 2021

@yongyan-gh ,

we could:

  1. count the number of results: this would fix the number of artifacts vs. number of results
  2. review the path as you mentioned: this would fix the path.

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 a pull request may close this issue.

2 participants