Skip to content

Commit

Permalink
Merge branch 'master' into experimental-details-widget
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik authored Jan 13, 2025
2 parents 7f11407 + e3e3c45 commit d6cf74c
Show file tree
Hide file tree
Showing 218 changed files with 122 additions and 85,112 deletions.
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ node/

# libraries / external deps / generated files
src/main/js/plugin-setup-wizard/bootstrap-detached.js
war/src/main/webapp/scripts/yui
war/src/main/webapp/jsbundles/
src/main/scss/_bootstrap.scss

Expand Down
17 changes: 11 additions & 6 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ THE SOFTWARE.
<commons-fileupload2.version>2.0.0-M2</commons-fileupload2.version>
<groovy.version>2.4.21</groovy.version>
<jelly.version>1.1-jenkins-20250108</jelly.version>
<stapler.version>1940.v41211a_a_b_b_d8b_</stapler.version>
<stapler.version>1942.v708e07325402</stapler.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -132,11 +132,6 @@ THE SOFTWARE.
<artifactId>commons-io</artifactId>
<version>2.18.0</version>
</dependency>
<dependency>
<groupId>commons-jelly</groupId>
<artifactId>commons-jelly-tags-xml</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
Expand Down Expand Up @@ -243,11 +238,21 @@ THE SOFTWARE.
<artifactId>annotation-indexer</artifactId>
<version>1.18</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci</groupId>
<artifactId>commons-jelly</artifactId>
<version>${jelly.version}</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci</groupId>
<artifactId>commons-jelly-tags-fmt</artifactId>
<version>${jelly.version}</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci</groupId>
<artifactId>commons-jelly-tags-xml</artifactId>
<version>${jelly.version}</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci</groupId>
<artifactId>commons-jexl</artifactId>
Expand Down
48 changes: 14 additions & 34 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,40 +166,6 @@ THE SOFTWARE.
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>commons-jelly</groupId>
<artifactId>commons-jelly-tags-xml</artifactId>
<exclusions>
<exclusion>
<groupId>commons-jelly</groupId>
<artifactId>commons-jelly</artifactId>
</exclusion>
<exclusion>
<groupId>commons-jelly</groupId>
<artifactId>commons-jelly-tags-junit</artifactId>
</exclusion>
<exclusion>
<groupId>commons-jexl</groupId>
<artifactId>commons-jexl</artifactId>
</exclusion>
<exclusion>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
</exclusion>
<exclusion>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
</exclusion>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<!-- Jenkins doesn't use this directly, but some plugins wanted to use the latest -->
<groupId>commons-lang</groupId>
Expand Down Expand Up @@ -310,6 +276,20 @@ THE SOFTWARE.
<groupId>org.jenkins-ci</groupId>
<artifactId>commons-jelly-tags-fmt</artifactId>
</dependency>
<dependency>
<groupId>org.jenkins-ci</groupId>
<artifactId>commons-jelly-tags-xml</artifactId>
<exclusions>
<exclusion>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
</exclusion>
<exclusion>
<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jenkins-ci</groupId>
<artifactId>commons-jexl</artifactId>
Expand Down
15 changes: 6 additions & 9 deletions core/src/main/java/hudson/Functions.java
Original file line number Diff line number Diff line change
Expand Up @@ -668,17 +668,14 @@ public static String validateIconSize(String iconSize) throws SecurityException
}

/**
* Gets the suffix to use for YUI JavaScript.
*/
public static String getYuiSuffix() {
return DEBUG_YUI ? "debug" : "min";
}

/**
* Set to true if you need to use the debug version of YUI.
* No longer used, to be removed after enough plugins have adopted a version of the test harness with
* <a href="https://github.com/jenkinsci/jenkins-test-harness/pull/874">jenkins-test-harness/pull/874</a> in it.
*
* @deprecated removed without replacement
*/
@SuppressFBWarnings(value = "MS_SHOULD_BE_FINAL", justification = "for script console")
public static boolean DEBUG_YUI = SystemProperties.getBoolean("debug.YUI");
@Deprecated(forRemoval = true, since = "TODO")
public static boolean DEBUG_YUI;

/**
* Creates a sub map by using the given range (both ends inclusive).
Expand Down
21 changes: 1 addition & 20 deletions core/src/main/java/hudson/cli/CLICommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@
import java.util.logging.Logger;
import jenkins.model.Jenkins;
import jenkins.util.SystemProperties;
import org.apache.commons.discovery.ResourceClassIterator;
import org.apache.commons.discovery.ResourceNameIterator;
import org.apache.commons.discovery.resource.ClassLoaders;
import org.apache.commons.discovery.resource.classes.DiscoverClasses;
import org.apache.commons.discovery.resource.names.DiscoverServiceNames;
import org.jvnet.hudson.annotation_indexer.Index;
import org.jvnet.tiger_types.Types;
import org.kohsuke.accmod.Restricted;
Expand Down Expand Up @@ -566,27 +561,13 @@ public static CLICommand getCurrent() {
if (j != null) { // only when running on the controller
// Register OptionHandlers through META-INF/services/annotations and Annotation Indexer
try {
for (Class c : Index.list(OptionHandlerExtension.class, Jenkins.get().pluginManager.uberClassLoader, Class.class)) {
for (Class c : Index.list(OptionHandlerExtension.class, j.getPluginManager().uberClassLoader, Class.class)) {
Type t = Types.getBaseClass(c, OptionHandler.class);
CmdLineParser.registerHandler(Types.erasure(Types.getTypeArgument(t, 0)), c);
}
} catch (IOException e) {
throw new UncheckedIOException(e);
}

// Register OptionHandlers through META-INF/services and Commons Discovery
ClassLoaders cls = new ClassLoaders();
cls.put(j.getPluginManager().uberClassLoader);
ResourceNameIterator servicesIter =
new DiscoverServiceNames(cls).findResourceNames(OptionHandler.class.getName());
final ResourceClassIterator itr =
new DiscoverClasses(cls).findResourceClasses(servicesIter);

while (itr.hasNext()) {
Class h = itr.nextResourceClass().loadClass();
Class c = Types.erasure(Types.getTypeArgument(Types.getBaseClass(h, OptionHandler.class), 0));
CmdLineParser.registerHandler(c, h);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
/**
* Refers to an {@link Item} by its name.
* May be subclassed to handle specific kinds of items.
* (Use {@code @MetaInfServices(OptionHandler.class)} to register the subclass.)
* (Use {@code @OptionHandlerExtension} to register the subclass.)
* @param <T> the kind of item being handled
* @since 1.538
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,10 @@ public GroupDetails loadGroupByGroupname(String groupname) throws org.acegisecur
class Authenticator extends AbstractUserDetailsAuthenticationProvider {
@Override
protected void additionalAuthenticationChecks(UserDetails userDetails, UsernamePasswordAuthenticationToken authentication) throws AuthenticationException {
// authentication is assumed to be done already in the retrieveUser method
// Authentication is done in the retrieveUser method. Note that this method being a no-op is only safe
// because we use Spring Security's default NullUserCache. If caching was enabled, it would be possible to
// log in as any cached user with any password unless we updated this method to check the provided
// authentication as recommended in the superclass method's documentation, so be careful reusing this code.
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import hudson.Extension;
import hudson.ExtensionList;
import hudson.security.Permission;
import hudson.util.DescribableList;
import java.io.IOException;
import java.util.List;
Expand Down Expand Up @@ -64,6 +65,11 @@ public DescribableList<GlobalBuildDiscarderStrategy, GlobalBuildDiscarderStrateg
return configuredBuildDiscarders;
}

@Override
public Permission getRequiredGlobalConfigPagePermission() {
return Jenkins.MANAGE;
}

@Override
public boolean configure(StaplerRequest2 req, JSONObject json) throws FormException {
try {
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion core/src/main/resources/lib/form/repeatable/repeatable.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ var repeatableSupport = {
};

// do the ones that extract innerHTML so that they can get their original HTML before
// other behavior rules change them (like YUI buttons.)
// other behavior rules change them.
Behaviour.specify("DIV.repeated-container", "repeatable", -100, function (e) {
if (isInsideRemovable(e)) {
return;
Expand Down
4 changes: 3 additions & 1 deletion core/src/main/resources/lib/layout/copyButton.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ THE SOFTWARE.
message="${attrs.message ?: '%Copied'}"
tooltip="${attrs.label != null ? null : attrs.tooltip ?: '%Copy'}"
type="button">
<span class="jenkins-copy-button__icon" />
<span class="jenkins-copy-button__icon">
<l:icon src="symbol-check" />
</span>
${attrs.label}
</button>

Expand Down
6 changes: 4 additions & 2 deletions core/src/main/resources/lib/layout/copyButton/copyButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ Behaviour.specify(
navigator.clipboard
.writeText(text)
.then(() => {
// Show the completion message
hoverNotification(copyButton.getAttribute("message"), copyButton);
copyButton.classList.add("jenkins-copy-button--copied");
setTimeout(() => {
copyButton.classList.remove("jenkins-copy-button--copied");
}, 2000);
})
.catch(() => {
hoverNotification(
Expand Down
30 changes: 1 addition & 29 deletions core/src/main/resources/lib/layout/layout.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -128,37 +128,9 @@ THE SOFTWARE.

<st:adjunct includes="org.kohsuke.stapler.bind"/>

<l:userExperimentalFlag var="removeYUI" flagClassName="jenkins.model.experimentalflags.RemoveYuiUserExperimentalFlag" />
<j:if test="${!removeYUI}">
<!-- To use the debug version of YUI, set the system property 'debug.YUI' to true -->
<j:set var="yuiSuffix" value="${h.yuiSuffix}" />
<l:yui module="yahoo" />
<l:yui module="dom" />
<l:yui module="event" />
<j:if test="${h.yuiSuffix=='debug'}">
<l:yui module="logger" />
</j:if>
<l:yui module="animation" />
<l:yui module="dragdrop" />
<l:yui module="container" />
<l:yui module="connection" />
<l:yui module="datasource" />
<l:yui module="autocomplete" />
<l:yui module="menu" />
<l:yui module="element" />
<l:yui module="button" />
<l:yui module="storage" />
</j:if>

<script src="${resURL}/scripts/hudson-behavior.js" type="text/javascript"></script>
<script src="${resURL}/scripts/sortable.js" type="text/javascript"/>

<j:if test="${!removeYUI}">
<link rel="stylesheet" href="${resURL}/scripts/yui/container/assets/container.css" type="text/css"/>
<link rel="stylesheet" href="${resURL}/scripts/yui/container/assets/skins/sam/container.css" type="text/css"/>
<link rel="stylesheet" href="${resURL}/scripts/yui/menu/assets/skins/sam/menu.css" type="text/css" />
</j:if>

<l:hasPermission permission="${app.READ}">
<link rel="search" type="application/opensearchdescription+xml" href="${rootURL}/opensearch.xml" title="Jenkins" />
</l:hasPermission>
Expand All @@ -178,7 +150,7 @@ THE SOFTWARE.
<script src="${resURL}/jsbundles/sortable-drag-drop.js" type="text/javascript"/>
<script src="${resURL}/jsbundles/app.js" type="text/javascript" defer="true" />
</head>
<body id="jenkins" class="${removeYUI ? '' : 'yui-skin-sam'} ${layoutType} jenkins-${h.version}" data-version="${h.version}" data-model-type="${it.class.name}">
<body id="jenkins" class="${layoutType} jenkins-${h.version}" data-version="${h.version}" data-model-type="${it.class.name}">
<l:command-palette />

<j:if test="${layoutType!='full-screen'}">
Expand Down
7 changes: 1 addition & 6 deletions core/src/main/resources/lib/layout/side-panel.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,7 @@ THE SOFTWARE.

<j:if test="${mode=='side-panel'}">
<div id="side-panel" class="app-page-body__sidebar ${attrs.sticky == 'true' ? 'app-page-body__sidebar--sticky' : ''}">
<d:invokeBody />
<!-- add YUI logger if debugging YUI -->
<j:if test="${h.yuiSuffix=='debug'}">
<!-- script to transform this into the Logger Console is done in hudson-behavior.js -->
<div id="yui-logreader" style="margin-top:1em"/>
</j:if>
<d:invokeBody />
</div>
</j:if>

Expand Down
13 changes: 3 additions & 10 deletions core/src/main/resources/lib/layout/yui.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,9 @@ THE SOFTWARE.
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler">
<st:documentation>
Load Yahoo UI module.
<st:attribute name="module" use="required">
YUI module name to load.
Do not use this tag, YUI has been removed from Jenkins
<st:attribute name="module" deprecated="true">
Do not use this tag, YUI has been removed from Jenkins
</st:attribute>
</st:documentation>
<!--
We used to take @suffix as '-beta' to loa beta modules, but as of YUI 2.9 there's no beta module.
I don't think YUI2 will get new beta modules in the future, but if we do, we need to compute them
from the module name, since older plugins specify suffix="-beta" for modules that have graduated
beta since then.
-->
<script src="${resURL}/scripts/yui/${module}/${module}-${yuiSuffix}.js" />
</j:jelly>
1 change: 0 additions & 1 deletion eslint.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ module.exports = [
".pnp.cjs",
".pnp.loader.mjs",
"src/main/js/plugin-setup-wizard/bootstrap-detached.js",
"war/src/main/webapp/scripts/yui/*",
],
},
{
Expand Down
Loading

0 comments on commit d6cf74c

Please sign in to comment.