aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws/src/main
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2018-11-12 10:34:45 +0100
committerSonarTech <sonartech@sonarsource.com>2018-11-16 20:21:07 +0100
commit86ac62ba47899611e59f7dc3f6613cdf0a604504 (patch)
tree04332506c71485126be2ccce367b69cac542b7e8 /sonar-ws/src/main
parentc21cf184eda604c802b549e98b162191e769241a (diff)
downloadsonarqube-86ac62ba47899611e59f7dc3f6613cdf0a604504.tar.gz
sonarqube-86ac62ba47899611e59f7dc3f6613cdf0a604504.zip
SONAR-11452 Display a warning when analysing a PR on an unbound organization
* ProjectAlmBindingDto#getAlm does not need to return Optional, as column is not nullable * Add warning on Bitbucket PR analysis when organization is not bound * Extract GitHub API call in dedicated class * Add warning on GitHub PR analysis when organization is not bound
Diffstat (limited to 'sonar-ws/src/main')
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/ce/AnalysisStatusRequest.java75
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/ce/CeService.java32
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/ce/TaskRequest.java1
3 files changed, 103 insertions, 5 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/ce/AnalysisStatusRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/ce/AnalysisStatusRequest.java
new file mode 100644
index 00000000000..4fddb8d0ccb
--- /dev/null
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/ce/AnalysisStatusRequest.java
@@ -0,0 +1,75 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2018 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.sonarqube.ws.client.ce;
+
+import javax.annotation.Generated;
+
+/**
+ * This is part of the internal API.
+ * This is a POST request.
+ * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/ce/analysis_status">Further information about this action online (including a response example)</a>
+ * @since 7.4
+ */
+@Generated("sonar-ws-generator")
+public class AnalysisStatusRequest {
+
+ private String branch;
+ private String component;
+ private String pullRequest;
+
+ /**
+ * This is part of the internal API.
+ * Example value: "feature/my_branch"
+ */
+ public AnalysisStatusRequest setBranch(String branch) {
+ this.branch = branch;
+ return this;
+ }
+
+ public String getBranch() {
+ return branch;
+ }
+
+ /**
+ * This is a mandatory parameter.
+ * Example value: "my_project"
+ */
+ public AnalysisStatusRequest setComponent(String component) {
+ this.component = component;
+ return this;
+ }
+
+ public String getComponent() {
+ return component;
+ }
+
+ /**
+ * This is part of the internal API.
+ * Example value: "5461"
+ */
+ public AnalysisStatusRequest setPullRequest(String pullRequest) {
+ this.pullRequest = pullRequest;
+ return this;
+ }
+
+ public String getPullRequest() {
+ return pullRequest;
+ }
+}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/ce/CeService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/ce/CeService.java
index c02981e25f0..da25cf7b3d3 100644
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/ce/CeService.java
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/ce/CeService.java
@@ -21,19 +21,20 @@ package org.sonarqube.ws.client.ce;
import java.util.stream.Collectors;
import javax.annotation.Generated;
-import org.sonarqube.ws.MediaTypes;
-import org.sonarqube.ws.client.BaseService;
-import org.sonarqube.ws.client.GetRequest;
-import org.sonarqube.ws.client.PostRequest;
-import org.sonarqube.ws.client.WsConnector;
import org.sonarqube.ws.Ce.ActivityResponse;
import org.sonarqube.ws.Ce.ActivityStatusWsResponse;
+import org.sonarqube.ws.Ce.AnalysisStatusWsResponse;
import org.sonarqube.ws.Ce.ComponentResponse;
import org.sonarqube.ws.Ce.InfoWsResponse;
import org.sonarqube.ws.Ce.SubmitResponse;
import org.sonarqube.ws.Ce.TaskResponse;
import org.sonarqube.ws.Ce.TaskTypesWsResponse;
import org.sonarqube.ws.Ce.WorkerCountResponse;
+import org.sonarqube.ws.MediaTypes;
+import org.sonarqube.ws.client.BaseService;
+import org.sonarqube.ws.client.GetRequest;
+import org.sonarqube.ws.client.PostRequest;
+import org.sonarqube.ws.client.WsConnector;
/**
* @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/ce">Further information about this web service online</a>
@@ -86,6 +87,22 @@ public class CeService extends BaseService {
/**
*
* This is part of the internal API.
+ * This is a GET request.
+ * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/ce/analysis_status">Further information about this action online (including a response example)</a>
+ * @since 7.4
+ */
+ public AnalysisStatusWsResponse analysisStatus(AnalysisStatusRequest request) {
+ return call(
+ new GetRequest(path("analysis_status"))
+ .setParam("branch", request.getBranch())
+ .setParam("component", request.getComponent())
+ .setParam("pullRequest", request.getPullRequest()),
+ AnalysisStatusWsResponse.parser());
+ }
+
+ /**
+ *
+ * This is part of the internal API.
* This is a POST request.
* @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/ce/cancel">Further information about this action online (including a response example)</a>
* @since 5.2
@@ -129,6 +146,7 @@ public class CeService extends BaseService {
/**
*
+ * This is part of the internal API.
* This is a GET request.
* @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/ce/info">Further information about this action online (including a response example)</a>
* @since 7.2
@@ -140,6 +158,8 @@ public class CeService extends BaseService {
}
/**
+ *
+ * This is part of the internal API.
* This is a POST request.
* @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/ce/pause">Further information about this action online (including a response example)</a>
* @since 7.2
@@ -152,6 +172,8 @@ public class CeService extends BaseService {
}
/**
+ *
+ * This is part of the internal API.
* This is a POST request.
* @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/ce/resume">Further information about this action online (including a response example)</a>
* @since 7.2
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/ce/TaskRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/ce/TaskRequest.java
index ce59a75ca00..b0c65011953 100644
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/ce/TaskRequest.java
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/ce/TaskRequest.java
@@ -39,6 +39,7 @@ public class TaskRequest {
* <ul>
* <li>"stacktrace"</li>
* <li>"scannerContext"</li>
+ * <li>"warnings"</li>
* </ul>
*/
public TaskRequest setAdditionalFields(List<String> additionalFields) {