-
Notifications
You must be signed in to change notification settings - Fork 77
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-1853 Refactor the RoslynSettingsFileSynchronizer to not use ServerIssueStore #6029
SLVS-1853 Refactor the RoslynSettingsFileSynchronizer to not use ServerIssueStore #6029
Conversation
The ServerIssuesStore will be dropped, so instead an event should be raised.
When an issue is resolved on the server, it means it is suppressed. And when isResolved=false, it means the issue is reopened (a.k.a. suppression has to be removed)
… easier to identify when they are resolved. When an issue is resolved, we receive from the server a list of issueKeys, which makes it difficult to retrieve the corresponding SonarQubeIssue in the RoslynSuppressionUpdater due to the fact that the GetSuppressedIssuesAsync will not return the issue if it is not suppressed (it is resolved) Additionally there is no need to perform yet another server request if we already have the information about the issue Key so we could simply cache it.
src/Roslyn.Suppressions/Roslyn.Suppressions/InProcess/RoslynSettingsFileSynchronizer.cs
Outdated
Show resolved
Hide resolved
src/Roslyn.Suppressions/Roslyn.Suppressions/InProcess/RoslynSettingsFileSynchronizer.cs
Outdated
Show resolved
Hide resolved
src/Roslyn.Suppressions/Roslyn.Suppressions/InProcess/RoslynSettingsFileSynchronizer.cs
Outdated
Show resolved
Hide resolved
src/Roslyn.Suppressions/Roslyn.Suppressions/InProcess/RoslynSettingsFileSynchronizer.cs
Outdated
Show resolved
Hide resolved
…urce/sonarlint-visualstudio into gt/roslyn-settings-file-sync
…sFileStorage" This reverts commit f9c2467.
…erface and use factory for instantiating corresponding type.
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 comments about code organization
src/Roslyn.Suppressions/Roslyn.Suppressions/InProcess/RoslynSettingsFileSynchronizer.cs
Outdated
Show resolved
Hide resolved
src/Roslyn.Suppressions/Roslyn.Suppressions/InProcess/RoslynSettingsFileSynchronizer.cs
Outdated
Show resolved
Hide resolved
IEnumerable<SuppressedIssue> GetSuppressedIssuesOrNull(string roslynSettingsKey); | ||
} | ||
|
||
internal interface ISuppressedIssuesCalculatorFactory |
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.
You don't need to change this now, it's good enough, but I thought of a cleaner (IMO) alternative:
interface ISuppressedIssuesCalculator<T>
{
IEnumerable<SuppressedIssue> GetSuppressedIssuesOrNull(string roslynSettingsKey, T payload);
}
class ConcreteCalculator1<EventType1>
The slight problem with this is the fact that All and New calculators have essentially the same payload type, so there would be a need to have a way to differentiate between them somehow
src/Roslyn.Suppressions/Roslyn.Suppressions/InProcess/RoslynSettingsFileSynchronizer.cs
Outdated
Show resolved
Hide resolved
...slyn.Suppressions/Roslyn.Suppressions.UnitTests/InProcess/SuppressedIssuesCalculatorTests.cs
Outdated
Show resolved
Hide resolved
- Extract method - Move class into its own file -Split tests into multiple test classes
|
58de500
into
feature/sloop-mute-issue
SLVS-1853
The ServerIssuesStore will be dropped, so the RoslynSettingsFileSynchronizer should listen to the events from SuppressionIssueStoreUpdater and should update the file accordingly.
As part of this PR, I have stored the server key of the issue in the file as well, so that the issues can be easier to identify when they are resolved.
This targets the PR in which the SuppressionIssueStoreUpdater has been refactored to use events.