Skip to content

Commit

Permalink
Merge branch 'master' into oklch
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Jan 5, 2025
2 parents f3a0705 + 8e68fdd commit 34a84d0
Show file tree
Hide file tree
Showing 38 changed files with 408 additions and 386 deletions.
1 change: 1 addition & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"postUpdateOptions": [
"yarnDedupeHighest"
],
"ignoreDeps": ["softprops/action-gh-release"],
"packageRules": [
{
"matchDatasources": [
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/publish-release-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
wget -q https://get.jenkins.io/${REPO}/${PROJECT_VERSION}/${FILE_NAME}
- name: Upload Release Asset
id: upload-war
uses: softprops/action-gh-release@7b4da11513bf3f43f9999e90eabced41ab8bb048 # v2.2.0
uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974 # v2.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
- name: Upload Release Asset
id: upload-deb
if: always()
uses: softprops/action-gh-release@7b4da11513bf3f43f9999e90eabced41ab8bb048 # v2.2.0
uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974 # v2.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down Expand Up @@ -144,7 +144,7 @@ jobs:
- name: Upload Release Asset
id: upload-rpm
if: always()
uses: softprops/action-gh-release@7b4da11513bf3f43f9999e90eabced41ab8bb048 # v2.2.0
uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974 # v2.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down Expand Up @@ -180,7 +180,7 @@ jobs:
- name: Upload Release Asset
id: upload-msi
if: always()
uses: softprops/action-gh-release@7b4da11513bf3f43f9999e90eabced41ab8bb048 # v2.2.0
uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974 # v2.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down Expand Up @@ -216,7 +216,7 @@ jobs:
- name: Upload Release Asset
id: upload-suse-rpm
if: always()
uses: softprops/action-gh-release@7b4da11513bf3f43f9999e90eabced41ab8bb048 # v2.2.0
uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974 # v2.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-since-updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
id: run_script
shell: bash
- name: Create Pull Request
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Fill in since annotations
Expand Down
1 change: 0 additions & 1 deletion .stylelintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ module.exports = {
],
},
],
"color-function-notation": "legacy",
"alpha-value-notation": "number",
"number-max-precision": 5,
"function-no-unknown": null,
Expand Down
2 changes: 1 addition & 1 deletion bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ THE SOFTWARE.
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>5.15.0</version>
<version>5.16.0</version>
</dependency>
<dependency>
<groupId>net.java.sezpoz</groupId>
Expand Down
29 changes: 12 additions & 17 deletions core/src/main/java/hudson/cli/CLICommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ public int main(List<String> args, Locale locale, InputStream stdin, PrintStream
this.stdout = stdout;
this.stderr = stderr;
this.locale = locale;
registerOptionHandlers();
CmdLineParser p = getCmdLineParser();

// add options from the authenticator
Expand Down Expand Up @@ -527,20 +526,6 @@ protected CLICommand createClone() {
}
}

/**
* Auto-discovers {@link OptionHandler}s and add them to the given command line parser.
*/
protected void registerOptionHandlers() {
try {
for (Class c : Index.list(OptionHandlerExtension.class, Jenkins.get().pluginManager.uberClassLoader, Class.class)) {
Type t = Types.getBaseClass(c, OptionHandler.class);
CmdLineParser.registerHandler(Types.erasure(Types.getTypeArgument(t, 0)), c);
}
} catch (IOException e) {
throw new Error(e);
}
}

/**
* Returns all the registered {@link CLICommand}s.
*/
Expand Down Expand Up @@ -577,11 +562,21 @@ public static CLICommand getCurrent() {

static {
// register option handlers that are defined
ClassLoaders cls = new ClassLoaders();
Jenkins j = Jenkins.getInstanceOrNull();
if (j != null) { // only when running on the controller
cls.put(j.getPluginManager().uberClassLoader);
// Register OptionHandlers through META-INF/services/annotations and Annotation Indexer
try {
for (Class c : Index.list(OptionHandlerExtension.class, Jenkins.get().pluginManager.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 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ protected CmdLineParser getCmdLineParser() {

private CmdLineParser bindMethod(List<MethodBinder> binders) {

registerOptionHandlers();
ParserProperties properties = ParserProperties.defaults().withAtSyntax(ALLOW_AT_SYNTAX);
CmdLineParser parser = new CmdLineParser(null, properties);

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

/**
* {@link OptionHandler}s that should be auto-discovered.
* TODO is this actually necessary? {@code @MetaInfServices(OptionHandler.class)} seems to work as well.
* @author Kohsuke Kawaguchi
*/
@Indexed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@

package hudson.cli.handlers;

import hudson.cli.declarative.OptionHandlerExtension;
import hudson.model.AbstractItem;
import org.kohsuke.MetaInfServices;
import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.OptionDef;
import org.kohsuke.args4j.spi.OptionHandler;
import org.kohsuke.args4j.spi.Setter;

/**
* Refers to an {@link AbstractItem} by name.
* @since 1.538
*/
@MetaInfServices(OptionHandler.class) public class AbstractItemOptionHandler extends GenericItemOptionHandler<AbstractItem> {
@OptionHandlerExtension
public class AbstractItemOptionHandler extends GenericItemOptionHandler<AbstractItem> {

public AbstractItemOptionHandler(CmdLineParser parser, OptionDef option, Setter<AbstractItem> setter) {
super(parser, option, setter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,18 @@

package hudson.cli.handlers;

import hudson.cli.declarative.OptionHandlerExtension;
import hudson.model.AbstractProject;
import org.kohsuke.MetaInfServices;
import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.OptionDef;
import org.kohsuke.args4j.spi.OptionHandler;
import org.kohsuke.args4j.spi.Setter;

/**
* Refer to {@link AbstractProject} by its name.
*
* @author Kohsuke Kawaguchi
*/
@MetaInfServices(OptionHandler.class)
@OptionHandlerExtension
@SuppressWarnings("rawtypes")
public class AbstractProjectOptionHandler extends GenericItemOptionHandler<AbstractProject> {
public AbstractProjectOptionHandler(CmdLineParser parser, OptionDef option, Setter<AbstractProject> setter) {
Expand Down
5 changes: 2 additions & 3 deletions core/src/main/java/hudson/cli/handlers/JobOptionHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,18 @@

package hudson.cli.handlers;

import hudson.cli.declarative.OptionHandlerExtension;
import hudson.model.Job;
import org.kohsuke.MetaInfServices;
import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.OptionDef;
import org.kohsuke.args4j.spi.OptionHandler;
import org.kohsuke.args4j.spi.Setter;

/**
* Refer to {@link Job} by its name.
*
* @author Kohsuke Kawaguchi
*/
@MetaInfServices(OptionHandler.class)
@OptionHandlerExtension
@SuppressWarnings("rawtypes")
public class JobOptionHandler extends GenericItemOptionHandler<Job> {
public JobOptionHandler(CmdLineParser parser, OptionDef option, Setter<Job> setter) {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/hudson/cli/handlers/NodeOptionHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

package hudson.cli.handlers;

import hudson.cli.declarative.OptionHandlerExtension;
import hudson.model.Node;
import jenkins.model.Jenkins;
import org.kohsuke.MetaInfServices;
import org.kohsuke.args4j.CmdLineException;
import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.OptionDef;
Expand All @@ -40,7 +40,7 @@
* @author ogondza
* @since 1.526
*/
@MetaInfServices
@OptionHandlerExtension
public class NodeOptionHandler extends OptionHandler<Node> {

public NodeOptionHandler(CmdLineParser parser, OptionDef option, Setter<Node> setter) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,19 @@

package hudson.cli.handlers;

import hudson.cli.declarative.OptionHandlerExtension;
import jenkins.model.ParameterizedJobMixIn;
import org.kohsuke.MetaInfServices;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.DoNotUse;
import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.OptionDef;
import org.kohsuke.args4j.spi.OptionHandler;
import org.kohsuke.args4j.spi.Setter;

/**
* Refer to {@link jenkins.model.ParameterizedJobMixIn.ParameterizedJob} by its name.
*/
@Restricted(DoNotUse.class)
@MetaInfServices(OptionHandler.class)
@OptionHandlerExtension
@SuppressWarnings("rawtypes")
public class ParameterizedJobOptionHandler extends GenericItemOptionHandler<ParameterizedJobMixIn.ParameterizedJob> {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
package hudson.cli.handlers;

import hudson.cli.declarative.OptionHandlerExtension;
import hudson.model.TopLevelItem;
import org.kohsuke.MetaInfServices;
import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.OptionDef;
import org.kohsuke.args4j.spi.OptionHandler;
import org.kohsuke.args4j.spi.Setter;

/**
* Refers to {@link TopLevelItem} by its name.
*
* @author Kohsuke Kawaguchi
*/
@MetaInfServices(OptionHandler.class)
@OptionHandlerExtension
public class TopLevelItemOptionHandler extends GenericItemOptionHandler<TopLevelItem> {
public TopLevelItemOptionHandler(CmdLineParser parser, OptionDef option, Setter<TopLevelItem> setter) {
super(parser, option, setter);
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/hudson/cli/handlers/ViewOptionHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
package hudson.cli.handlers;

import edu.umd.cs.findbugs.annotations.CheckForNull;
import hudson.cli.declarative.OptionHandlerExtension;
import hudson.model.View;
import hudson.model.ViewGroup;
import java.util.StringTokenizer;
import jenkins.model.Jenkins;
import org.kohsuke.MetaInfServices;
import org.kohsuke.args4j.CmdLineException;
import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.OptionDef;
Expand Down Expand Up @@ -58,7 +58,7 @@
* @author ogondza
* @since 1.538
*/
@MetaInfServices
@OptionHandlerExtension
public class ViewOptionHandler extends OptionHandler<View> {

public ViewOptionHandler(CmdLineParser parser, OptionDef option, Setter<View> setter) {
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/resources/hudson/model/Job/_api.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ THE SOFTWARE.
<h2>Retrieving all builds</h2>
<p>
To prevent Jenkins from having to load all builds from disk when someone accesses the job API, the <code>builds</code>
tree only contains the 50 newest builds. If you really need to get all builds, access the <code>allBuilds</code> tree,
tree only contains the 100 newest builds. If you really need to get all builds, access the <code>allBuilds</code> tree,
e.g. by fetching <code>…/api/xml?tree=allBuilds[…]</code>. Note that this may result in significant performance degradation
if you have a lot of builds in this job.
</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Please\ wait\ while\ Jenkins\ is\ getting\ ready\ to\ work=\
Jenkins is getting ready to work
Your\ browser\ will\ reload\ automatically\ when\ Jenkins\ is\ ready=\
Your browser will reload automatically when Jenkins is ready
Your browser will reload automatically when Jenkins is ready.
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Please\ wait\ while\ Jenkins\ is\ restarting=\
Jenkins is restarting
Your\ browser\ will\ reload\ automatically\ when\ Jenkins\ is\ ready=Your browser will reload automatically when Jenkins is ready.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ java.util.HashMap
java.util.HashSet
java.util.Hashtable
java.util.ImmutableCollections$List12
java.util.ImmutableCollections$ListN
java.util.LinkedHashMap
java.util.LinkedHashSet
java.util.LinkedList
Expand Down
Loading

0 comments on commit 34a84d0

Please sign in to comment.