Commit Graph
12918 Commits
Author SHA1 Message Date
StefanSpieker bef9ded543 [JENKINS-36720] - Fix Spotbugs issues (SE_COMPARATOR_SHOULD_BE_SERIALIZABLE, ES_COMPARING_STRINGS_WITH_EQ) (#4379)
* fixed Spotbugs issues (SE_COMPARATOR_SHOULD_BE_SERIALIZABLE, ES_COMPARING_STRINGS_WITH_EQ)

* replaced wildcard import with specific imports

* added missing import

* fixed spotbugs issues

* removed accidently added import
2020-01-11 00:04:02 +01:00
Oleg Nenashev 5db5ef5131 Merge pull request #4271 from ilpianista/JENKINS-42658
[JENKINS-42658] - Fix NPE in Agent API when the agent is offline (e.g. retrieving agent version or OS description)
2020-01-10 14:38:17 +01:00
Karthick Prabu d3613f32ef [JENKINS-59220] - Updated EnvVars to add a method that extends putAll functionality (#4194)
* Updated EnvVars to add a method that extends putAll functionality

* Updated method name

* Added test coverage
2020-01-10 09:55:23 +01:00
Oleg Nenashev 58f8ac9b98 Merge pull request #4387 from jeffret-b/removeDeprecatedProtocols
[JENKINS-60381] Remove old, deprecated agent protocols.
2020-01-10 09:45:55 +01:00
A. Jard a00166bfd5 [JENKINS-60579] - Allow the usage of DescriptorVisibilityFilter to filter View properties on UI. (#4404)
* [JENKINS-60579] Functionnal test on View that shows the issue for invisible properties.

* [JENKINS-60579] Apply the visibility filter on View for configuration.

* [JENKINS-60579] Better configuration for testing on invisible property on view.

* [JENKINS-60579] Move tests on ViewPropertyTest.

* [JENKINS-60579]adding the since on getVisiblePropertyDescriptors.
2020-01-10 09:37:18 +01:00
Oleg Nenashev ad1ca7101b Merge pull request #4414 from jglick/WORKSPACE_TMP-JENKINS-60634
[JENKINS-60634] Define $WORKSPACE_TMP for (non-Pipeline) builds
2020-01-08 11:47:56 +01:00
Oleg Nenashev c059ccb0d8 Merge pull request #4418 from darxriggs/fix-typos
Fix typos & spelling in Javadoc and WebUI
2020-01-08 11:43:57 +01:00
Jesse Glick 0bd5d671d2 Merge pull request #4415 from jglick/enable-security-JENKINS-40228
[JENKINS-40228] Remove Enable Security checkbox in the Global Security configuration (follow-up)
2020-01-07 09:22:04 -05:00
Jesse Glick f230462f15 #4254 incorrectly converted AntClassLoader.loadResource to a Java 5 for-loop. 2020-01-06 10:19:26 -05:00
René Scheibe f22d34675b Fix typos & spelling 2020-01-06 11:07:55 +01:00
Jesse Glick e6e8c387d5 Prevent endless recursion in SezpozModule.resolve. 2020-01-04 20:14:13 -05:00
Jesse Glick 5773970a64 Merge branch 'JENKINS-40228' of github.com:ksenia-nenasheva/jenkins into enable-security-JENKINS-40228 2020-01-04 11:27:26 -05:00
Oleg Nenashev 1f47ad6ea2 Merge pull request #4408 from StefanSpieker/spotbugs_switch
Fixed Spotbugs Switch related issues and added Suppresses
2020-01-04 14:16:19 +01:00
Oleg Nenashev 9640790fe1 Merge pull request #4413 from jglick/UpdateCenter.isSiteDataReady-JENKINS-60625
[JENKINS-60625] Prevent Jenkins page rendering from being blocked when the update center data parsing is in progress
2020-01-04 14:16:01 +01:00
StefanSpieker 0e6bb91864 Return error when invalid string is passed as a Run status CLI argument (#4212)
* removed redundnat null checks of nonnull values

* integrated suggestions

* removed local jenkins variable as suggested

* replaced null check with check for error object
2020-01-03 23:39:22 +01:00
Josh SorefandOleg Nenashev 9b8047acd1 IntelliJ/Java: Duplicate declaration -> AntClassLoader.getUrl (#4254)
* IntelliJ/Java: Duplicate declaration

AntClassLoader.getUrl

* Add missing import for annotation

* Switch from Vector to ArrayList<File>

* Drop inferable File

* Use for (File pathComponent : pathComponents) sugar

* Accept generic container type for getUrl

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

Co-authored-by: Oleg Nenashev <o.v.nenashev@gmail.com>
2020-01-03 23:35:38 +01:00
Vincent Latombe dd59e8c11c [JENKINS-60449] Attempt to fix an odd case of OptionalExtension blowing up Jenkins (#4393)
* Add new module optional-depender and a new failing test

* Variant plugin is a dependency of optional-depender

Optional-depender contains the following class

@OptionalExtension(requirePlugins = {"dependee"})
public class OptionalDependerExtension {
      private static void foo(Dependee d) {

      }
}

* [JENKINS-60449] Move plugin initialization at the end, keep only one extension refresh

* Improve logic to detect classloading issues

Inspect all declared constructors/methods/fields recursively to exclude
failing classes from Guice rather than have Guice explode.

This also fix the failing test, but the previous commit is still better
because it avoids an extra Jenkins.get().refreshExtensions() call.

* Only test resolveClass method if the classloader is not the bootstrap one
2020-01-03 23:26:35 +01:00
Jesse GlickandDaniel Beck e621b6e0cd Be explicit that UpdateSite.hasUnparsedData is not intended as an API.
Co-Authored-By: Daniel Beck <1831569+daniel-beck@users.noreply.github.com>
2020-01-03 16:49:04 -05:00
Jesse Glick 84f66e3c4e [JENKINS-60634] Define $WORKSPACE_TMP for (non-Pipeline) builds. 2020-01-03 14:57:53 -05:00
Jeff Thompson 50921ccbec Reduce JnlpSlaveAgentProtocol to minimum.
Remove anything unnecessary. Move SLAVE_SECRET to JnlpAgentReceiver
and alias it for existing usages.
2020-01-03 12:08:24 -07:00
Jeff Thompson bd0d9560dc Update to Remoting without protocols. 2020-01-03 11:06:06 -07:00
Jesse Glick 29fbc9c451 Quiet down log message about parsing JSON. (Though it is kind of interesting just how slow it is.) 2020-01-02 21:29:35 -05:00
Jesse Glick af7c4bece2 [JENKINS-60625] Introduced UpdateCenter.isSiteDataReady for use from administrative monitors. 2020-01-02 17:23:01 -05:00
Stefan Spieker dbaec7ec03 set spotbugs URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD to ignore because reads are not detectable by spotbugs 2019-12-31 11:37:20 +01:00
Stefan Spieker 492505fd5d fixed spotbugs switch case related findings 2019-12-31 11:13:22 +01:00
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
Pierre Beitz 4b6049d586 [JENKINS-21311] Make the queue/cancelItem API an API. (#4395)
* [JENKINS-21311] Make the queue/cancelItem API an API.

This change:
* documents the API
* adds meaningful return codes to help API caller.

* [JENKINS-21311] Code review

* [JENKINS-21311] Update failing integration test
2019-12-30 10:06:40 +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
Jeff Thompson 659f38886c Cleanup JavaDoc from references to removed classes. 2019-12-20 15:26:15 -07: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
Jeff Thompson d611ba1b91 Remove deprecated agent protocols. 2019-12-04 13:59:43 -07: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
Andrea Scarpino 10a52c102b JENKINS-42658: fix NPE when the slave if offline 2019-11-25 12:34:57 +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