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

SLOMNI-25 Use path to analyzer JAR provided through analyzer property #241

Merged
merged 9 commits into from
Nov 7, 2024

Conversation

jblievremont
Copy link
Member

SLOMNI-25

@jblievremont jblievremont force-pushed the SLOMNI-25-configure-path-to-jar branch from 4cc3c0d to 176c076 Compare October 17, 2024 08:33
@@ -79,6 +79,7 @@ public void execute(SensorContext context) {
return;
}
try {
Path analyzerPluginPath = context.config().get(CSharpPropertyDefinitions.getEnterpriseAnalyzerPath()).map(Paths::get).orElse(null);

Choose a reason for hiding this comment

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

We can check the additional analyzer property value (sonar.omnisharp.internal.shouldUseEnterprise or similar) and decide which analyzer plugin path to use - OSS or enterprise

var analyzerPluginPath = configuration.get(CSharpPropertyDefinitions.getEnterpriseAnalyzerPath()).orElse(null);
try (InputStream analyzerPlugin = new FileInputStream(analyzerPluginPath)) {
requireNonNull(analyzerPlugin, "Plugin jar not found");
ZipUtils.unzip(analyzerPlugin, pluginUnzipDir, ze -> ze.getName().endsWith(".zip") || ze.getName().endsWith(".json") || ze.getName().endsWith(".html"));

Choose a reason for hiding this comment

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

No need to filter the components anymore, analyzer should do it.

Choose a reason for hiding this comment

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

Is this filtering still needed?

@jblievremont jblievremont force-pushed the SLOMNI-25-configure-path-to-jar branch from c5f688b to 548cc65 Compare October 18, 2024 15:43
@jblievremont jblievremont marked this pull request as ready for review November 4, 2024 09:15
@jblievremont jblievremont force-pushed the SLOMNI-25-configure-path-to-jar branch from f6ec1a3 to 51f6b98 Compare November 7, 2024 13:50
Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM, just left one question about filtering while unzipping

Copy link

sonarqube-next bot commented Nov 7, 2024

Quality Gate passed Quality Gate passed for 'sonarlint-omnisharp-dotnet'

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

Copy link

sonarqube-next bot commented Nov 7, 2024

@jblievremont jblievremont merged commit dfdcead into master Nov 7, 2024
10 checks passed
@jblievremont jblievremont deleted the SLOMNI-25-configure-path-to-jar branch November 7, 2024 15:40
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