hide last repeatable delete button with minimum > 0
When a repeatable has set a minimum > 0 it means there should always be
at least one such entry. So showing the delete button in that case when
there is only one entry is wrong. Interestingly there is already support
for this behaviour with the class `show-if-not-only`. A few plugins used
that with the old input based buttons.
This change now makes this automatic. The repeated-container gets the
value of the passed minimum and the corresponding class is automatically
added to all delete buttons in the container.
* Fix "Zeno’s paradox" like logic of the progress calculation
* Add ability to limit RunListProgressiveRendering records to return
* Set default RunListProgressiveRendering limit to 1000 records
---------
Co-authored-by: Dmytro Ukhlov <dukhlov@csod.com>
Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com>
Co-authored-by: Mark Waite <mark.earl.waite@gmail.com>
* JENKINS-60635 Replace long timezone list with documentation link in build periodically help
* JENKINS-20780 Wrap timezone list in collapsible details section
---------
Co-authored-by: Mark Waite <mark.earl.waite@gmail.com>
* Add online help for removeLastBuild option
* Format help-removeLastBuild.html with Prettier
* Update core/src/main/resources/hudson/tasks/LogRotator/help-removeLastBuild.html
Co-authored-by: Mark Waite <mark.earl.waite@gmail.com>
* Fix formatting and use correct HTML tag
My suggestion used the code tag, but should have used the pre tag
---------
Co-authored-by: Mark Waite <mark.earl.waite@gmail.com>
* API tokens with expiration
API tokens can now get an optional expiration date.
Added a select drop down from where you can choose from predefined
durations, a custom date (max 1 year) and no expiration.
Expiration date is shown in the list. Not expiring tokens are marked
with warning.
fixes#16695
* revert changes in SetupWizard
* fix linter
* fix ordering
* show when token expired
* notify on expiring and expired tokens
* format
* 2 lines only
make the creation date a tooltip of the expiration
* feedback
* feedback 2
don't add token when choosing date in the past
directly warn after creation when about to expire
* prettier
---------
Co-authored-by: Tim Jacomb <timjacomb1@gmail.com>
* Replace if-cascades with switch
* Reference to empty collection field replaced with method call (Java 5)
* Anonymous type replaced with lambda (Java 8)
* Replaced lambda with method reference (Java 8)
* Statement lambda replaced with expression lambda (Java 8)
* Loop replaced with 'Collection.removeIf()' (Java 8)
* Null check replaced with method call (Java 9)
* Statement replaced with enhanced 'switch' (Java 14)
* Use text blocks (Java 15)
* Use pattern variable (Java 16)
* Replace if-cascades with switch
* Use 'Comparator' combinator
* Null check replaced with method call (Java 9)
* Use pattern variable (Java 16)
* Use record pattern (Java 21)
* Use SequencedCollection method (Java 21)
* Replaced lambda with method reference (Java 8)
* Cleanup unused imports
* Cleanup migrations (move comments, formatting, spotbugs...)
* Remove duplicate comment
Resolve GitHub Copilot review comment
* Remove blank line that may confuse Copilot
* Inject comments into source line
Attempt to satisfy GitHub Copilot
Complains about unreachable code
* Simplify with return value of switch statement
* Use pattern matching instanceof in one more case
* Don't lose the NetBeans comment that was there before
* Remove TODO for Java 21 pattern use, implemented
* Align comments with Unicode character they describe
---------
Co-authored-by: Mark Waite <mark.earl.waite@gmail.com>
* Use absolute URL in Cloud sidepanel
The urls in the sidepanel of a cloud are relative. When an action is
added to the cloud these urls lead to a 404 as the action has a
different path.
fixes#26002
* Update core/src/main/resources/hudson/slaves/Cloud/sidepanel.jelly
Co-authored-by: Alexander Brandes <brandes.alexander@web.de>
---------
Co-authored-by: Alexander Brandes <brandes.alexander@web.de>
* Fix synchronization, PluginWrapper bug, and cleanup Javadoc
- Fix inconsistent synchronization in Fingerprint.java on 'usages' field by synchronizing on 'this'.
- Fix logic bug in PluginWrapper.java where setOptionalDependants passed incorrect field instead of parameter.
- Replace Boolean.getBoolean with SystemProperties.getBoolean in Jenkins.java and JnlpSlaveRestarterInstaller.java for best practices.
- Update placeholder version numbers (@deprecated and @since) in StreamTaskListener, StreamBuildListener, and JNLPLauncher.
Signed-off-by: shbhmexe <shubhushukla586@gmail.com>
* Update core/src/main/java/hudson/model/StreamBuildListener.java
Co-authored-by: Mark Waite <mark.earl.waite@gmail.com>
* Update core/src/main/java/hudson/slaves/JNLPLauncher.java
Co-authored-by: Mark Waite <mark.earl.waite@gmail.com>
* Update core/src/main/java/hudson/util/StreamTaskListener.java
Co-authored-by: Mark Waite <mark.earl.waite@gmail.com>
* Update core/src/main/java/jenkins/model/Jenkins.java
Co-authored-by: Mark Waite <mark.earl.waite@gmail.com>
* Update core/src/main/java/jenkins/slaves/restarter/JnlpSlaveRestarterInstaller.java
Co-authored-by: Mark Waite <mark.earl.waite@gmail.com>
* Update Fingerprint.java
* Revert JnlpSlaveRestarterInstaller SystemProperties change per reviewer feedback
---------
Signed-off-by: shbhmexe <shubhushukla586@gmail.com>
Co-authored-by: Mark Waite <mark.earl.waite@gmail.com>
* [JENKINS-75905] Include update site URL in signature verification error messages
* [JENKINS-75905] Include update site URL in signature verification error messages
* [JENKINS-75905] Include update site URL in signature verification error messages
* Use the non-deprecated getJsonSignatureValidator method and add @NonNull annotation
Use the non-deprecated getJsonSignatureValidator Add @NonNull annotation to the Throwable parameter in JSONSignatureValidator#getRootCauseMessage.
* Test both branches of message formatter
---------
Co-authored-by: Mark Waite <mark.earl.waite@gmail.com>
Partially reverts 331c768.
In #8960 the `out` id was added to `pre.console-output`'s "otherwise"
case in `console.jelly`.
In 331c768, the `out` id was removed from `otherwise` when console output
was moved from `console.jelly` to `console-log.jelly`.
This may have broken the "Copy" button in some instances.
When clicked, the copy button will copy the inner text of a container
with the id referred to by the `ref` attribute of the copy button. The
copy button's ref attribute is `out`.
Wikimedia's Jenkins has no element with the `out` id on the console
page, which leads to copying `null` to the clipboard.
This was filed as https://phabricator.wikimedia.org/T410633.
Co-authored-by: Mark Waite <mark.earl.waite@gmail.com>
* Fix NPE in ReverseBuildTrigger due to null upstream threshold (JENKINS-39044)
* Use ReverseTrigger constructor that is not deprecated
Has the same result as the deprecated constructor that was used before.
* Add automated test of JENKINS-39044
If the ReverseTrigger threshold were null, a null pointer exception would
be thrown. The config round trip operation resets a null threshold to
SUCCESS, so this test reaches inside the job definition and changes the
threshold directly.
Testing done:
* Confirmed that the modified automated test fails when the change to
ReverseTrigger is removed.
* Confirmed that the modified automated test passes when the change to
ReverseTrigger is included.
* Link to GitHub issue
---------
Co-authored-by: Mark Waite <mark.earl.waite@gmail.com>
Warn users of Java 25 end of support September 2029
Beginning in March 2029, users will be warned that Java 25 will be
reaching its end of support in the Jenkins project.
Amends pull request:
* https://github.com/jenkinsci/jenkins/pull/11148
The 2+2+2 Java support plan recommends that we drop support for a Java
line after two years so that we're only supporting two Java versions at
a time. Refer to the blog post:
* https://www.jenkins.io/blog/2023/11/06/introducing-2-2-2-java-support-plan/
Also refer to the Jenkins Enhancement Proposal pull request (incomplete):
* https://github.com/jenkinsci/jep/pull/400
Testing done:
* None. Relying on the existing behavior that I've seen from the Java
17 administrative monitor. It is now shown to users to warn them that
we plan to drop Java 17 support by the end of March 2026