You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by dp...@apache.org on 2019/04/12 12:20:35 UTC
[ignite-teamcity-bot] branch ce-cfg-usability updated: GitHub
configurable now using main branches file
This is an automated email from the ASF dual-hosted git repository.
dpavlov pushed a commit to branch ce-cfg-usability
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git
The following commit(s) were added to refs/heads/ce-cfg-usability by this push:
new 2eb0283 GitHub configurable now using main branches file
2eb0283 is described below
commit 2eb028358cec2e9d2f1599dc5a5baf0706260ecf
Author: Dmitriy Pavlov <dp...@apache.org>
AuthorDate: Fri Apr 12 15:20:28 2019 +0300
GitHub configurable now using main branches file
---
.../org/apache/ignite/ci/tcbot/conf/GitHubConfig.java | 15 +++++++++------
.../org/apache/ignite/ci/tcbot/conf/IGitHubConfig.java | 6 +++++-
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/GitHubConfig.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/GitHubConfig.java
index 493b86c..6078dec 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/GitHubConfig.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/GitHubConfig.java
@@ -29,15 +29,14 @@ import static com.google.common.base.Strings.isNullOrEmpty;
*/
public class GitHubConfig implements IGitHubConfig {
public static final String DEFAULT_BRANCH_PREFIX = "ignite-";
- /**
- * Service (server) Name.
- */
+
+ /** Service (server) code. */
private String code;
/** GitHub Api URL */
private String apiUrl;
- /** */
+ /** Branch prefix for ticket related feature branches. */
private String branchPrefix;
/**
@@ -98,14 +97,18 @@ public class GitHubConfig implements IGitHubConfig {
@Override public String gitApiUrl() {
String gitApiUrl = getGitApiConfigured();
+ if (isNullOrEmpty(gitApiUrl))
+ return gitApiUrl;
+
return gitApiUrl.endsWith("/") ? gitApiUrl : gitApiUrl + "/";
}
/**
- *
+ * @return Github API url configured, probably without ending slash.
*/
- @Nullable public String getGitApiConfigured() {
+ @Nullable
+ public String getGitApiConfigured() {
if (!Strings.isNullOrEmpty(apiUrl))
return apiUrl;
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/IGitHubConfig.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/IGitHubConfig.java
index 99244d4..4f06662 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/IGitHubConfig.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/IGitHubConfig.java
@@ -23,7 +23,7 @@ import javax.annotation.Nullable;
*
*/
public interface IGitHubConfig {
- /** Git branch prefix for search TC runs in PR-less contributions. */
+ /** Git branch prefix for search ticket-related TC runs in PR-less contributions. */
@Nonnull
public String gitBranchPrefix();
@@ -35,5 +35,9 @@ public interface IGitHubConfig {
@Nullable
public String gitAuthTok();
+ /**
+ * @return GitHub Api URL, if specified always ends with '/'
+ */
+ @Nullable
public String gitApiUrl();
}