-
Notifications
You must be signed in to change notification settings - Fork 53
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
SLCORE-999 Store custom impacts when synchronizing rules #1141
SLCORE-999 Store custom impacts when synchronizing rules #1141
Conversation
ec233e2
to
1294390
Compare
backend/core/src/main/java/org/sonarsource/sonarlint/core/analysis/AnalysisService.java
Show resolved
Hide resolved
backend/core/src/main/java/org/sonarsource/sonarlint/core/analysis/AnalysisService.java
Show resolved
Hide resolved
backend/core/src/main/java/org/sonarsource/sonarlint/core/rules/RulesService.java
Show resolved
Hide resolved
backend/core/src/main/java/org/sonarsource/sonarlint/core/rules/RulesService.java
Show resolved
Hide resolved
return new ServerActiveRule(ruleOrTemplateDefinition.get().getKey(), possiblyDeprecatedActiveRuleFromStorage.getSeverity(), | ||
possiblyDeprecatedActiveRuleFromStorage.getParams(), | ||
null, Collections.emptyList()); | ||
null, possiblyDeprecatedActiveRuleFromStorage.getOverriddenImpacts()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is very similar to the one in AnalysisService, maybe there is a way to keep only one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about making it static on RuleService and using it on AnalysisService?
1294390
to
fc21718
Compare
282bd48
to
9de7393
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some improvement ideas, but overall LGTM
backend/core/src/main/java/org/sonarsource/sonarlint/core/rules/RuleDetails.java
Outdated
Show resolved
Hide resolved
@@ -147,11 +149,25 @@ public static RuleDetails merging(ServerActiveRule activeRuleFromStorage, Server | |||
serverRule.getSeverity(), | |||
templateRuleDefFromPlugin.getType(), | |||
cleanCodeAttribute, | |||
defaultImpacts, | |||
mergeImpacts(defaultImpacts, activeRuleFromStorage.getOverriddenImpacts()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed that ServerActiveRule.getOverridenImpacts()
returns a List<ImpactPayload>
. This is strange since ImpactPayload
comes from org.sonarsource.sonarlint.core.serverapi.push.parsing.common
, which is related to the payload of server events. We should maybe have a separate type for the storage. Maybe an improvement for later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it can be improvement for later. Created this ticket to track: https://sonarsource.atlassian.net/browse/SLCORE-1021
backend/core/src/test/java/org/sonarsource/sonarlint/core/rules/RulesServiceTests.java
Outdated
Show resolved
Hide resolved
9de7393
to
576c7a1
Compare
Quality Gate passedIssues Measures |
1bf8dcf
into
mmf/SLCORE-959-custom-severities
SLCORE-999