Skip to content

Commit e6b7a10

Browse files
Merge branch 'master' into migrate_to_junit5_test_1
# Conflicts: # test/src/test/java/hudson/logging/LogRecorderManagerTest.java
2 parents d24a4e8 + 3f79665 commit e6b7a10

File tree

72 files changed

+1072
-1701
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1072
-1701
lines changed

.github/renovate.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@
2323
"team:sig-ux"
2424
]
2525
},
26-
{
27-
"matchPackageNames": [
28-
"node"
29-
],
30-
"allowedVersions": "/20.[0-9]+.[0-9]+(.[0-9]+)?$/"
31-
},
3226
{
3327
"description": "Should be upgraded in lockstep in order to keep their corresponding Jetty versions aligned",
3428
"matchManagers": [
@@ -124,7 +118,7 @@
124118
"<node.version>(?<currentValue>.*?)</node.version>"
125119
],
126120
"depNameTemplate": "node",
127-
"datasourceTemplate": "npm"
121+
"datasourceTemplate": "node-version"
128122
},
129123
{
130124
"customType": "regex",

bom/pom.xml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ THE SOFTWARE.
4141
<commons-fileupload2.version>2.0.0-M2</commons-fileupload2.version>
4242
<groovy.version>2.4.21</groovy.version>
4343
<jelly.version>1.1-jenkins-20250108</jelly.version>
44-
<stapler.version>1971.vf47a_d79853d7</stapler.version>
44+
<stapler.version>1979.v5048d87384d7</stapler.version>
4545
</properties>
4646

4747
<dependencyManagement>
@@ -206,11 +206,6 @@ THE SOFTWARE.
206206
<artifactId>groovy-all</artifactId>
207207
<version>${groovy.version}</version>
208208
</dependency>
209-
<dependency>
210-
<groupId>org.connectbot</groupId>
211-
<artifactId>jbcrypt</artifactId>
212-
<version>1.0.2</version>
213-
</dependency>
214209
<dependency>
215210
<!-- Groovy shell uses this, but it doesn't declare the dependency -->
216211
<groupId>org.fusesource.jansi</groupId>

core/pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,6 @@ THE SOFTWARE.
246246
<groupId>org.codehaus.groovy</groupId>
247247
<artifactId>groovy-all</artifactId>
248248
</dependency>
249-
<dependency>
250-
<groupId>org.connectbot</groupId>
251-
<artifactId>jbcrypt</artifactId>
252-
</dependency>
253249
<dependency>
254250
<!-- Groovy shell uses this, but it doesn't declare the dependency -->
255251
<groupId>org.fusesource.jansi</groupId>

core/src/main/java/hudson/PluginManager.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,6 +1557,10 @@ public HttpResponse doPluginsSearch(@QueryParameter String query, @QueryParamete
15571557
releaseTimestamp.put("displayValue", Messages.PluginManager_ago(Functions.getTimeSpanString(plugin.releaseTimestamp)));
15581558
jsonObject.put("releaseTimestamp", releaseTimestamp);
15591559
}
1560+
if (plugin.healthScore != null) {
1561+
jsonObject.put("healthScore", plugin.healthScore);
1562+
jsonObject.put("healthScoreClass", plugin.healthScoreClass);
1563+
}
15601564
return jsonObject;
15611565
})
15621566
.collect(toList());

core/src/main/java/hudson/PluginWrapper.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ public boolean hasDerivedDependencyErrors() {
222222
*/
223223
private static Set<String> CORE_ONLY_DEPENDANT = Set.of("jenkins-core");
224224

225+
private Integer healthScore;
226+
225227
/**
226228
* Set the list of components that depend on this plugin.
227229
* @param dependents The list of components that depend on this plugin.
@@ -423,6 +425,32 @@ public void injectJarsToClasspath(File... jars) throws Exception {
423425

424426
}
425427

428+
@Restricted(NoExternalUse.class) // Jelly use only
429+
public Integer getHealthScore() {
430+
if (this.healthScore == null) {
431+
this.healthScore = getInfoFromAllSites().stream()
432+
.filter(Objects::nonNull)
433+
.filter(p -> p.healthScore != null)
434+
.findFirst()
435+
.map(plugin -> plugin.healthScore)
436+
.orElse(null);
437+
}
438+
return this.healthScore;
439+
}
440+
441+
@Restricted(NoExternalUse.class)
442+
public static String getHealthScoreClassForScore(int score) {
443+
if (score > 80) return "top";
444+
if (score > 60) return "middle";
445+
return "bottom";
446+
}
447+
448+
@Restricted(NoExternalUse.class) // Jelly use only
449+
public String getHealthScoreClass() {
450+
if (this.healthScore == null) return null;
451+
return getHealthScoreClassForScore(this.healthScore);
452+
}
453+
426454
@ExportedBean
427455
public static final class Dependency {
428456
@Exported

core/src/main/java/hudson/console/AnnotatedLargeText.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,10 @@ public void doProgressiveText(StaplerRequest req, StaplerResponse rsp) throws IO
141141
* and use this request attribute to differentiate.
142142
*/
143143
private boolean isHtml() {
144-
StaplerRequest2 req = Stapler.getCurrentRequest2();
144+
return isHtml(Stapler.getCurrentRequest2());
145+
}
146+
147+
private boolean isHtml(StaplerRequest2 req) {
145148
return req != null && req.getAttribute("html") != null;
146149
}
147150

@@ -207,6 +210,11 @@ public long writeLogTo(long start, Writer w) throws IOException {
207210
return super.writeLogTo(start, w);
208211
}
209212

213+
@Override
214+
protected boolean delegateToWriteLogTo(StaplerRequest2 req, StaplerResponse2 rsp) {
215+
return isHtml(req);
216+
}
217+
210218
/**
211219
* Strips annotations using a {@link PlainTextConsoleOutputStream}.
212220
* {@inheritDoc}

core/src/main/java/hudson/console/ConsoleAnnotator.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ public ConsoleAnnotator annotate(T context, MarkupText text) {
118118
default: return this;
119119
}
120120
}
121+
122+
@Override
123+
public String toString() {
124+
return "ConsoleAnnotatorAggregator" + list;
125+
}
121126
}
122127

123128
/**

core/src/main/java/hudson/logging/LogRecorder.java

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import hudson.BulkChange;
3232
import hudson.Extension;
3333
import hudson.FilePath;
34-
import hudson.RestrictedSince;
3534
import hudson.Util;
3635
import hudson.XmlFile;
3736
import hudson.model.AbstractModelObject;
@@ -43,7 +42,6 @@
4342
import hudson.remoting.Channel;
4443
import hudson.remoting.VirtualChannel;
4544
import hudson.slaves.ComputerListener;
46-
import hudson.util.CopyOnWriteList;
4745
import hudson.util.FormApply;
4846
import hudson.util.FormValidation;
4947
import hudson.util.HttpResponses;
@@ -104,15 +102,6 @@
104102
public class LogRecorder extends AbstractModelObject implements Loadable, Saveable {
105103
private volatile String name;
106104

107-
/**
108-
* No longer used.
109-
*
110-
* @deprecated use {@link #getLoggers()}
111-
*/
112-
@Deprecated
113-
@Restricted(NoExternalUse.class)
114-
@RestrictedSince("2.324")
115-
public final transient CopyOnWriteList<Target> targets = new CopyOnWriteList<>();
116105
private List<Target> loggers = new ArrayList<>();
117106
private static final TargetComparator TARGET_COMPARATOR = new TargetComparator();
118107

@@ -124,22 +113,6 @@ public LogRecorder(String name) {
124113
new WeakLogHandler(handler, Logger.getLogger(""));
125114
}
126115

127-
private Object readResolve() {
128-
if (loggers == null) {
129-
loggers = new ArrayList<>();
130-
}
131-
132-
List<Target> tempLoggers = new ArrayList<>(loggers);
133-
134-
if (!targets.isEmpty()) {
135-
loggers.addAll(targets.getView());
136-
}
137-
if (!tempLoggers.isEmpty() && !targets.getView().equals(tempLoggers)) {
138-
targets.addAll(tempLoggers);
139-
}
140-
return this;
141-
}
142-
143116
public List<Target> getLoggers() {
144117
return loggers;
145118
}
@@ -455,7 +428,6 @@ public synchronized void doConfigSubmit(StaplerRequest2 req, StaplerResponse2 rs
455428
recorders.remove(new LogRecorder(name));
456429
this.name = newName;
457430
recorders.add(this);
458-
getParent().setRecorders(recorders); // ensure that legacy logRecorders field is synced on save
459431
redirect = "../" + Util.rawEncode(newName) + '/';
460432
}
461433

@@ -491,31 +463,12 @@ public synchronized void load() throws IOException {
491463
public synchronized void save() throws IOException {
492464
if (BulkChange.contains(this)) return;
493465

494-
handlePluginUpdatingLegacyLogManagerMap();
495466
getConfigFile().write(this);
496467
loggers.forEach(Target::enable);
497468

498469
SaveableListener.fireOnChange(this, getConfigFile());
499470
}
500471

501-
@SuppressWarnings("deprecation") // this is for compatibility
502-
private void handlePluginUpdatingLegacyLogManagerMap() {
503-
if (getParent().logRecorders.size() > getParent().getRecorders().size()) {
504-
for (LogRecorder logRecorder : getParent().logRecorders.values()) {
505-
if (!getParent().getRecorders().contains(logRecorder)) {
506-
getParent().getRecorders().add(logRecorder);
507-
}
508-
}
509-
}
510-
if (getParent().getRecorders().size() > getParent().logRecorders.size()) {
511-
for (LogRecorder logRecorder : getParent().getRecorders()) {
512-
if (!getParent().logRecorders.containsKey(logRecorder.getName())) {
513-
getParent().logRecorders.put(logRecorder.getName(), logRecorder);
514-
}
515-
}
516-
}
517-
}
518-
519472
@Override
520473
public boolean equals(Object o) {
521474
if (this == o) {

core/src/main/java/hudson/logging/LogRecorderManager.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ public void load() throws IOException {
155155
lr.load();
156156
recorders.add(lr);
157157
}
158-
setRecorders(recorders); // ensure that legacy logRecorders field is synced on load
159158
}
160159

161160
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ public List<AbstractProject> getTiedJobs() {
782782
}
783783

784784
public RunList getBuilds() {
785-
return RunList.fromJobs((Iterable) Jenkins.get().allItems(Job.class)).node(getNode());
785+
return RunList.fromJobs((Iterable) Jenkins.get().allItems(AbstractProject.class)).node(getNode());
786786
}
787787

788788
/**

0 commit comments

Comments
 (0)