-
Notifications
You must be signed in to change notification settings - Fork 144
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
SCAN4NET-171 Read new properties for downloading plugins #2294
Conversation
0e8ecff
to
fdc4cef
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.
Small conceptual nuke to start with
src/SonarScanner.MSBuild.PreProcessor/Interfaces/IAnalyzerProvider.cs
Outdated
Show resolved
Hide resolved
src/SonarScanner.MSBuild.PreProcessor/Roslyn/RoslynAnalyzerProvider.cs
Outdated
Show resolved
Hide resolved
src/SonarScanner.MSBuild.PreProcessor/Roslyn/RoslynAnalyzerProvider.cs
Outdated
Show resolved
Hide resolved
src/SonarScanner.MSBuild.PreProcessor/Roslyn/RoslynAnalyzerProvider.cs
Outdated
Show resolved
Hide resolved
src/SonarScanner.MSBuild.PreProcessor/Roslyn/RoslynAnalyzerProvider.cs
Outdated
Show resolved
Hide resolved
src/SonarScanner.MSBuild.PreProcessor/Roslyn/RoslynAnalyzerProvider.cs
Outdated
Show resolved
Hide resolved
src/SonarScanner.MSBuild.PreProcessor/Roslyn/RoslynAnalyzerProvider.cs
Outdated
Show resolved
Hide resolved
51fadff
to
ad8f09f
Compare
5fb0eda
to
1e11364
Compare
ad8f09f
to
ac9dd05
Compare
1e11364
to
f4efaca
Compare
98affdf
to
f089335
Compare
f089335
to
80132ec
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 polishing
Tests/SonarScanner.MSBuild.PreProcessor.Test/Infrastructure/MockAnalyzerInstaller.cs
Outdated
Show resolved
Hide resolved
Tests/SonarScanner.MSBuild.PreProcessor.Test/Infrastructure/MockAnalyzerInstaller.cs
Outdated
Show resolved
Hide resolved
src/SonarScanner.MSBuild.PreProcessor/Roslyn/RoslynAnalyzerProvider.cs
Outdated
Show resolved
Hide resolved
src/SonarScanner.MSBuild.PreProcessor/Roslyn/RoslynAnalyzerProvider.cs
Outdated
Show resolved
Hide resolved
Tests/SonarScanner.MSBuild.PreProcessor.Test/RoslynAnalyzerProviderTests.cs
Outdated
Show resolved
Hide resolved
Tests/SonarScanner.MSBuild.PreProcessor.Test/RoslynAnalyzerProviderTests.cs
Outdated
Show resolved
Hide resolved
Tests/SonarScanner.MSBuild.PreProcessor.Test/RoslynAnalyzerProviderTests.cs
Outdated
Show resolved
Hide resolved
Tests/SonarScanner.MSBuild.PreProcessor.Test/RoslynAnalyzerProviderTests.cs
Outdated
Show resolved
Hide resolved
Tests/SonarScanner.MSBuild.PreProcessor.Test/RoslynAnalyzerProviderTests.cs
Outdated
Show resolved
Hide resolved
74cc6da
to
05ea7ee
Compare
Quality Gate passedIssues Measures |
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.
Final cleanup
{"sonaranalyzer.security.cs.staticResourceName", "OLDSecurityCSharpFrontend" }, | ||
}); | ||
var context = new Context(TestContext, sonarProperties, [[@"c:\assembly1.dll"], [@"d:\foo\assembly2.dll"]], null, language); | ||
var securityProperties = language == RoslynAnalyzerProvider.CSharpLanguage ? |
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.
securityProperties
and expectedSonarLintXml
are the same for RoslynConfig_ValidProfile_WithLegacy
and RoslynConfig_ValidProfile_WithoutLegacy
.
Extract it. And use the same scaffolding (add security) also in RoslynConfig_ValidProfile_LegacyOnly
. Then it will be used 3x.
var expectedPlugins = new List<Plugin>() | ||
{ | ||
new() { Key = "wintellect", Version = "1.13.0", StaticResourceName = "wintellect.zip" }, | ||
new() { Key = language, Version = "1.42.0", StaticResourceName = "SonarAnalyzer.zip" }, | ||
}; | ||
if (language == RoslynAnalyzerProvider.CSharpLanguage) | ||
{ | ||
expectedPlugins.Add(new() { Key = "securitycsharpfrontend", Version = "1.42.0", StaticResourceName = "SecurityAnalyzer.zip" }); | ||
} |
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.
Calculation of expectedPlugins
should be also extracted, as it will be used 3x
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.
LGTM, I'll merge it as-is and will address the comments in another PR
<Setting> | ||
<Key>sonar.{language}.analyzer.dotnet.pluginKey</Key> | ||
<Value>{language}</Value> | ||
</Setting> | ||
<Setting> | ||
<Key>sonar.{language}.analyzer.dotnet.pluginVersion</Key> | ||
<Value>1.42.0</Value> | ||
</Setting> | ||
<Setting> | ||
<Key>sonar.{language}.analyzer.dotnet.staticResourceName</Key> | ||
<Value>SonarAnalyzer.zip</Value> | ||
</Setting> |
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.
Oversight from previous review: We shouldn't generate these to SonarLint.xml
file, as sonaranalyzer-{language}
where previously also not generated.
We use them to talk to scanner. We should not propagate them back to the analyzers
SCAN4NET-171