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

Fix API usage for sonar 7.7 #226

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<license.mailto>[email protected]</license.mailto>
<license.owner>Talanlabs</license.owner>

<sonar.version>7.0</sonar.version>
<sonar.version>7.7</sonar.version>
<sonar.pluginName>GitLab</sonar.pluginName>
<sonar.pluginClass>com.talanlabs.sonar.plugins.gitlab.GitLabPlugin</sonar.pluginClass>

Expand Down Expand Up @@ -83,6 +83,9 @@
<contributor>
<name>David Marin Vaquero</name>
</contributor>
<contributor>
<name>Jean-Baptiste Lamotte</name>
</contributor>
</contributors>
<scm>
<url>https://github.com/gabrie-allaigre/sonar-gitlab-plugin</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.google.common.annotations.VisibleForTesting;
import com.talanlabs.sonar.plugins.gitlab.models.JsonMode;
import org.sonar.api.batch.InstantiationStrategy;
import org.sonar.api.batch.ScannerSide;
import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.scan.filesystem.PathResolver;
import org.sonar.api.utils.MessageException;
import org.sonar.api.utils.log.Logger;
Expand All @@ -41,7 +41,7 @@
/**
* Facade for all WS interaction with GitLab.
*/
@InstantiationStrategy(InstantiationStrategy.PER_BATCH)
@InstantiationStrategy(InstantiationStrategy.PER_PROJECT)
@ScannerSide
public class CommitFacade {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import com.talanlabs.sonar.plugins.gitlab.models.StatusNotificationsMode;
import org.sonar.api.CoreProperties;
import org.sonar.api.batch.InstantiationStrategy;
import org.sonar.api.batch.ScannerSide;
import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.batch.rule.Severity;
import org.sonar.api.config.Configuration;
import org.sonar.api.utils.System2;
Expand All @@ -36,7 +36,7 @@
import java.util.Arrays;
import java.util.List;

@InstantiationStrategy(InstantiationStrategy.PER_BATCH)
@InstantiationStrategy(InstantiationStrategy.PER_PROJECT)
@ScannerSide
public class GitLabPluginConfiguration {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
package com.talanlabs.sonar.plugins.gitlab;

import org.sonar.api.batch.InstantiationStrategy;
import org.sonar.api.batch.ScannerSide;
import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.batch.rule.Severity;

import javax.annotation.Nullable;

@InstantiationStrategy(InstantiationStrategy.PER_BATCH)
@InstantiationStrategy(InstantiationStrategy.PER_PROJECT)
@ScannerSide
public class MarkDownUtils {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.talanlabs.sonar.plugins.gitlab.models.*;
import org.sonar.api.ExtensionPoint;
import org.sonar.api.batch.AnalysisMode;
import org.sonar.api.batch.ScannerSide;
import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.batch.InstantiationStrategy;
import org.sonar.api.batch.rule.Severity;
import org.sonar.api.utils.log.Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import com.talanlabs.sonar.plugins.gitlab.models.Rule;
import org.sonar.api.CoreProperties;
import org.sonar.api.batch.InstantiationStrategy;
import org.sonar.api.batch.ScannerSide;
import org.sonar.api.scanner.ScannerSide;
import org.sonar.api.batch.rule.Severity;
import org.sonar.api.config.Configuration;
import org.sonar.api.measures.CoreMetrics;
Expand All @@ -53,7 +53,7 @@
/**
* Facade for all WS interaction with Sonar
*/
@InstantiationStrategy(InstantiationStrategy.PER_BATCH)
@InstantiationStrategy(InstantiationStrategy.PER_PROJECT)
@ScannerSide
public class SonarFacade {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ public void tesFailed1GetNewIssue() throws IOException {

createReportTaskFile();
Assertions.assertThatThrownBy(() -> sonarFacade.getNewIssues()).isInstanceOf(HttpException.class)
.hasMessage("Error 404 on http://" + sonar.getHostName() + ":" + sonar.getPort() + "/api/issues/search?componentKeys=com.talanlabs:avatar-generator-parent&p=1&resolved=false : Not Found");
.hasMessage("Error 404 on http://" + sonar.getHostName() + ":" + sonar.getPort() + "/api/issues/search?componentKeys=com.talanlabs%3Aavatar-generator-parent&p=1&resolved=false : Not Found");
}

@Test
Expand Down