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

Add effective severities custom property array to error log #68892

Merged
merged 11 commits into from
Sep 27, 2023

Conversation

mavasani
Copy link
Contributor

@mavasani mavasani commented Jul 6, 2023

Closes #67365

Add a new custom property array named effectiveConfigurationLevels to the rule section in sarif v2 error log output. Add a new invocations section with ruleConfigurationOverrides array, with an entry each for every rule ID severity override configured via options (command line options, editorconfig, globalconfig, rulesets, etc.) for a part or whole of the compilation. See #67365 (comment) for further details

Sample error log with this change: errorlog.log

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Jul 6, 2023
@mavasani mavasani force-pushed the SarifEffectiveSeverities branch from b606d46 to cd75ba2 Compare July 18, 2023 05:34
@MattKotsenas
Copy link
Member

When parsing the example log with the Sarif SDK, I get the following error:

Newtonsoft.Json.JsonSerializationException: Required property 'executionSuccessful' not found in JSON. Path 'runs[0].invocations[0]'

It looks like when adding the invocation node, Roslyn also needs to add an executionSuccessful property (see Static Analysis Results Interchange Format (SARIF) Version 2.1.0 (oasis-open.org)).

@mavasani mavasani marked this pull request as ready for review September 2, 2023 10:04
@mavasani mavasani requested a review from a team as a code owner September 2, 2023 10:04
@mavasani
Copy link
Contributor Author

mavasani commented Sep 4, 2023

@dotnet/roslyn-compiler for reviews, thanks!

@mavasani
Copy link
Contributor Author

Ping @dotnet/roslyn-compiler for reviews

@mavasani
Copy link
Contributor Author

@jjonescz addressed feedback, kindly take another look. Thanks!

@mavasani
Copy link
Contributor Author

Thanks @jjonescz!

@dotnet/roslyn-compiler for second review

@jaredpar jaredpar added this to the 17.8 milestone Sep 25, 2023
@RikkiGibson
Copy link
Contributor

PR will need to be rebased to merge to 17.8

mavasani and others added 9 commits September 27, 2023 10:31
Closes dotnet#67365

Add a new custom property array named `effectiveConfigurationLevels` to the `rule` section in sarif v2 error log output. If the severity of any analyzer diagnostic ID was configured via options (command line options, editorconfig, globalconfig, rulesets, etc.) for a part or whole of the compilation, we emit this array of effective severities.
Co-authored-by: Jan Jones <jan.jones.cz@gmail.com>
mavasani and others added 2 commits September 27, 2023 10:31
Co-authored-by: Rikki Gibson <rikkigibson@gmail.com>
@mavasani mavasani force-pushed the SarifEffectiveSeverities branch from 883deba to ed2a2d0 Compare September 27, 2023 05:01
@mavasani mavasani requested a review from a team as a code owner September 27, 2023 05:01
@mavasani mavasani changed the base branch from main to release/dev17.8 September 27, 2023 05:01
@mavasani
Copy link
Contributor Author

PR will need to be rebased to merge to 17.8

Thanks, done.

@mavasani mavasani enabled auto-merge September 27, 2023 06:24
@mavasani mavasani merged commit a6a333a into dotnet:release/dev17.8 Sep 27, 2023
@mavasani mavasani deleted the SarifEffectiveSeverities branch September 27, 2023 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Analyzers Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: Add "effective" severity for rules in SARIF v2 logs
6 participants