Skip to content

Commit

Permalink
Merge branch 'master' into new-header
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Feb 22, 2025
2 parents 6df76ce + b97764d commit 5fae312
Show file tree
Hide file tree
Showing 9 changed files with 131 additions and 119 deletions.
6 changes: 2 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ Leave the proposed upgrade guidelines in the pull request with the "N/A" value i
The changelog generator relies on the presence of the upgrade guidelines section as part of its data extraction process.
-->

```[tasklist]
### Submitter checklist

- [ ] The Jira issue, if it exists, is well-described.
- [ ] The changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developers, depending on the change) and are in the imperative mood (see [examples](https://github.com/jenkins-infra/jenkins.io/blob/master/content/_data/changelogs/weekly.yml)). Fill in the **Proposed upgrade guidelines** section only if there are breaking changes or changes that may require extra steps from users during upgrade.
- [ ] There is automated testing or an explanation as to why this change has no tests.
Expand All @@ -90,7 +90,6 @@ The changelog generator relies on the presence of the upgrade guidelines section
- [ ] New or substantially changed JavaScript is not defined inline and does not call `eval` to ease future introduction of Content Security Policy (CSP) directives (see [documentation](https://www.jenkins.io/doc/developer/security/csp/)).
- [ ] For dependency updates, there are links to external changelogs and, if possible, full differentials.
- [ ] For new APIs and extension points, there is a link to at least one consumer.
```

### Desired reviewers

Expand All @@ -102,12 +101,11 @@ If you need an accelerated review process by the community (e.g., for critical b

Before the changes are marked as `ready-for-merge`:

```[tasklist]
### Maintainer checklist

- [ ] There are at least two (2) approvals for the pull request and no outstanding requests for change.
- [ ] Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
- [ ] Changelog entries in the pull request title and/or **Proposed changelog entries** are accurate, human-readable, and in the imperative mood.
- [ ] Proper changelog labels are set so that the changelog can be generated automatically.
- [ ] If the change needs additional upgrade steps from users, the `upgrade-guide-needed` label is set and there is a **Proposed upgrade guidelines** section in the pull request title (see [example](https://github.com/jenkinsci/jenkins/pull/4387)).
- [ ] If it would make sense to backport the change to LTS, a Jira issue must exist, be a _Bug_ or _Improvement_, and be labeled as `lts-candidate` to be considered (see [query](https://issues.jenkins.io/issues/?filter=12146)).
```
6 changes: 3 additions & 3 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>1948.v0f99403fe86a_</stapler.version>
<stapler.version>1955.vdb_2736b_480e3</stapler.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -71,7 +71,7 @@ THE SOFTWARE.
<!-- https://docs.spring.io/spring-security/reference/6.3/getting-spring-security.html#getting-maven-no-boot -->
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-bom</artifactId>
<version>6.4.2</version>
<version>6.4.3</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -104,7 +104,7 @@ THE SOFTWARE.
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.4</version>
<version>1.10.1</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
Expand Down
15 changes: 15 additions & 0 deletions core/src/main/java/hudson/model/Queue.java
Original file line number Diff line number Diff line change
Expand Up @@ -1615,6 +1615,9 @@ public void maintain() {
// Ensure that identification of blocked tasks is using the live state: JENKINS-27708 & JENKINS-27871
updateSnapshot();

// JENKINS-75152. Save the label and blockage reasons of items that have no candidates into this map.
// It is used to speed up the judgement of other buildable items with the same label.
Map<Label, List<CauseOfBlockage>> noCandidateLabelsMap = new HashMap<>();
// allocate buildable jobs to executors
for (BuildableItem p : new ArrayList<>(
buildables)) { // copy as we'll mutate the list in the loop
Expand All @@ -1641,6 +1644,13 @@ public void maintain() {
updateSnapshot();
}
} else {
// JENKINS-75152. Skip the remaining steps if the label of this item has been determined
// to have no candidate executors in the previous allocation process.
Label itemLabel = p.getAssignedLabel();
if (noCandidateLabelsMap.containsKey(itemLabel)) {
p.transientCausesOfBlockage = noCandidateLabelsMap.get(itemLabel);
continue;
}

List<JobOffer> candidates = new ArrayList<>(parked.size());
Map<Node, CauseOfBlockage> reasonMap = new HashMap<>();
Expand Down Expand Up @@ -1673,6 +1683,11 @@ public void maintain() {
new Object[]{p, candidates, parked.values()});
List<CauseOfBlockage> reasons = reasonMap.values().stream().filter(Objects::nonNull).collect(Collectors.toList());
p.transientCausesOfBlockage = reasons.isEmpty() ? null : reasons;
// If no candidates, save the label and blockage reasons.
if (candidates.isEmpty()) {
noCandidateLabelsMap.put(itemLabel, p.transientCausesOfBlockage);
LOGGER.log(Level.FINEST, "{0} changes to the state of no candidate executor", itemLabel);
}
continue;
}

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
},
"devDependencies": {
"@babel/cli": "7.26.4",
"@babel/core": "7.26.8",
"@babel/preset-env": "7.26.8",
"@babel/core": "7.26.9",
"@babel/preset-env": "7.26.9",
"@eslint/js": "9.20.0",
"babel-loader": "9.2.1",
"clean-webpack-plugin": "4.0.0",
Expand All @@ -43,7 +43,7 @@
"postcss-scss": "4.0.9",
"prettier": "3.5.1",
"sass": "1.85.0",
"sass-loader": "16.0.4",
"sass-loader": "16.0.5",
"style-loader": "4.0.0",
"stylelint": "16.14.1",
"stylelint-checkstyle-reporter": "1.0.0",
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ THE SOFTWARE.
</issueManagement>

<properties>
<revision>2.498</revision>
<revision>2.499</revision>
<changelist>-SNAPSHOT</changelist>
<project.build.outputTimestamp>2025-02-11T14:10:23Z</project.build.outputTimestamp>
<project.build.outputTimestamp>2025-02-18T14:10:14Z</project.build.outputTimestamp>

<!-- configuration for patch tracker plugin -->
<project.patchManagement.system>github</project.patchManagement.system>
Expand Down
12 changes: 6 additions & 6 deletions test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ THE SOFTWARE.
<!-- RequireUpperBoundDeps between bootstrap5-api and echarts-api -->
<groupId>io.jenkins.plugins</groupId>
<artifactId>font-awesome-api</artifactId>
<version>6.6.0-2</version>
<version>6.7.2-1</version>
</dependency>
<dependency>
<groupId>io.jenkins.plugins</groupId>
Expand All @@ -90,7 +90,7 @@ THE SOFTWARE.
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>plugin-util-api</artifactId>
<version>5.1.0</version>
<version>6.0.0</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
Expand Down Expand Up @@ -178,7 +178,7 @@ THE SOFTWARE.
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-test-harness</artifactId>
<version>2394.v981cdb_6c5f1d</version>
<version>2403.v256947ecb_c8a_</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand Down Expand Up @@ -230,7 +230,7 @@ THE SOFTWARE.
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>junit</artifactId>
<version>1314.vd966e9a_88895</version>
<version>1316.v13ec14a_de230</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -352,15 +352,15 @@ THE SOFTWARE.
<artifactItem>
<groupId>io.jenkins.plugins</groupId>
<artifactId>prism-api</artifactId>
<version>1.29.0-18</version>
<version>1.29.0-19</version>
<type>hpi</type>
<outputDirectory>${project.build.outputDirectory}/plugins</outputDirectory>
<destFileName>prism-api.jpi</destFileName>
</artifactItem>
<artifactItem>
<groupId>io.jenkins.plugins</groupId>
<artifactId>bootstrap5-api</artifactId>
<version>5.3.3-1</version>
<version>5.3.3-2</version>
<type>hpi</type>
<outputDirectory>${project.build.outputDirectory}/plugins</outputDirectory>
<destFileName>bootstrap5-api.jpi</destFileName>
Expand Down
51 changes: 29 additions & 22 deletions test/src/test/java/hudson/cli/DisconnectNodeCommandTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import hudson.model.Computer;
import hudson.slaves.DumbSlave;
import hudson.slaves.OfflineCause;
import java.util.ArrayList;
import jenkins.model.Jenkins;
import org.junit.Before;
import org.junit.Rule;
Expand Down Expand Up @@ -187,32 +188,38 @@ public void disconnectNodeManyShouldSucceed() throws Exception {

@Test
public void disconnectNodeManyShouldSucceedWithCause() throws Exception {
DumbSlave slave1 = j.createSlave("aNode1", "", null);
DumbSlave slave2 = j.createSlave("aNode2", "", null);
DumbSlave slave3 = j.createSlave("aNode3", "", null);
slave1.toComputer().waitUntilOnline();
assertThat(slave1.toComputer().isOnline(), equalTo(true));
assertThat(slave1.toComputer().getOfflineCause(), equalTo(null));
slave2.toComputer().waitUntilOnline();
assertThat(slave2.toComputer().isOnline(), equalTo(true));
assertThat(slave2.toComputer().getOfflineCause(), equalTo(null));
slave3.toComputer().waitUntilOnline();
assertThat(slave3.toComputer().isOnline(), equalTo(true));
assertThat(slave3.toComputer().getOfflineCause(), equalTo(null));
int n = 3;
var agents = new ArrayList<DumbSlave>();
for (int i = 1; i <= n; i++) {
agents.add(j.createSlave("aNode" + i, "", null));
}
for (var agent : agents) {
var computer = agent.toComputer();
computer.waitUntilOnline();
assertThat(computer.isOnline(), equalTo(true));
assertThat(computer.getOfflineCause(), equalTo(null));
}

var args = new ArrayList<String>();
for (var agent : agents) {
args.add(agent.getNodeName());
}
args.add("-m");
args.add("aCause");
final CLICommandInvoker.Result result = command
.authorizedTo(Computer.DISCONNECT, Jenkins.READ)
.invokeWithArgs("aNode1", "aNode2", "aNode3", "-m", "aCause");
.invokeWithArgs(args.toArray(String[]::new));
assertThat(result, succeededSilently());
assertThat(slave1.toComputer().isOffline(), equalTo(true));
assertThat(slave1.toComputer().getOfflineCause(), instanceOf(OfflineCause.ByCLI.class));
assertThat(((OfflineCause.ByCLI) slave1.toComputer().getOfflineCause()).message, equalTo("aCause"));
assertThat(slave2.toComputer().isOffline(), equalTo(true));
assertThat(slave2.toComputer().getOfflineCause(), instanceOf(OfflineCause.ByCLI.class));
assertThat(((OfflineCause.ByCLI) slave2.toComputer().getOfflineCause()).message, equalTo("aCause"));
assertThat(slave3.toComputer().isOffline(), equalTo(true));
assertThat(slave3.toComputer().getOfflineCause(), instanceOf(OfflineCause.ByCLI.class));
assertThat(((OfflineCause.ByCLI) slave3.toComputer().getOfflineCause()).message, equalTo("aCause"));
for (var agent : agents) {
var computer = agent.toComputer();
assertThat(computer.isOffline(), equalTo(true));
var cause = computer.getOfflineCause();
if (cause instanceof OfflineCause.ByCLI cliCause) {
assertThat(cliCause.message, equalTo("aCause"));
} else {
assertThat("seen occasionally in CI", cause, instanceOf(OfflineCause.ChannelTermination.class));
}
}
}

@Test
Expand Down
18 changes: 9 additions & 9 deletions war/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ THE SOFTWARE.
<!-- detached after 1.577 -->
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>junit</artifactId>
<version>1314.vd966e9a_88895</version>
<version>1316.v13ec14a_de230</version>
<type>hpi</type>
</artifactItem>
<artifactItem>
Expand All @@ -330,21 +330,21 @@ THE SOFTWARE.
<!-- dependency of checks-api, echarts-api, font-awesome-api, and junit -->
<groupId>io.jenkins.plugins</groupId>
<artifactId>plugin-util-api</artifactId>
<version>5.1.0</version>
<version>6.0.0</version>
<type>hpi</type>
</artifactItem>
<artifactItem>
<!-- dependency of echarts-api and junit -->
<groupId>io.jenkins.plugins</groupId>
<artifactId>bootstrap5-api</artifactId>
<version>5.3.3-1</version>
<version>5.3.3-2</version>
<type>hpi</type>
</artifactItem>
<artifactItem>
<!-- dependency of junit -->
<groupId>io.jenkins.plugins</groupId>
<artifactId>checks-api</artifactId>
<version>2.2.2</version>
<version>2.2.3</version>
<type>hpi</type>
</artifactItem>

Expand All @@ -360,14 +360,14 @@ THE SOFTWARE.
<!-- dependency of junit and echarts-api -->
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>jackson2-api</artifactId>
<version>2.17.0-386.vcb_b_037da_0d62</version>
<version>2.17.0-389.va_5c7e45cd806</version>
<type>hpi</type>
</artifactItem>
<artifactItem>
<!-- dependency of junit -->
<groupId>io.jenkins.plugins</groupId>
<artifactId>echarts-api</artifactId>
<version>5.5.1-5</version>
<version>5.5.1-6</version>
<type>hpi</type>
</artifactItem>
<artifactItem>
Expand All @@ -389,23 +389,23 @@ THE SOFTWARE.
<!-- dependency of script-security and workflow-support -->
<groupId>io.jenkins.plugins</groupId>
<artifactId>caffeine-api</artifactId>
<version>3.1.8-133.v17b_1ff2e0599</version>
<version>3.2.0-161.v691ef352cee1</version>
<type>hpi</type>
</artifactItem>

<artifactItem>
<!-- dependency of echarts-api -->
<groupId>io.jenkins.plugins</groupId>
<artifactId>jquery3-api</artifactId>
<version>3.7.1-2</version>
<version>3.7.1-3</version>
<type>hpi</type>
</artifactItem>

<artifactItem>
<!-- dependency of bootstrap5-api and echarts-api -->
<groupId>io.jenkins.plugins</groupId>
<artifactId>font-awesome-api</artifactId>
<version>6.6.0-2</version>
<version>6.7.2-1</version>
<type>hpi</type>
</artifactItem>

Expand Down
Loading

0 comments on commit 5fae312

Please sign in to comment.