Skip to content

Commit

Permalink
Merge branch 'master' into command-palette--add-icons
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Dec 10, 2024
2 parents dd15dce + a2ce953 commit ef9c5ae
Show file tree
Hide file tree
Showing 12 changed files with 72 additions and 63 deletions.
10 changes: 0 additions & 10 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,6 @@
"org.fusesource.jansi:jansi"
]
},
{
"description": "Depends on commons-lang3 which is in progress for removal from core. See: https://issues.jenkins.io/browse/JENKINS-73355",
"matchManagers": [
"maven"
],
"enabled": false,
"matchPackageNames": [
"org.apache.commons:commons-compress"
]
},
{
"description": "Contains incompatible API changes and needs compatibility work. See: https://github.com/jenkinsci/jenkins/pull/4224",
"matchManagers": [
Expand Down
5 changes: 0 additions & 5 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,6 @@ THE SOFTWARE.
<artifactId>ant</artifactId>
<version>1.10.15</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.26.1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-fileupload2</artifactId>
Expand Down
11 changes: 0 additions & 11 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -285,17 +285,6 @@ THE SOFTWARE.
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<exclusions>
<!-- Only needed for Pack200UnpackerAdapter, which we do not use -->
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-fileupload2-core</artifactId>
Expand Down
5 changes: 5 additions & 0 deletions core/src/main/java/jenkins/telemetry/Telemetry.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ public static ExtensionList<Telemetry> all() {
return ExtensionList.lookup(Telemetry.class);
}

@Restricted(NoExternalUse.class) // called by jelly
public static boolean isAnyTrialActive() {
return all().stream().anyMatch(Telemetry::isActivePeriod);
}

/**
* @since 2.147
* @return whether to collect telemetry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def f=namespace(lib.FormTagLib)

f.section(title: _("Usage Statistics")) {
if (UsageStatistics.DISABLED) {
span(class: "jenkins-not-applicable") {
div(class: "jenkins-not-applicable jenkins-description") {
raw(_("disabledBySystemProperty"))
}
} else if (FIPS140.useCompliantAlgorithms()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<div>
<p>
For any project, it's critical to know how the software is used, but tracking usage data is inherently difficult in open-source projects.
Anonymous usage statistics address this need.
When enabled, Jenkins periodically sends information to the Jenkins project.
The Jenkins project uses this information to set development priorities.
</div>
</p>
<j:invokeStatic className="jenkins.security.FIPS140" method="useCompliantAlgorithms" var="fips"/>
<j:if test="${!fips}">
<h1>General usage statistics</h1>
<h3>General usage statistics</h3>
<div>
<p>Jenkins reports the following general usage statistics:</p>
<ul>
Expand All @@ -24,7 +24,7 @@
</p>
</div>
</j:if>
<h1>Telemetry collection</h1>
<h3>Telemetry collection</h3>
<div>
<p>
<j:choose>
Expand All @@ -38,24 +38,34 @@
Each trial has a specific purpose and a defined end date, after which collection stops, independent of the installed versions of Jenkins or plugins.
Once a trial is complete, the trial results may be aggregated and shared with the developer community.
</p>
<p>
The following trials defined on this instance are active now or in the future:
</p>

<j:invokeStatic className="jenkins.telemetry.Telemetry" method="all" var="collectors"/>
<j:invokeStatic className="jenkins.telemetry.Telemetry" method="isAnyTrialActive" var="anyTrialActive"/>
<j:invokeStatic className="java.time.LocalDate" method="now" var="now"/>
<dl>
<j:forEach items="${collectors}" var="collector">
<j:if test="${not collector.end.isBefore(now)}">
<dt>${collector.displayName}</dt>
<dd>
<st:include it="${collector}" optional="true" page="description.jelly"/>
<p>
Start date: ${collector.start}<br/>
End date: ${collector.end}
</p>
</dd>
</j:if>
</j:forEach>
</dl>
<j:choose>
<j:when test="${!anyTrialActive}">
<p>${%There are currently no active trials.}</p>
</j:when>
<j:otherwise>
<p>
The following trials defined on this instance are active now or in the future:
</p>
<dl>
<j:forEach items="${collectors}" var="collector">
<j:if test="${not collector.end.isBefore(now)}">
<dt>${collector.displayName}</dt>
<dd>
<st:include it="${collector}" optional="true" page="description.jelly"/>
<p>
Start date: ${collector.start}
<br/>
End date: ${collector.end}
</p>
</dd>
</j:if>
</j:forEach>
</dl>
</j:otherwise>
</j:choose>
</div>
</j:jelly>
14 changes: 7 additions & 7 deletions core/src/main/resources/lib/form/toggleSwitch.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,19 @@ THE SOFTWARE.
disabled="${readOnlyMode ? 'true' : null}"
checked="${value ? 'true' : null}"/>
<label class="jenkins-toggle-switch__label ${id != null ? '' : 'attach-previous'}"
for="${id}" data-title="${title}" data-checked-title="${checkedTitle}">
for="${attrs.id}" data-title="${attrs.title}" data-checked-title="${attrs.checkedTitle}">
<j:choose>
<j:when test="${checkedTitle == null}">
${title}
<j:when test="${attrs.checkedTitle == null}">
${attrs.title}
</j:when>
<j:otherwise>
<span class="jenkins-toggle-switch__label__unchecked-title">${title}</span>
<span class="jenkins-toggle-switch__label__checked-title">${checkedTitle}</span>
<span class="jenkins-toggle-switch__label__unchecked-title">${attrs.title}</span>
<span class="jenkins-toggle-switch__label__checked-title">${attrs.checkedTitle}</span>
</j:otherwise>
</j:choose>
</label>
<j:if test="${description != null and !description.trim().isEmpty()}">
<span class="jenkins-toggle-switch__description">${description}</span>
<j:if test="${attrs.description != null and !attrs.description.trim().isEmpty()}">
<span class="jenkins-toggle-switch__description">${attrs.description}</span>
</j:if>
</span>
</j:jelly>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"lint": "yarn lint:js && yarn lint:css"
},
"devDependencies": {
"@babel/cli": "7.25.9",
"@babel/cli": "7.26.4",
"@babel/core": "7.26.0",
"@babel/preset-env": "7.26.0",
"@eslint/js": "9.16.0",
Expand Down
20 changes: 20 additions & 0 deletions src/main/scss/base/_style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ pre.console {
border-radius: 6px;
z-index: 0;

--section-padding: 0.8rem;

&::before {
content: "";
position: absolute;
Expand All @@ -389,6 +391,24 @@ pre.console {
p:last-of-type {
margin-bottom: 0;
}

// add spacing above headings except for when its the first element in the help
// the need for this is caused by p:last-of-type setting margin-bottom to 0
// unfortunately because of the varied markup I wasn't able to find a way to avoid this
h1:not(:first-child),
.h1:not(:first-child),
h2:not(:first-child),
.h2:not(:first-child),
h3:not(:first-child),
.h3:not(:first-child),
h4:not(:first-child),
.h4:not(:first-child),
h5:not(:first-child),
.h5:not(:first-child),
h6:not(:first-child),
.h6:not(:first-child) {
margin-top: var(--section-padding);
}
}

.help .from-plugin {
Expand Down
2 changes: 1 addition & 1 deletion test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ THE SOFTWARE.
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>junit</artifactId>
<version>1309.v0078b_fecd6ed</version>
<version>1311.v39e1716e4eb_e</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion war/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ THE SOFTWARE.
<!-- detached after 1.577 -->
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>junit</artifactId>
<version>1309.v0078b_fecd6ed</version>
<version>1311.v39e1716e4eb_e</version>
<type>hpi</type>
</artifactItem>
<artifactItem>
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ __metadata:
languageName: node
linkType: hard

"@babel/cli@npm:7.25.9":
version: 7.25.9
resolution: "@babel/cli@npm:7.25.9"
"@babel/cli@npm:7.26.4":
version: 7.26.4
resolution: "@babel/cli@npm:7.26.4"
dependencies:
"@jridgewell/trace-mapping": "npm:^0.3.25"
"@nicolo-ribaudo/chokidar-2": "npm:2.1.8-no-fsevents.3"
Expand All @@ -38,7 +38,7 @@ __metadata:
bin:
babel: ./bin/babel.js
babel-external-helpers: ./bin/babel-external-helpers.js
checksum: 10c0/2e8228c3715e220fa902888c643ce1a89c4ee90be3d9f7a31218d5bb2500456e0cef12cb90fd5877ab3e5a4498df8f27670425d346422a3eb52052fd3184d520
checksum: 10c0/f2d4fc3c4a34dd3001e3bd7084b78b38211003c36afaf2dc8fedf4565c0442bd59b1c64a9f91a0b7b2450e089123f197e09577ae50dc994307c3348b310ce34c
languageName: node
linkType: hard

Expand Down Expand Up @@ -4369,7 +4369,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "jenkins-ui@workspace:."
dependencies:
"@babel/cli": "npm:7.25.9"
"@babel/cli": "npm:7.26.4"
"@babel/core": "npm:7.26.0"
"@babel/preset-env": "npm:7.26.0"
"@eslint/js": "npm:9.16.0"
Expand Down

0 comments on commit ef9c5ae

Please sign in to comment.