Skip to content

Commit

Permalink
Merge branch 'master' into move-manage-jenkins-less
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Jun 14, 2022
2 parents d1f42ac + 65fcda1 commit 28d0638
Show file tree
Hide file tree
Showing 45 changed files with 500 additions and 242 deletions.
27 changes: 27 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
tasks:
- init: |
mvn -am -pl war,bom -P quick-build clean install
command: |
mvn -pl war jetty:run -Dhost=0.0.0.0
name: Run
- command: gp await-port 8080 && gp url 8080 && gp preview $(gp url 8080)/jenkins/
name: Preview

github:
prebuilds:
pullRequestsFromForks: true
addBadge: true

jetbrains:
intellij:
plugins:
- Stapler plugin for IntelliJ IDEA
prebuilds:
version: stable

vscode:
extensions:
- vscjava.vscode-java-pack

image:
file: .gitpod/Dockerfile
4 changes: 4 additions & 0 deletions .gitpod/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM gitpod/workspace-full

RUN brew install gh && \
bash -c ". /home/gitpod/.sdkman/bin/sdkman-init.sh && sdk install maven 3.8.4 && sdk default maven 3.8.4"
82 changes: 1 addition & 81 deletions .idea/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion .mvn/jvm.config
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Xmx800m
-Xmx1100m
14 changes: 12 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ You can read a description of the [building and debugging process here].
If you want simply to build the `jenkins.war` file as fast as possible without tests, run:

```sh
mvn -am -pl war,bom -DskipTests -Dspotbugs.skip -Dspotless.check.skip clean install
mvn -am -pl war,bom -Pquick-build clean install
```

The WAR file will be created in `war/target/jenkins.war`.
Expand Down Expand Up @@ -62,6 +62,16 @@ On another terminal, move to the war folder and start a [webpack](https://webpac
cd war; yarn start
```

### Gitpod

You can open this project as a [Gitpod workspace](https://www.gitpod.io/) which comes pre-configured with all the tools you will need.
You can use IntelliJ IDEA (preferred) or VS Code (alternate) in the browser.

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/jenkinsci/jenkins)

If you prefer using IntelliJ IDEA, you can setup Gitpod integration with JetBrains Gateway using the instructions on [gitpod.io](https://www.gitpod.io/docs/ides-and-editors/intellij),
which will open the workspace in IntelliJ IDEA using JetBrains Gateway.

## Testing changes

Jenkins core includes unit and functional tests as a part of the repository.
Expand Down Expand Up @@ -220,4 +230,4 @@ just submit a pull request.
[Jenkins Pipeline]: https://www.jenkins.io/doc/book/pipeline/
[Jenkinsfile]: ./Jenkinsfile
[download Maven here]: https://maven.apache.org/download.cgi
[GitHub pull request]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests
[GitHub pull request]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests
11 changes: 7 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,20 @@ for (i = 0; i < buildTypes.size(); i++) {
'clean',
'install',
]
infra.runMaven(mavenOptions, jdk)
if (isUnix()) {
sh 'git add . && git diff --exit-code HEAD'
try {
infra.runMaven(mavenOptions, jdk)
if (isUnix()) {
sh 'git add . && git diff --exit-code HEAD'
}
} finally {
archiveArtifacts allowEmptyArchive: true, artifacts: '**/target/surefire-reports/*.dumpstream'
}
}
}
}

// Once we've built, archive the artifacts and the test results.
stage("${buildType} Publishing") {
archiveArtifacts allowEmptyArchive: true, artifacts: '**/target/surefire-reports/*.dumpstream'
if (!fileExists('core/target/surefire-reports/TEST-jenkins.Junit4TestsRanTest.xml')) {
error 'JUnit 4 tests are no longer being run for the core package'
}
Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/hudson/PluginManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
* @author Kohsuke Kawaguchi
*/
@ExportedBean
@SuppressFBWarnings(value = "THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION", justification = "TODO needs triage")
public abstract class PluginManager extends AbstractModelObject implements OnMaster, StaplerOverridable, StaplerProxy {
/** Custom plugin manager system property or context param. */
public static final String CUSTOM_PLUGIN_MANAGER = PluginManager.class.getName() + ".className";
Expand Down
7 changes: 7 additions & 0 deletions core/src/main/java/hudson/cli/declarative/CLIRegisterer.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import static java.util.logging.Level.SEVERE;

import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.AbortException;
import hudson.Extension;
import hudson.ExtensionComponent;
Expand Down Expand Up @@ -71,6 +72,12 @@
* @author Kohsuke Kawaguchi
*/
@Extension
@SuppressFBWarnings(
value = {
"THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION",
"THROWS_METHOD_THROWS_RUNTIMEEXCEPTION"
},
justification = "TODO needs triage")
public class CLIRegisterer extends ExtensionFinder {
@Override
public ExtensionComponentSet refresh() throws ExtensionRefreshException {
Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/hudson/model/AbstractItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
// Item doesn't necessarily have to be Actionable, but
// Java doesn't let multiple inheritance.
@ExportedBean
@SuppressFBWarnings(value = "THROWS_METHOD_THROWS_CLAUSE_THROWABLE", justification = "TODO needs triage")
public abstract class AbstractItem extends Actionable implements Item, HttpDeletable, AccessControlled, DescriptorByNameOwner, StaplerProxy {

private static final Logger LOGGER = Logger.getLogger(AbstractItem.class.getName());
Expand Down
7 changes: 7 additions & 0 deletions core/src/main/java/hudson/model/Executor.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.FilePath;
import hudson.Functions;
import hudson.Util;
Expand Down Expand Up @@ -89,6 +90,12 @@
* @author Kohsuke Kawaguchi
*/
@ExportedBean
@SuppressFBWarnings(
value = {
"THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION",
"THROWS_METHOD_THROWS_CLAUSE_THROWABLE"
},
justification = "TODO needs triage")
public class Executor extends Thread implements ModelObject {
protected final @NonNull Computer owner;
private final Queue queue;
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/java/hudson/model/ItemGroupMixIn.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

package hudson.model;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.Util;
import hudson.XmlFile;
import hudson.model.listeners.ItemListener;
Expand Down Expand Up @@ -61,6 +62,7 @@
* @author Kohsuke Kawaguchi
* @see ViewGroupMixIn
*/
@SuppressFBWarnings(value = "THROWS_METHOD_THROWS_CLAUSE_THROWABLE", justification = "TODO needs triage")
public abstract class ItemGroupMixIn {
/**
* {@link ItemGroup} for which we are working.
Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/hudson/model/Queue.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@
* @see QueueTaskDispatcher
*/
@ExportedBean
@SuppressFBWarnings(value = "THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION", justification = "TODO needs triage")
public class Queue extends ResourceController implements Saveable {

/**
Expand Down
6 changes: 6 additions & 0 deletions core/src/main/java/hudson/model/ResourceController.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@
* Controls mutual exclusion of {@link ResourceList}.
* @author Kohsuke Kawaguchi
*/
@SuppressFBWarnings(
value = {
"THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION",
"THROWS_METHOD_THROWS_CLAUSE_THROWABLE"
},
justification = "TODO needs triage")
public class ResourceController {
/**
* {@link ResourceList}s that are used by activities that are in progress.
Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/hudson/model/UpdateSite.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
* @since 1.333
*/
@ExportedBean
@SuppressFBWarnings(value = "THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION", justification = "TODO needs triage")
public class UpdateSite {
/**
* What's the time stamp of data file?
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/java/hudson/triggers/SafeTimerTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

package hudson.triggers;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.model.AperiodicWork;
import hudson.model.AsyncAperiodicWork;
import hudson.model.AsyncPeriodicWork;
Expand All @@ -47,6 +48,7 @@
* @author Kohsuke Kawaguchi
* @since 1.124
*/
@SuppressFBWarnings(value = "THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION", justification = "TODO needs triage")
public abstract class SafeTimerTask extends TimerTask {

/**
Expand Down
4 changes: 1 addition & 3 deletions core/src/main/java/hudson/util/FormFieldValidator.java
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,12 @@ private void _errorWithMarkup(String message, String cssClass) throws IOExceptio
ok();
} else {
response.setContentType("text/html;charset=UTF-8");
// 1x16 spacer needed for IE since it doesn't support min-height
if (APPLY_CONTENT_SECURITY_POLICY_HEADERS) {
for (String header : new String[]{"Content-Security-Policy", "X-WebKit-CSP", "X-Content-Security-Policy"}) {
response.setHeader(header, "sandbox; default-src 'none';");
}
}
response.getWriter().print("<div class=" + cssClass + "><img src='" +
request.getContextPath() + Jenkins.RESOURCE_PATH + "/images/none.gif' height=16 width=1>" +
response.getWriter().print("<div class=" + cssClass + ">" +
message + "</div>");
}
}
Expand Down
7 changes: 2 additions & 5 deletions core/src/main/java/hudson/util/FormFillFailure.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import java.util.Locale;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletResponse;
import jenkins.model.Jenkins;
import org.kohsuke.stapler.HttpResponse;
import org.kohsuke.stapler.Stapler;
import org.kohsuke.stapler.StaplerRequest;
Expand Down Expand Up @@ -95,7 +94,7 @@ private static FormFillFailure _error(FormValidation.Kind kind, Throwable e, Str
}

return _errorWithMarkup(Util.escape(message) +
" <a href='#' class='showDetails'>"
" </div><div><a href='#' class='showDetails'>"
+ Messages.FormValidation_Error_Details()
+ "</a><pre style='display:none'>"
+ Util.escape(Functions.printThrowable(e)) +
Expand Down Expand Up @@ -137,9 +136,7 @@ public String renderHtml() {
if (req == null) { // being called from some other context
return message;
}
// 1x16 spacer needed for IE since it doesn't support min-height
return "<div class=" + getKind().name().toLowerCase(Locale.ENGLISH) + "><img src='" +
req.getContextPath() + Jenkins.RESOURCE_PATH + "/images/none.gif' height=16 width=1>" +
return "<div class=" + getKind().name().toLowerCase(Locale.ENGLISH) + ">" +
message + "</div>";
}

Expand Down
6 changes: 2 additions & 4 deletions core/src/main/java/hudson/util/FormValidation.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ private static FormValidation _error(Kind kind, Throwable e, String message) {
if (e == null) return _errorWithMarkup(Util.escape(message), kind);

return _errorWithMarkup(Util.escape(message) +
" <a href='#' class='showDetails'>"
" </div><div><a href='#' class='showDetails'>"
+ Messages.FormValidation_Error_Details()
+ "</a><pre style='display:none'>"
+ Util.escape(Functions.printThrowable(e)) +
Expand Down Expand Up @@ -272,9 +272,7 @@ public String renderHtml() {
if (req == null) { // being called from some other context
return message;
}
// 1x16 spacer needed for IE since it doesn't support min-height
return "<div class=" + kind.name().toLowerCase(Locale.ENGLISH) + "><img src='" +
req.getContextPath() + Jenkins.RESOURCE_PATH + "/images/none.gif' height=16 width=1>" +
return "<div class=\"" + kind.name().toLowerCase(Locale.ENGLISH) + "\">" +
message + "</div>";
}

Expand Down
2 changes: 2 additions & 0 deletions core/src/main/java/hudson/util/InterceptingProxy.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package hudson.util;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
Expand All @@ -10,6 +11,7 @@
*
* @author Kohsuke Kawaguchi
*/
@SuppressFBWarnings(value = "THROWS_METHOD_THROWS_CLAUSE_THROWABLE", justification = "TODO needs triage")
public abstract class InterceptingProxy {
/**
* Intercepts every method call.
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/java/hudson/util/RobustReflectionConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import com.thoughtworks.xstream.mapper.Mapper;
import com.thoughtworks.xstream.security.InputManipulationException;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.diagnosis.OldDataMonitor;
import hudson.model.Saveable;
import hudson.security.ACL;
Expand Down Expand Up @@ -77,6 +78,7 @@
* </ul>
*
*/
@SuppressFBWarnings(value = "THROWS_METHOD_THROWS_RUNTIMEEXCEPTION", justification = "TODO needs triage")
@SuppressWarnings({"rawtypes", "unchecked"})
public class RobustReflectionConverter implements Converter {

Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/jenkins/model/Jenkins.java
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@
* @author Kohsuke Kawaguchi
*/
@ExportedBean
@SuppressFBWarnings(value = "THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION", justification = "TODO needs triage")
public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLevelItemGroup, StaplerProxy, StaplerFallback,
ModifiableViewGroup, AccessControlled, DescriptorByNameOwner,
ModelObjectWithContextMenu, ModelObjectWithChildren, OnMaster {
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/java/jenkins/model/Nodes.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.BulkChange;
import hudson.Util;
import hudson.XmlFile;
Expand Down Expand Up @@ -61,6 +62,7 @@
* @since 1.607
*/
@Restricted(NoExternalUse.class) // for now, we may make it public later
@SuppressFBWarnings(value = "THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION", justification = "TODO needs triage")
public class Nodes implements Saveable {

/**
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/java/jenkins/model/TransientActionFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.ExtensionList;
import hudson.ExtensionListListener;
import hudson.ExtensionPoint;
Expand All @@ -48,6 +49,7 @@
* @see Actionable#getAllActions
* @since 1.548
*/
@SuppressFBWarnings(value = "THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION", justification = "TODO needs triage")
public abstract class TransientActionFactory<T> implements ExtensionPoint {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

package jenkins.security;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.security.ACL;
import hudson.security.ACLContext;
import java.util.concurrent.Callable;
Expand All @@ -36,6 +37,7 @@
* @see SecurityContextExecutorService
* @since 2.51
*/
@SuppressFBWarnings(value = "THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION", justification = "TODO needs triage")
public final class ImpersonatingExecutorService extends InterceptingExecutorService {

private final Authentication authentication;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

package jenkins.security;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.security.ACL;
import hudson.security.ACLContext;
import java.util.concurrent.Callable;
Expand All @@ -35,6 +36,7 @@
* Variant of {@link ImpersonatingExecutorService} for scheduled services.
* @since 2.51
*/
@SuppressFBWarnings(value = "THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION", justification = "TODO needs triage")
public final class ImpersonatingScheduledExecutorService extends InterceptingScheduledExecutorService {

private final Authentication authentication;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import static org.springframework.security.core.context.SecurityContextHolder.getContext;
import static org.springframework.security.core.context.SecurityContextHolder.setContext;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import jenkins.util.InterceptingExecutorService;
Expand All @@ -43,6 +44,7 @@
* @author Kohsuke Kawaguchi
* @since 1.561
*/
@SuppressFBWarnings(value = "THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION", justification = "TODO needs triage")
public class SecurityContextExecutorService extends InterceptingExecutorService {

public SecurityContextExecutorService(ExecutorService service) {
Expand Down
Loading

0 comments on commit 28d0638

Please sign in to comment.