From f911dcdb86518da5ecf978150de724d5d2a06b81 Mon Sep 17 00:00:00 2001 From: Carlos Sanchez Date: Sun, 7 Mar 2021 11:55:05 +0100 Subject: [PATCH] fix: always show the GitHub endpoint selection so users are aware that they must add a new endpoint in configuration Standardize the docs for apiUri --- .../GitHubAppCredentials.java | 1 + .../github_branch_source/GitHubSCMNavigator.java | 1 + .../github_branch_source/GitHubSCMSource.java | 1 + .../GitHubAppCredentials/config.jelly | 13 +++---------- .../GitHubAppCredentials/help-apiUri.html | 1 + .../GitHubSCMNavigator/config.jelly | 15 +++------------ .../GitHubSCMNavigator/help-apiUri.html | 4 ++-- .../GitHubSCMSource/config-detail.jelly | 10 +++------- .../GitHubSCMSource/help-apiUri.html | 4 ++-- 9 files changed, 17 insertions(+), 33 deletions(-) diff --git a/src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubAppCredentials.java b/src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubAppCredentials.java index d2a2886e3..337023139 100644 --- a/src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubAppCredentials.java +++ b/src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubAppCredentials.java @@ -799,6 +799,7 @@ public String getIconClassName() { } @SuppressWarnings("unused") // jelly + @Deprecated public boolean isApiUriSelectable() { return !GitHubConfiguration.get().getEndpoints().isEmpty(); } diff --git a/src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator.java b/src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator.java index d188b2af1..5abe78da1 100644 --- a/src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator.java +++ b/src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator.java @@ -1868,6 +1868,7 @@ static ListBoxModel getPossibleApiUriItems() { * @return {@code true} if there is more than one GitHub endpoint configured. */ @SuppressWarnings("unused") // jelly + @Deprecated public boolean isApiUriSelectable() { return !GitHubConfiguration.get().getEndpoints().isEmpty(); } diff --git a/src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java b/src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java index ac1c480fc..ce18353d8 100644 --- a/src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java +++ b/src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java @@ -2249,6 +2249,7 @@ public ListBoxModel doFillApiUriItems() { return result; } + @Deprecated public boolean isApiUriSelectable() { return !GitHubConfiguration.get().getEndpoints().isEmpty(); } diff --git a/src/main/resources/org/jenkinsci/plugins/github_branch_source/GitHubAppCredentials/config.jelly b/src/main/resources/org/jenkinsci/plugins/github_branch_source/GitHubAppCredentials/config.jelly index 715c2f218..ed177e573 100644 --- a/src/main/resources/org/jenkinsci/plugins/github_branch_source/GitHubAppCredentials/config.jelly +++ b/src/main/resources/org/jenkinsci/plugins/github_branch_source/GitHubAppCredentials/config.jelly @@ -5,16 +5,9 @@ - - - - - - - - - - + + + diff --git a/src/main/resources/org/jenkinsci/plugins/github_branch_source/GitHubAppCredentials/help-apiUri.html b/src/main/resources/org/jenkinsci/plugins/github_branch_source/GitHubAppCredentials/help-apiUri.html index d2a930aa1..3d80884d7 100644 --- a/src/main/resources/org/jenkinsci/plugins/github_branch_source/GitHubAppCredentials/help-apiUri.html +++ b/src/main/resources/org/jenkinsci/plugins/github_branch_source/GitHubAppCredentials/help-apiUri.html @@ -1,3 +1,4 @@

GitHub API endpoint such as https://github.example.com/api/v3/. + The list of servers is configured in the Manage Jenkins » Configure System » GitHub Enterprise Servers screen.

diff --git a/src/main/resources/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator/config.jelly b/src/main/resources/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator/config.jelly index 35e97264d..2cce417bc 100644 --- a/src/main/resources/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator/config.jelly +++ b/src/main/resources/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator/config.jelly @@ -1,18 +1,9 @@ - - - - - - - - - - - - + + + diff --git a/src/main/resources/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator/help-apiUri.html b/src/main/resources/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator/help-apiUri.html index a00e19905..446c7e2c1 100644 --- a/src/main/resources/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator/help-apiUri.html +++ b/src/main/resources/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator/help-apiUri.html @@ -1,4 +1,4 @@
- The server to connect to. The list of servers is configured in the Manage Jenkins » Configure - System » GitHub Enterprise Servers screen. + GitHub API endpoint such as https://github.example.com/api/v3/. + The list of servers is configured in the Manage Jenkins » Configure System » GitHub Enterprise Servers screen.
diff --git a/src/main/resources/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource/config-detail.jelly b/src/main/resources/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource/config-detail.jelly index 5b1c20e42..320855060 100644 --- a/src/main/resources/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource/config-detail.jelly +++ b/src/main/resources/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource/config-detail.jelly @@ -22,13 +22,9 @@ - - - - - - - + + + diff --git a/src/main/resources/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource/help-apiUri.html b/src/main/resources/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource/help-apiUri.html index a00e19905..446c7e2c1 100644 --- a/src/main/resources/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource/help-apiUri.html +++ b/src/main/resources/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource/help-apiUri.html @@ -1,4 +1,4 @@
- The server to connect to. The list of servers is configured in the Manage Jenkins » Configure - System » GitHub Enterprise Servers screen. + GitHub API endpoint such as https://github.example.com/api/v3/. + The list of servers is configured in the Manage Jenkins » Configure System » GitHub Enterprise Servers screen.