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

report semgrep findings and fix findings assertions #739

Merged
merged 4 commits into from
Jul 26, 2024
Merged

Conversation

clavedeluna
Copy link
Contributor

@clavedeluna clavedeluna commented Jul 24, 2024

I initially thought asserting findings is not None was sufficient, but in cases when the result of matching findings is [] we also want to be aware.

I updated some codemods where it was easy to do the matching, but created #738 for that codemod

This fix also brought to light that we weren't reporting semgrep findings so fixed that too

@clavedeluna clavedeluna marked this pull request as draft July 24, 2024 12:55
@clavedeluna clavedeluna changed the title fix findings assertions report semgrep findings and fix findings assertions Jul 24, 2024
@clavedeluna clavedeluna marked this pull request as ready for review July 24, 2024 14:23
rule=Rule(
id=rule_id,
name=rule_id,
url=semgrep_url_from_id(rule_id),
Copy link
Member

Choose a reason for hiding this comment

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

This is specific to Semgrep but it looks like this is being added to a more general SarifResult class?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah do you think this is wrong? while it's a generic sarif result, wouldn't all sarif results have to have findings too?

Copy link
Member

Choose a reason for hiding this comment

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

My concern is specifically about the call to semgrep_url_from_id, which only applies to Semgrep results, whereas this class appears to be used for multiple SARIF-based tools.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

wooops Im an idiot, of course! Good review Dan, will update

Copy link

Quality Gate Passed Quality Gate passed

Issues
4 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@clavedeluna clavedeluna added this pull request to the merge queue Jul 26, 2024
Merged via the queue into main with commit f87ed83 Jul 26, 2024
13 checks passed
@clavedeluna clavedeluna deleted the fix-changes branch July 26, 2024 11:12
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.

3 participants