Skip to content

Commit

Permalink
Merge branch 'master' into add-icons-to-command-palette
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Dec 13, 2024
2 parents 809d2e6 + 7020e80 commit 674d508
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 21 deletions.
2 changes: 1 addition & 1 deletion bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ THE SOFTWARE.
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>6.2.0</version>
<version>6.2.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
5 changes: 3 additions & 2 deletions core/src/main/java/hudson/model/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
import jenkins.util.SystemProperties;
import org.jenkinsci.Symbol;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.Beta;
import org.kohsuke.accmod.restrictions.NoExternalUse;
import org.kohsuke.stapler.StaplerProxy;
import org.kohsuke.stapler.StaplerRequest2;
Expand Down Expand Up @@ -679,9 +680,9 @@ public void doSubmitDescription(StaplerRequest2 req, StaplerResponse2 rsp) throw
}

/**
* To be called from {@link Jenkins#reload} only.
* Called from {@link Jenkins#reload}.
*/
@Restricted(NoExternalUse.class)
@Restricted(Beta.class)
public static void reload() throws IOException {
UserIdMapper.getInstance().reload();
AllUsers.reload();
Expand Down
14 changes: 11 additions & 3 deletions core/src/main/java/jenkins/model/Jenkins.java
Original file line number Diff line number Diff line change
Expand Up @@ -3318,11 +3318,19 @@ public void load() throws IOException {
if (cfg.exists()) {
// reset some data that may not exist in the disk file
// so that we can take a proper compensation action later.
String originalPrimaryView = primaryView;
List<View> originalViews = new ArrayList<>(views);
primaryView = null;
views.clear();

// load from disk
cfg.unmarshal(Jenkins.this);
try {
// load from disk
cfg.unmarshal(Jenkins.this);
} catch (IOException | RuntimeException x) {
primaryView = originalPrimaryView;
views.clear();
views.addAll(originalViews);
throw x;
}
}
// initialize views by inserting the default view if necessary
// this is both for clean Jenkins and for backward compatibility.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@

package jenkins.model.experimentalflags;

import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.Nullable;
import hudson.Extension;
import jenkins.util.SystemProperties;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;

Expand All @@ -46,4 +48,10 @@ public String getDisplayName() {
public String getShortDescription() {
return "Remove YUI from all Jenkins UI pages. This will break anything that depends on YUI";
}

@NonNull
@Override
public Boolean getDefaultValue() {
return SystemProperties.getBoolean(RemoveYuiUserExperimentalFlag.class.getName() + ".defaultValue", true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,9 @@ THE SOFTWARE.
-->

<?jelly escape-by-default='true'?>
<st:include it="${it.primaryView}" page="sidepanel.jelly" xmlns:st="jelly:stapler" />
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler">
<j:set var="primaryView" value="${it.primaryView}"/>
<j:if test="${primaryView != null}">
<st:include it="${primaryView}" page="sidepanel.jelly"/>
</j:if>
</j:jelly>
2 changes: 1 addition & 1 deletion core/src/site/site.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<skin>
<groupId>org.apache.maven.skins</groupId>
<artifactId>maven-fluido-skin</artifactId>
<version>2.0.0</version>
<version>2.0.1</version>
</skin>
<custom>
<matomo>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ THE SOFTWARE.
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>10.20.2</version>
<version>10.21.0</version>
</dependency>
</dependencies>
<executions>
Expand Down
2 changes: 1 addition & 1 deletion test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ THE SOFTWARE.
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>cloudbees-folder</artifactId>
<version>6.969.v7d22c6eb_fde1</version>
<version>6.973.vc9b_85a_61e4fc</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
16 changes: 16 additions & 0 deletions test/src/test/java/jenkins/model/JenkinsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@
import static org.awaitility.Awaitility.await;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.arrayContaining;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.isA;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
Expand All @@ -46,6 +48,7 @@
import hudson.XmlFile;
import hudson.init.InitMilestone;
import hudson.init.Initializer;
import hudson.model.AllView;
import hudson.model.Computer;
import hudson.model.Failure;
import hudson.model.FreeStyleProject;
Expand Down Expand Up @@ -101,6 +104,7 @@
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.rules.TemporaryFolder;
import org.jvnet.hudson.reactor.ReactorException;
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.JenkinsRule.WebClient;
Expand Down Expand Up @@ -755,4 +759,16 @@ public String getUrlName() {
return null;
}
}

@Test
public void reloadViews() throws Exception {
assertThat(j.jenkins.getPrimaryView(), isA(AllView.class));
assertThat(j.jenkins.getViews(), contains(isA(AllView.class)));
Files.writeString(j.jenkins.getConfigFile().getFile().toPath(), "<broken");
assertThrows(ReactorException.class, j.jenkins::reload);
j.createWebClient().goTo("manage/");
assertThat(j.jenkins.getPrimaryView(), isA(AllView.class));
assertThat(j.jenkins.getViews(), contains(isA(AllView.class)));
}

}
2 changes: 1 addition & 1 deletion war/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ THE SOFTWARE.
<host>localhost</host>
<!-- HTTP listener port -->
<port>8080</port>
<mina-sshd-api.version>2.14.0-133.vcc091215a_358</mina-sshd-api.version>
<mina-sshd-api.version>2.14.0-136.v4d2b_0853615e</mina-sshd-api.version>
<!-- Minimum Remoting version, which is tested for API compatibility, duplicated so that renovate only updates the latest remoting version property -->
<remoting.minimum.supported.version>3107.v665000b_51092</remoting.minimum.supported.version>

Expand Down
10 changes: 0 additions & 10 deletions war/src/main/webapp/scripts/hudson-behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,16 +194,6 @@ var resURL = "not-defined-yet"; // eslint-disable-line no-unused-vars
}
})();

(function initializeYUIDebugLogReader() {
Behaviour.addLoadEvent(function () {
var logReaderElement = document.getElementById("yui-logreader");
if (logReaderElement !== null) {
var logReader = new YAHOO.widget.LogReader("yui-logreader");
logReader.collapse();
}
});
})();

// Form check code
//========================================================
var FormChecker = {
Expand Down

0 comments on commit 674d508

Please sign in to comment.