Skip to content

Commit f911dcd

Browse files
committed
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
1 parent ff8e48e commit f911dcd

File tree

9 files changed

+17
-33
lines changed

9 files changed

+17
-33
lines changed

src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubAppCredentials.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,7 @@ public String getIconClassName() {
799799
}
800800

801801
@SuppressWarnings("unused") // jelly
802+
@Deprecated
802803
public boolean isApiUriSelectable() {
803804
return !GitHubConfiguration.get().getEndpoints().isEmpty();
804805
}

src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1868,6 +1868,7 @@ static ListBoxModel getPossibleApiUriItems() {
18681868
* @return {@code true} if there is more than one GitHub endpoint configured.
18691869
*/
18701870
@SuppressWarnings("unused") // jelly
1871+
@Deprecated
18711872
public boolean isApiUriSelectable() {
18721873
return !GitHubConfiguration.get().getEndpoints().isEmpty();
18731874
}

src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2249,6 +2249,7 @@ public ListBoxModel doFillApiUriItems() {
22492249
return result;
22502250
}
22512251

2252+
@Deprecated
22522253
public boolean isApiUriSelectable() {
22532254
return !GitHubConfiguration.get().getEndpoints().isEmpty();
22542255
}

src/main/resources/org/jenkinsci/plugins/github_branch_source/GitHubAppCredentials/config.jelly

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,9 @@
55
<f:textbox/>
66
</f:entry>
77
<j:choose>
8-
<j:when test="${descriptor.apiUriSelectable}">
9-
<f:entry title="${%API endpoint}" field="apiUri">
10-
<f:select/>
11-
</f:entry>
12-
</j:when>
13-
<j:otherwise>
14-
<f:invisibleEntry>
15-
<f:select field="apiUri"/>
16-
</f:invisibleEntry>
17-
</j:otherwise>
8+
<f:entry title="${%API endpoint}" field="apiUri">
9+
<f:select/>
10+
</f:entry>
1811
</j:choose>
1912

2013
<f:entry title="${%Key}" field="privateKey">
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
<p>
22
<a href="https://developer.github.com/v3/">GitHub API</a> endpoint such as <code>https://github.example.com/api/v3/</code>.
3+
The list of servers is configured in the <strong>Manage Jenkins » Configure System » GitHub Enterprise Servers</strong> screen.
34
</p>

src/main/resources/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator/config.jelly

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<?jelly escape-by-default='true'?>
33
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form" xmlns:c="/lib/credentials" xmlns:scm="/jenkins/scm/api/form">
4-
<j:choose>
5-
<j:when test="${descriptor.apiUriSelectable}">
6-
<f:entry title="${%API endpoint}" field="apiUri">
7-
<f:select/>
8-
</f:entry>
9-
</j:when>
10-
<j:otherwise>
11-
<f:entry title="${%API endpoint}" field="apiUri">
12-
<f:textbox readonly="readonly"/>
13-
</f:entry>
14-
</j:otherwise>
15-
</j:choose>
4+
<f:entry title="${%API endpoint}" field="apiUri">
5+
<f:select/>
6+
</f:entry>
167
<f:entry title="${%Credentials}" field="credentialsId">
178
<c:select checkMethod="post"/>
189
</f:entry>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<div>
2-
The server to connect to. The list of servers is configured in the <strong>Manage Jenkins » Configure
3-
System » GitHub Enterprise Servers</strong> screen.
2+
<a href="https://developer.github.com/v3/">GitHub API</a> endpoint such as <code>https://github.example.com/api/v3/</code>.
3+
The list of servers is configured in the <strong>Manage Jenkins » Configure System » GitHub Enterprise Servers</strong> screen.
44
</div>

src/main/resources/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource/config-detail.jelly

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,9 @@
2222
</f:radioBlock>
2323
<f:radioBlock name="configuredByUrlRadio" value="false" checked="false" title="${%Repository Scan - Deprecated Visualization}" inline="true">
2424
<f:nested>
25-
<j:choose>
26-
<j:when test="${descriptor.apiUriSelectable}">
27-
<f:entry title="${%API endpoint}" field="apiUri">
28-
<f:select/>
29-
</f:entry>
30-
</j:when>
31-
</j:choose>
25+
<f:entry title="${%API endpoint}" field="apiUri">
26+
<f:select/>
27+
</f:entry>
3228
<f:entry title ="${%Owner}" field="repoOwner">
3329
<f:textbox/>
3430
</f:entry>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<div>
2-
The server to connect to. The list of servers is configured in the <strong>Manage Jenkins » Configure
3-
System » GitHub Enterprise Servers</strong> screen.
2+
<a href="https://developer.github.com/v3/">GitHub API</a> endpoint such as <code>https://github.example.com/api/v3/</code>.
3+
The list of servers is configured in the <strong>Manage Jenkins » Configure System » GitHub Enterprise Servers</strong> screen.
44
</div>

0 commit comments

Comments
 (0)