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

SLVS-1598 Use getEffectiveIssueDetails for issues with SLCore id instead of getEffectiveRuleDetails #5830

Conversation

gabriela-trutan-sonarsource
Copy link
Contributor

@gabriela-trutan-sonarsource gabriela-trutan-sonarsource commented Nov 13, 2024

@hashicorp-vault-sonar-prod hashicorp-vault-sonar-prod bot changed the title Gt/use get effective issue details SLVS-1624 Gt/use get effective issue details Nov 13, 2024
@gabriela-trutan-sonarsource gabriela-trutan-sonarsource changed the title SLVS-1624 Gt/use get effective issue details SLVS-1624 Use getEffectiveIssueDetails for issues with SLCore id instead of getEffectiveRuleDetails Nov 13, 2024
@gabriela-trutan-sonarsource gabriela-trutan-sonarsource changed the title SLVS-1624 Use getEffectiveIssueDetails for issues with SLCore id instead of getEffectiveRuleDetails SLVS-1598 Use getEffectiveIssueDetails for issues with SLCore id instead of getEffectiveRuleDetails Nov 13, 2024
Copy link
Contributor

Choose a reason for hiding this comment

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

Some design comments, the logic looks fine

src/Infrastructure.VS/ErrorListHelper.cs Show resolved Hide resolved
src/Education/Rule/SLCoreRuleMetaDataProvider.cs Outdated Show resolved Hide resolved
src/Education/Rule/SLCoreRuleMetaDataProvider.cs Outdated Show resolved Hide resolved
src/Education/Rule/SLCoreRuleMetaDataProvider.cs Outdated Show resolved Hide resolved
src/Education/ErrorList/SonarErrorListEventProcessor.cs Outdated Show resolved Hide resolved
@@ -36,8 +34,7 @@ public record EffectiveRuleDetailsDto(
VulnerabilityProbability? vulnerabilityProbability,
[property: JsonConverter(typeof(EitherJsonConverter<RuleMonolithicDescriptionDto, RuleSplitDescriptionDto>))]
Either<RuleMonolithicDescriptionDto, RuleSplitDescriptionDto> description,
List<EffectiveRuleParamDto> @params);
[JsonProperty("params")] List<EffectiveRuleParamDto> parameters) : IRuleDetails;

Choose a reason for hiding this comment

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

not sure if this looks better

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is needed for the implemenation of the IRuleDetails.
The EffectiveIssueDetailsDto and EffectiveRuleDetailsDto are very similar, which is why this interface was introduced.
This also prevents code duplication of converting 99% similar Dtos to RuleInfo in the SLCoreRuleMetaDataProvider

Additionally, it is the same in the EffectiveIssueDetailsDto. I just made them consistent now

src/Education/Rule/SLCoreRuleMetaDataProvider.cs Outdated Show resolved Hide resolved
src/Education/Education.cs Outdated Show resolved Hide resolved
src/Core/Suppressions/FilterableRoslynIssue.cs Outdated Show resolved Hide resolved
Copy link

sonarqubecloud bot commented Nov 14, 2024

@gabriela-trutan-sonarsource gabriela-trutan-sonarsource merged commit 1fad501 into feature/severity-modes Nov 14, 2024
2 checks passed
@gabriela-trutan-sonarsource gabriela-trutan-sonarsource deleted the gt/use-get-effective-issue-details branch November 14, 2024 11:09
vnaskos-sonar pushed a commit that referenced this pull request Nov 18, 2024
georgii-borovinskikh-sonarsource pushed a commit that referenced this pull request Nov 20, 2024
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.

2 participants