Commit Graph
12884 Commits
Author SHA1 Message Date
Stefan Spieker 2fbc94bb87 set spotbugs ICAST_IDIV_CAST_TO_DOUBLE to ignore, because precision loss is intended 2019-12-31 10:50:09 +01:00
StefanSpiekerandOleg Nenashev 8b893a1cbe [JENKINS-36720]: Fixed some Spotbugs issues (#4180)
* [JENKINS-36720]: Fixed Spotbugs issues WMI_WRONG_MAP_ITERATOR and OS_OPEN_STREAM in core

* merged try with resources with try finally

* reverted auto format from IDE

* reverted auto format from IDE

* use Util.fileToPath() as suggested to remove catch block

* merged try statements

* merged try statements

* reverted some whitespace fixes

* reverted another whitespace fix

* Apply suggestions from code review

Co-Authored-By: Oleg Nenashev <o.v.nenashev@gmail.com>

* reverted change

* reverted change

* reverted change

Co-authored-by: Oleg Nenashev <o.v.nenashev@gmail.com>
2019-12-29 12:50:10 +01:00
StefanSpiekerandZbynek Konecny 23242cab56 Replace compare() implementations with call to Integer.compare or Long.compare (#4371)
* replaced implementation with call to Integer.compare or Long.compare

* Update core/src/main/java/hudson/model/HealthReport.java

Co-Authored-By: Zbynek Konecny <zbynek1729@gmail.com>

* mark compare methods as deprecated

Co-authored-by: Zbynek Konecny <zbynek1729@gmail.com>
2019-12-27 09:45:08 +01:00
Stefan Spieker 838f4ab504 removed obsolete SpotBugs suppresses 2019-12-23 16:04:30 +01:00
StefanSpieker 6affcc507a JENKINS-60513: Added transient to SCMDescriptor#generation AtomicInteger to fix warnings (#4400)
* JENKINS-60513: Added AtomicInteger to whitelist

* JENKINS-60513: Mark field as transient

* reverted whitelist change

* renamed field to support deserialization of ols values
2019-12-21 13:52:12 +01:00
StefanSpieker 94f0976fd8 Spotbugs findings (catch runtime ex. and known null) (#4380)
* refactor exception to actually put the failing string inside instead of null

* do not catch RuntimeExceptions
2019-12-21 13:49:41 +01:00
Jesse Glick 84f6eb075a [JENKINS-60554] - EscapedMarkupFormatter did not properly handle a null argument. (#4401) 2019-12-20 22:02:56 +01:00
Oleg Nenashev f9b2c5957a Merge pull request #4394 from jvz/user-seed-fix
[JENKINS-59107] User is no longer logged out when authenticating another user
2019-12-20 11:12:20 +01:00
James Nord 7228af5bb1 [JENKINS-60351] - Make it possible to disable multiple deletion attempts by setting hudson.Util.maxFileDeletionRetries to zero (#4382)
* [JENKINS-60351] It should be possible to disable a retry of the
PathRemover

This does not address the issues that the comments and code in
hudons.Util are inconsistent if they are for retries or total number of
attempts (they are currently total number of attempts)

* [JENKINS-60351] Make the code conform to the documentation

maxRetries should control the number of retries not the number of
attempts.

* rename field from DELETION_MAX to DELETION_RETRIES
2019-12-20 11:07:33 +01:00
Matt Sicker d5b716625c [JENKINS-59107] User is no longer logged out when authenticating another user
This fixes a regression introduced in SECURITY-901 where performing an authentication check on another user while logged in caused the user to get logged out.

Signed-off-by: Matt Sicker <boards@gmail.com>
2019-12-13 11:07:40 -06:00
StefanSpieker 9368197d25 Replaced integer with AtomicInteger to fix spotbugs issue (#4337)
* replaced integer with AtomicInteger to fix spotbugs issue

* added @Restricted to prevent further usage

* replaced volatile with final because of AtomicInteger usage

* implemented a getter and an increment method

* fixed typeo in javadoc
2019-12-12 08:46:24 +01:00
Oleg Nenashev 171c4d7f6d Merge pull request #4388 from jglick/nullability-Label
Adding some nullability annotations related to Label
2019-12-10 22:45:12 +01:00
Thomas de Grenier de Latour d36acc1c81 [JENKINS-59656] check build id before interrupting from the executors widget (#4264)
* [JENKINS-59656] when stopping a Run via the executors widget, make sure it's the intended one

* [JENKINS-59656] added Executor.stopBuild(String) instead of .stop(String)

* revert change to deprecated doStop(StaplerRequest,StaplerResponse), useless now that it's doStopBuild(String) which takes a runExtId parameter

* javadoc: "@since TODO" rather than "@since 2.???"

* [JENKINS-59656] added test case

* jelly cleanup with h.urlEncode(String)

* make Functions.urlEncode(null) return empty String

* Executor.doStopBuild(runExtId): ignore runExtId if executable is not a Run

* Executor.doStopBuild(runExtId) doesn't have to be a public API
2019-12-10 22:44:51 +01:00
Oleg Nenashev f3e1fa7ef1 Merge pull request #4370 from StefanSpieker/repeated_conditional
merged superfluous if with while loop
2019-12-09 22:08:30 +00:00
Jesse Glick 1125b1b4d7 Adding some nullability annotations related to Label. 2019-12-06 10:33:26 -05:00
Oleg Nenashev d7066d19ee Merge pull request #4373 from fedepell/whitelist_empty_bug
[JENKINS-60278] Prevent Oops when Whitelisted Commands input is empty
2019-12-04 05:38:35 +00:00
Baptiste Mathus cb424f3ca0 Merge pull request #4329 from lgoenner/executor
[JENKINS-57304] - Add call to oneOffExecutors.remove in Computer.removeExecutor
2019-12-03 15:23:39 +01:00
Federico Pellegrin 6186c3b72f Prevent Oops when Whitelisted Commands input is empty 2019-11-25 09:07:25 +01:00
Stefan Spieker 40206e023c removed some redundant constructs and replaced stringbuilder operations with too few arguments with string concatenation 2019-11-24 16:15:20 +01:00
Stefan Spieker 5f406626d5 merged superfluous if with while loop 2019-11-24 15:47:03 +01:00
Oleg Nenashev eedf2a4e2a Merge pull request #4262 from StefanSpieker/replace_getActiveInstance
Replaced deprecated getActiveInstance() with get()
2019-11-22 10:25:21 +01:00
Oleg Nenashev 8bc435f32e Merge pull request #4348 from pilou-/handle_empty_views
[JENKINS-60092] getPrimaryView: return null if no view is defined
2019-11-22 10:14:47 +01:00
StefanSpiekerandWadeck Follonier d92b172aaf Set the HttpOnly flag for the page auto-refresh tokens (#4363)
* set HttpOnly flag to prevent cookie read by a malicious script in browser

* Update core/src/main/java/hudson/Functions.java

Co-Authored-By: Wadeck Follonier <Wadeck@users.noreply.github.com>
2019-11-22 10:14:17 +01:00
Oleg Nenashev fd02997e95 Merge pull request #4364 from StefanSpieker/UTF_8
use StandardCharsets.UTF_8 instead of string
2019-11-21 13:53:22 +01:00
Mark Waite 360029e9d5 Merge pull request #4361 from StefanSpieker/try_with_resources
Try with resources instead of try finally
2019-11-18 05:28:57 -07:00
Oleg Nenashev cce9587639 Merge pull request #4357 from bulanovk/JENKINS-60167
[JENKINS-60167] - Fix AtomicFileWriter performance issue on CephFS in case of Empty File creation
2019-11-18 11:09:02 +01:00
Stefan Spieker 6acb0913c9 use StandardCharsets.UTF_8 instead of string 2019-11-17 17:39:03 +01:00
Daniel Beck 77f1242ddd Move cloud configuration out of Configure System (#4339)
* Move cloud configuration out of Configure System

* Update display name

* Add section header back
2019-11-16 10:37:27 +01:00
Stefan Spieker 7f8c04641f reverted some whitespace changes 2019-11-15 18:12:43 +01:00
Stefan Spieker 5c027dfc94 removed dangling comments 2019-11-15 18:02:26 +01:00
Stefan Spieker 4cad1a455f use try with resources instead of try finally 2019-11-15 17:49:05 +01:00
Stefan Spieker ccdb6350f7 use try with resources instead of try finally 2019-11-15 17:39:11 +01:00
Grace TangandOleg Nenashev 8a2f761431 Reduce log levels for successful run completion and update center polling events (#4345)
* Rejuvenate log levels

* clean up

* Reverting the plugin download

Co-Authored-By: Oleg Nenashev <o.v.nenashev@gmail.com>
2019-11-15 15:12:29 +01:00
f103b7819d JENKINS-56553 Make proxy config compatible with JCasC without workarounds on the plugin side (#3935)
* JENKINS-56553 Make proxy config compatible with JCASC

* Use DataBoundSetters as other fields are optional

* Fix Jelly for ProxyConfiguration

* Use default field name now that field matches

* Fix validate proxy

* Change field type

* After review

* Update core/src/main/java/jenkins/model/Jenkins.java

Co-Authored-By: timja <t.jacomb@kainos.com>

* Update core/src/main/java/jenkins/model/Jenkins.java

Co-Authored-By: timja <t.jacomb@kainos.com>

* Update core/src/main/java/hudson/ProxyConfiguration.java

Co-Authored-By: timja <t.jacomb@kainos.com>

* Update core/src/main/java/jenkins/model/Jenkins.java

Co-Authored-By: timja <t.jacomb@kainos.com>

* Update core/src/main/java/jenkins/model/Jenkins.java

Co-Authored-By: timja <t.jacomb@kainos.com>

* Update core/src/main/java/hudson/ProxyConfiguration.java

Co-Authored-By: Oleg Nenashev <o.v.nenashev@gmail.com>

* Tweak javadoc

* Align fields

* Update core/src/main/java/hudson/ProxyConfiguration.java

Co-Authored-By: Adrien Lecharpentier <adrien.lecharpentier@gmail.com>
2019-11-14 13:40:53 +01:00
Konstantin Bulanov 7694555886 Fix JENKINS-60167
Add StandardOpenOption.CREATE flag to create FileChannelWriter to avoid full fs flush and 5sec log operation on creating empty file with CephFS as a storage
2019-11-14 13:49:00 +04:00
Jesse Glick 376b14f099 Merge pull request #4351 from jglick/jetty-maven-plugin
Switch from maven-jenkins-dev-plugin to upstream jetty-maven-plugin
2019-11-13 08:45:53 -05:00
Daniel Beckanddaniel-beck 90e693b13b Hide password form fields by default (#3991)
* Hide password form fields by default

* Trying to bypass enforced autocompletion by just having a test field at first

Something like onfocus didn't work, you'd tab through form elements
and unless you filled in the user name, changing the form field to
password would cause it to autocomplete.

It looks like, at least in Mac/Firefox, going from plain text to password
in the 'oninput' event handler works. The plain text is revealed neither
with typing nor pasting.

* Update core/src/main/resources/lib/form/password.jelly

Co-Authored-By: daniel-beck <daniel-beck@users.noreply.github.com>

* Use previously defined value

* Make new password form fields opt-out

* Add support for redacting form secrets in new password field

* Have a password value pre-set in Jelly

* Fix method

* Fix test by clicking on the button to change the password

* Forgot period separator between class and property name
2019-11-13 10:22:40 +01:00
Baptiste Mathus 5f810770b4 Merge pull request #4346 from MRamonLeon/JENKINS-59793
[JENKINS-59793] Avoid hanging jobs with faulty SubTasks
2019-11-13 09:52:49 +01:00
Jesse Glick 035ca2be1c Some references in Javadoc to hudson-dev:run. 2019-11-12 09:33:13 -05:00
Daniel Beck 7e4ebd562a Try to execute flyweight tasks on the master (#3983)
* Try to execute flyweight tasks on the master

* Fix offline behavior, add tests

* Remove obsolete TODOs, also check #isAcceptingTasks
2019-11-12 15:18:42 +01:00
Oleg Nenashev 196d9883c9 Merge pull request #4350 from jglick/cli-remoting-dep
jenkins-cli.jar no longer needs to bundle remoting
2019-11-12 15:05:16 +01:00
M Ramon Leon 5fb44bd890 [FNDJEN-59793] Rollback to original fix plus NoExternalUse 2019-11-12 12:44:53 +01:00
Pierre-Louis Bonicoli 4956998996 getPrimaryView: return null if no view is defined
This exception occurs while defining a view using job DSL:

    SEVERE  jenkins.InitReactorRunner$1#onTaskFailed: Failed ConfigurationAsCode.init
    java.lang.ArrayIndexOutOfBoundsException: 0
        at java.util.concurrent.CopyOnWriteArrayList.get(CopyOnWriteArrayList.java:388)
        at java.util.concurrent.CopyOnWriteArrayList.get(CopyOnWriteArrayList.java:397)
        at hudson.model.ViewGroupMixIn.getPrimaryView(ViewGroupMixIn.java:172)
        at hudson.model.ViewGroupMixIn.getView(ViewGroupMixIn.java:134)
        at jenkins.model.Jenkins.getView(Jenkins.java:1834)
        at javaposse.jobdsl.plugin.JenkinsJobManagement.createOrUpdateView(JenkinsJobManagement.java:175)
        at javaposse.jobdsl.dsl.JobManagement$createOrUpdateView$2.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:141)
        at javaposse.jobdsl.dsl.AbstractDslScriptLoader$_extractGeneratedViews_closure5.doCall(AbstractDslScriptLoader.groovy:216)
2019-11-12 09:28:20 +01:00
M Ramon Leon cff85468bb [FNDJEN-59793] Ensure the new exceptions thrown set the future as well 2019-11-11 17:50:44 +01:00
M Ramon LeonandStephen Connolly d96ac8139f [FNDJEN-59793] Change test name and avoid extra assertions
Co-authored-by: Stephen Connolly <stephen.alan.connolly@gmail.com>
2019-11-11 12:49:50 +01:00
Josh SorefandDaniel Beck 4cd3e338c0 IntelliJ/Java: Duplicate code -- Refactored as DOSToUnixPathHelper.validate (#4080)
* IntelliJ/Java: Duplicate code -- Refactored as DOSToUnixPathHelper.validate

* Change DOSToUnixPathHelper from validate() to iteratePath()

* Refactor DOSToUnixPathHelper checkPrefix

* mark DOSToUnixPathHelper as NoExternalUse

* Do not tempt fate

Co-Authored-By: Daniel Beck <1831569+daniel-beck@users.noreply.github.com>
2019-11-11 12:19:16 +01:00
Zbynek Konecny 40b68eaadb [JENKINS-59679] Use plugin URL from the update site rather than the manifest (#4273)
* Use plugin URL from the update site rather than the manifest

* Avoid Mockito when not needed

* Resolve plugin URL from multiple update sites
2019-11-10 11:24:28 +01:00
Ramon Leon 3a8c1efdcd [JENKINS-59886] Strengthen the queue to avoid canTake and canRun implementers hanging the queue (#4311)
* [JENKINS-59886] Strengthen the queue to avoid canTake and canRun implementers hanging it

* [JENKINS-59886] Messages on iso-8859-1

* [JENKINS-59886] Messages on iso-8859-1

* [JENKINS-59886] lower case on properties

* [JENKINS-59886] trailing empty blanks

* [JENKINS-59886] Double single-quotes

* [JENKINS-59886] Don't sleep in the loop maintaining the queue

* [JENKINS-59886] Add class suffix, wait to just the start of the build

* [JENKINS-59886] Assert clearly there is only one job in the queue

* [JENKINS-59886] Uncomment fix

* [JENKINS-59886] Remove old comment

* [JENKINS-59886] Remove log messages from property files

* [JENKINS-59886] Remove UTF8 characters from es messages
2019-11-10 11:18:16 +01:00
Oleg Nenashev ebf1bcfbaa Merge pull request #4341 from daniel-beck/more-data-timeseries
Add more data points to MultiStageTimeSeries
2019-11-10 11:16:10 +01:00
Jesse Glick 642a4ff0f3 jenkins-cli.jar no longer needs to bundle remoting. 2019-11-08 17:28:37 -05:00