Skip to content

Commit 4dd653b

Browse files
authored
Merge branch 'master' into renovate/org.glassfish.tyrus.bundles-tyrus-standalone-client-jdk-2.x
2 parents cd21866 + ecd3f88 commit 4dd653b

27 files changed

+65
-465
lines changed

core/src/main/java/hudson/model/View.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,6 +1250,12 @@ public static View createViewFromXML(String name, InputStream xml) throws IOExce
12501250
}
12511251
}
12521252

1253+
// for Jelly
1254+
@Restricted(DoNotUse.class)
1255+
public boolean isMyViewsProperty() {
1256+
return getOwner() instanceof MyViewsProperty;
1257+
}
1258+
12531259
public static class PropertyList extends DescribableList<ViewProperty, ViewPropertyDescriptor> {
12541260
private PropertyList(View owner) {
12551261
super(owner);

core/src/main/java/jenkins/model/Jenkins.java

Lines changed: 41 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,15 @@
3434
import static hudson.init.InitMilestone.JOB_CONFIG_ADAPTED;
3535
import static hudson.init.InitMilestone.JOB_LOADED;
3636
import static hudson.init.InitMilestone.PLUGINS_PREPARED;
37+
import static hudson.init.InitMilestone.SYSTEM_CONFIG_ADAPTED;
3738
import static hudson.init.InitMilestone.SYSTEM_CONFIG_LOADED;
3839
import static jakarta.servlet.http.HttpServletResponse.SC_BAD_REQUEST;
3940
import static jakarta.servlet.http.HttpServletResponse.SC_NOT_FOUND;
4041
import static java.util.logging.Level.FINE;
4142
import static java.util.logging.Level.INFO;
4243
import static java.util.logging.Level.SEVERE;
4344
import static java.util.logging.Level.WARNING;
45+
import static jenkins.model.Messages.Hudson_Computer_IncorrectNumberOfExecutors;
4446

4547
import com.google.common.annotations.VisibleForTesting;
4648
import com.google.inject.Inject;
@@ -3497,7 +3499,7 @@ public void run(Reactor session) throws Exception {
34973499

34983500
List<Handle> loadJobs = new ArrayList<>();
34993501
for (final File subdir : subdirs) {
3500-
loadJobs.add(g.requires(loadJenkins).attains(JOB_LOADED).notFatal().add("Loading item " + subdir.getName(), new Executable() {
3502+
loadJobs.add(g.requires(loadJenkins).requires(SYSTEM_CONFIG_ADAPTED).attains(JOB_LOADED).notFatal().add("Loading item " + subdir.getName(), new Executable() {
35013503
@Override
35023504
public void run(Reactor session) throws Exception {
35033505
if (!Items.getConfigFile(subdir).exists()) {
@@ -4100,28 +4102,6 @@ private boolean configureDescriptor(StaplerRequest2 req, JSONObject json, Descri
41004102
return d.configure(req, js);
41014103
}
41024104

4103-
/**
4104-
* Accepts submission from the node configuration page.
4105-
*/
4106-
@POST
4107-
public synchronized void doConfigExecutorsSubmit(StaplerRequest2 req, StaplerResponse2 rsp) throws IOException, ServletException, FormException {
4108-
checkPermission(ADMINISTER);
4109-
4110-
try (BulkChange bc = new BulkChange(this)) {
4111-
JSONObject json = req.getSubmittedForm();
4112-
4113-
ExtensionList.lookupSingleton(MasterBuildConfiguration.class).configure(req, json);
4114-
4115-
getNodeProperties().rebuild(req, json.optJSONObject("nodeProperties"), NodeProperty.all());
4116-
4117-
bc.commit();
4118-
}
4119-
4120-
updateComputers(this);
4121-
4122-
FormApply.success(req.getContextPath() + '/' + toComputer().getUrl()).generateResponse(req, rsp, null);
4123-
}
4124-
41254105
/**
41264106
* Accepts the new description.
41274107
*/
@@ -5508,7 +5488,44 @@ public HttpResponse doDoDelete() throws IOException {
55085488
@Override
55095489
@POST
55105490
public void doConfigSubmit(StaplerRequest2 req, StaplerResponse2 rsp) throws IOException, ServletException, FormException {
5511-
Jenkins.get().doConfigExecutorsSubmit(req, rsp);
5491+
checkPermission(ADMINISTER);
5492+
5493+
Jenkins jenkins = Jenkins.get();
5494+
5495+
try (BulkChange bc = new BulkChange(jenkins)) {
5496+
JSONObject json = req.getSubmittedForm();
5497+
5498+
try {
5499+
// For compatibility reasons, this value is stored in Jenkins
5500+
String num = json.getString("numExecutors");
5501+
if (!num.matches("\\d+")) {
5502+
throw new Descriptor.FormException(Hudson_Computer_IncorrectNumberOfExecutors(), "numExecutors");
5503+
}
5504+
5505+
jenkins.setNumExecutors(json.getInt("numExecutors"));
5506+
if (req.hasParameter("builtin.mode")) {
5507+
jenkins.setMode(Mode.valueOf(req.getParameter("builtin.mode")));
5508+
} else {
5509+
jenkins.setMode(Mode.NORMAL);
5510+
}
5511+
5512+
jenkins.setLabelString(json.optString("labelString", ""));
5513+
} catch (IOException e) {
5514+
throw new Descriptor.FormException(e, "numExecutors");
5515+
}
5516+
5517+
jenkins.getNodeProperties().rebuild(req, json.optJSONObject("nodeProperties"), NodeProperty.all());
5518+
5519+
bc.commit();
5520+
}
5521+
5522+
jenkins.updateComputers(jenkins);
5523+
5524+
Computer computer = jenkins.toComputer();
5525+
if (computer == null) {
5526+
throw new IllegalStateException("Cannot find the computer object for the controller node");
5527+
}
5528+
FormApply.success(req.getContextPath() + '/' + computer.getUrl()).generateResponse(req, rsp, null);
55125529
}
55135530

55145531
@WebMethod(name = "config.xml")

core/src/main/java/jenkins/model/MasterBuildConfiguration.java

Lines changed: 0 additions & 72 deletions
This file was deleted.

core/src/main/resources/hudson/model/View/main.jelly

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<j:if test="${!newDashboardPage}">
1818
<j:choose>
19-
<j:when test="${it.owner.class == hudson.model.MyViewsProperty.class}">
19+
<j:when test="${it.isMyViewsProperty()}">
2020
<st:include it="${it.owner.viewsTabBar}" page="viewTabs" />
2121
</j:when>
2222
<j:otherwise>
@@ -41,7 +41,7 @@
4141

4242
<j:if test="${!newDashboardPage}">
4343
<j:choose>
44-
<j:when test="${it.owner.class == hudson.model.MyViewsProperty.class}">
44+
<j:when test="${it.isMyViewsProperty()}">
4545
<st:include it="${it.owner.viewsTabBar}" page="viewTabs" />
4646
</j:when>
4747
<j:otherwise>

core/src/main/resources/jenkins/model/Jenkins/configure.jelly

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ THE SOFTWARE.
5151
codemirror-mode="${app.markupFormatter.codeMirrorMode}" codemirror-config="${app.markupFormatter.codeMirrorConfig}" previewEndpoint="/markupFormatter/previewDescription"/>
5252
</f:entry>
5353

54+
<!-- TODO remove after January 2026 LTS line -->
55+
<div class="jenkins-alert jenkins-alert-info">
56+
<l:icon src="symbol-computer" class="icon-sm jenkins-!-margin-right-1" />
57+
${%nodeHasBeenMoved(rootURL + '/manage/computer/(built-in)/configure')}
58+
</div>
59+
5460
<!-- global configuration from everyone -->
5561
<j:set var="editable" value="${h.getSortedDescriptorsForGlobalConfigUnclassified()}"/>
5662
<j:forEach var="descriptor" items="${h.getSortedDescriptorsForGlobalConfigUnclassifiedReadable()}">
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
LOADING=Loading
1+
nodeHasBeenMoved=Built-In Node is now configured in <a href="{0}">Nodes</a>.

core/src/main/resources/jenkins/model/MasterBuildConfiguration/config.jelly

Lines changed: 0 additions & 30 deletions
This file was deleted.

core/src/main/resources/jenkins/model/MasterBuildConfiguration/config_da.properties

Lines changed: 0 additions & 25 deletions
This file was deleted.

core/src/main/resources/jenkins/model/MasterBuildConfiguration/config_de.properties

Lines changed: 0 additions & 25 deletions
This file was deleted.

core/src/main/resources/jenkins/model/MasterBuildConfiguration/config_es.properties

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)