Commit Graph
458 Commits
Author SHA1 Message Date
7006cded64 [JENKINS-73278] Migrate core from EE 8 to EE 9 (#9672)
Co-authored-by: Kevin Guerroudj <91883215+Kevin-CB@users.noreply.github.com>
Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com>
2024-09-03 14:59:04 -07:00
Basil Crow 8793619682 Miscellaneous code cleanup (#9384) 2024-06-15 06:27:17 -06:00
Basil Crow 1381726b2f Use isEmpty() where possible (#9383) 2024-06-14 07:21:57 -06:00
Basil Crow d2d1d0d20f Use pattern matching for instanceof (#9382) 2024-06-13 06:04:42 +01:00
Basil Crow f6e9283921 Replace usages of JZlib with native Java Platform functionality (#9312)
* Replace usages of JZlib with native Java Platform functionality

* Simplify import of class

* Pull in Stapler version of this change
2024-05-26 21:14:58 -06:00
Basil Crow c10cafc2b5 [JENKINS-10629] Migrate from Commons Compress to Ant (#9311) 2024-05-26 21:14:41 -06:00
Basil Crow 0117bf3e34 [JENKINS-73170] Upgrade Commons FileUpload from 1.5 to 2.0.0-M2 (#9259) 2024-05-18 09:42:08 -07:00
jean pierre Lerbscher c729b41763 Use Collection.isEmpty() to test if collections are empty (#9072)
Fix issue S1155 'Collection.isEmpty()' should be used to test for emptiness
2024-03-26 09:13:21 -06:00
Lutz Neugebauer 9f68c181de [JENKINS-72540] FilePath.copyRecursiveTo() copying now also if local and remote have incompatible character sets at binary level (#8860)
* allow specification of achrive's file name encoding in Archiver#create()

For JENKINS-72540 only needed for tar, but changed zip for consistency as well.

* revise copyRecursiveTo to use same file name encoding locally and remote

such that local and remote understand each other
Otherwise, if remote is z/OS with native EBCDIC encoding the file names
will be in EBCDIC and fails reading
2024-03-05 21:01:35 +01:00
Basil Crow 3c042d12b8 Reduce usage of StringUtils (#8999) 2024-03-01 23:18:05 +01:00
Robert Sandell b91a57ca20 Cleaning up more FilePath API restrictions (#8924) 2024-02-06 23:14:52 +01:00
Robert SandellandAlexander Brandes 3e6dc60edb Unrestrict FilePath.isDescendant (#8913)
* Unrestrict FilePath.isDescendant

I needed this and noticed that it was still restricted.

* Fix spotless

Signed-off-by: Alexander Brandes <mc.cache@web.de>

---------

Signed-off-by: Alexander Brandes <mc.cache@web.de>
Co-authored-by: Alexander Brandes <mc.cache@web.de>
2024-02-02 16:40:09 +01:00
Mark Waite c8156d41f2 [JENKINS-72469] Avoid repeated tool downloads from misconfigured HTTP servers (#8814)
* [JENKINS-72469] Avoid repeated tool downloads from misconfigured HTTP servers

The Azul Systems content delivery network stopped providing the
last-modified header in their URL responses.  They only provide the
ETag header.

Add ETag support to the Jenkins FilePath URL download method so that if ETag is
provided, we use the ETag value.  If last-modified is provided and matches, we
continue to honor it as well.

https://issues.jenkins.io/browse/JENKINS-72469 has more details.

https://community.jenkins.io/t/job-stuck-on-unpacking-global-jdk-tool/11272
also includes more details.

Testing done

* Automated test added to FilePathTest for code changes on the controller.
  The automated test confirms that even without a last-modified value,
  the later downloads are skipped if a matching ETag is received.
  The automated test also confirms that download is skipped if OK is
  received with a matching ETag.  No automated test was added to confirm
  download on the agent because that path is not tested by any of the
  other test automation of this class.

* Interactive test with the Azul Systems JDK installer on the controller.
  I created a tool installer for the Azul JDK.  I verified that before
  this change it was downloaded each time the job was run.  I verified
  that after the change it was downloaded only once.

* Interactive test with the Azul Systems JDK installer on an agent.
  I created a tool installer for the Azul JDK.  I verified that before
  this change it was downloaded each time the job was run.  I verified
  that after the change it was downloaded only once.

* Interactive test on the controller with a file download from an NGINX
  web server confirmed that the tool is downloaded once and then later
  runs of the job did not download the file again.

* Use equals instead of contains to check ETag

Don't risk that a substring of an earlier ETag might cause a later
ETag to incorrectly assume it does not need to download a modified
installer.

* Use weak comparison for ETag values

https://httpwg.org/specs/rfc9110.html#field.etag describes weak comparison
cases and notes that content providers may provide weak or strong entity
tags.  Updated code to correctly compare weak and strong entity tags.

Also improves the null checks based on the suggestions from @mawinter69
in https://github.com/jenkinsci/jenkins/pull/8814#discussion_r1438909824

* Test comparison of weak and strong validators

* Do not duplicate test args, more readable

* Use better variable names in test

Cover more branches in the equalEtags method as well

* Fix variable declaration order
2024-01-01 20:09:42 -07:00
Basil Crow 8c921e7a9e [JENKINS-72203] Revert jenkinsci/jenkins#8565 (#8637)
This reverts commit dc190bac8a.
2023-10-23 12:36:05 -07:00
dc190bac8a [JENKINS-72028] replace deprecated URL() at core/src/main/java/hudson/ (#8565)
* missing 'alt' attribute added

* missing 'alt' attribute added

* replaced 'new URL' to 'new URI' per Java 11 target codebase

* Revert "replaced 'new URL' to 'new URI' per Java 11 target codebase"

This reverts commit aeef4c1e4b.

* replaced deprecated URL() with URI#.toURL()

* updated code per review

* updated

* updated code

* added back file

* Update core/src/main/java/hudson/cli/InstallPluginCommand.java

Co-authored-by: James Nord <jtnord@users.noreply.github.com>

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

remove non required as per suggestion

Co-authored-by: James Nord <jtnord@users.noreply.github.com>

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

Co-authored-by: James Nord <jtnord@users.noreply.github.com>

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

* Spotless

---------

Co-authored-by: Alexander Brandes <mc.cache@web.de>
Co-authored-by: James Nord <jtnord@users.noreply.github.com>
2023-10-12 00:45:44 +02:00
Jeff ThompsonandKevin-CB 80452662b3 [SECURITY-1807]
Co-authored-by: Kevin-CB <kguerroudj@cloudbees.com>
2023-02-23 07:58:40 +00:00
jhonDoe15 5f69e2da86 Grammar and typos fixes (#7202) 2022-10-03 20:22:41 +01:00
Basil Crow 76e5c98dd3 Use try-with-resources where possible (#6765) 2022-07-04 17:36:33 -07:00
Basil Crow 6d179998e1 Use Java 11 methods where possible (#6700) 2022-06-30 09:31:36 -07:00
Greg Swift 4a38d651fb [JENKINS-51913] Prevent archiveArtifacts from displaying a stack trace when no artifacts are found (#6475) 2022-04-15 06:38:09 -07:00
Alex 680aab31fd Fill in @since TODO annotations (#6396) 2022-03-24 23:22:19 -07:00
Basil Crow b633ba5189 Deprecate PosixException in favor of IOException (#6345) 2022-03-09 12:07:47 -08:00
Mark Waite fa4e71edaa Update Javadoc @since for API additions (#6331) 2022-03-05 07:35:43 -08:00
Basil Crow 3b29e9d460 Fix more DM_DEFAULT_ENCODING SpotBugs violations (#6098) 2022-01-07 06:29:55 -08:00
Basil Crow e27b310065 Enable whitespace-related Checkstyle checks (#6149) 2022-01-03 08:55:03 -08:00
Basil Crow e61ade14e6 Fix remaining MS_SHOULD_BE_FINAL SpotBugs violations (#6141) 2022-01-02 08:08:25 -08:00
Basil Crow 02eecd8a49 Consistent indentation with spaces rather than tabs (#6147) 2022-01-01 11:45:56 -08:00
Basil Crow b25b45bc90 Remove trailing whitespace (#6138) 2021-12-31 07:54:03 -08:00
Basil Crow 8a5e309256 Fix DM_DEFAULT_ENCODING SpotBugs violations (#6050) 2021-12-22 20:33:59 -08:00
Daniel BeckandDaniel Beck b81428f410 [JENKINS-67173] Remove Callable allowlist and FilePath agent-to-controller support (#5885)
Co-authored-by: Daniel Beck <daniel-beck@users.noreply.github.com>
2021-12-20 08:00:51 -08:00
Basil Crow 165d559469 Fix RV_RETURN_VALUE_IGNORED_BAD_PRACTICE SpotBugs violations (#6025) 2021-12-11 12:51:46 -08:00
Daniel BeckandDaniel Beck b4a622922c Improve FilePath API and Javadoc (#6033)
Co-authored-by: Daniel Beck <daniel-beck@users.noreply.github.com>
2021-12-11 12:48:41 -08:00
Basil Crow cd91b39f56 Fix SIC_INNER_SHOULD_BE_STATIC SpotBugs violations 2021-12-06 14:02:59 -08:00
Basil Crow d5cea69751 Prevent new SpotBugs violations from being introduced (#6015) 2021-12-06 13:52:38 -08:00
Basil Crow 623b7340d5 Enable Javadoc-related Checkstyle checks (#5968) 2021-12-03 18:56:50 -08:00
Basil Crow cd92d7f88f Fix PublicConstructorForAbstractClass Error Prone violations (#5951) 2021-12-03 12:25:01 -08:00
Basil Crow 8ee11e2e30 Migrate from Apache Commons StringUtils#join to Java Platform String#join (#5992) 2021-12-01 08:50:11 -08:00
Basil Crow a1ab51594d Fix UnusedException Error Prone violations (#5738) 2021-11-30 15:03:22 -08:00
Daniel BeckandDaniel Beck 0accf411e9 [JENKINS-67063] Revert canonicalization of entries when untarring (#5900)
Co-authored-by: Daniel Beck <daniel-beck@users.noreply.github.com>
2021-11-09 08:07:18 +00:00
Daniel Beck 104c751d90 [SECURITY-2455] 2021-11-02 03:46:29 +00:00
Daniel Beck 63cde2daad [SECURITY-2455] 2021-10-25 12:52:24 +00:00
Basil Crow 3d6d8ffaaf Enable Warnings Next Generation (#5752)
* Fix Javadoc warnings

* Enable Warnings Next Generation plugin

* Stop recording Maven warnings
2021-10-05 19:11:09 +02:00
Basil Crow 632033d6ad Sort imports (#5732) 2021-09-18 09:39:42 +01:00
Basil Crow decb01852c Update external URLs (#5709) 2021-09-07 08:09:42 +01:00
Jesse Glick fca6d7194f Using Comparator factories in a couple more cases 2021-08-30 15:01:59 -04:00
Jesse Glick b23b674fc4 Merge branch 'master' of https://github.com/jenkinsci/jenkins into anonymous-to-lambda 2021-08-30 14:18:15 -04:00
Daniel BeckandDaniel Beck 96a5526bdb Terminology cleanup: Controller / Built-In Node (#5425)
Co-authored-by: Daniel Beck <daniel-beck@users.noreply.github.com>
2021-08-15 20:31:53 +01:00
Raihaan Shouhell b8127af111 Merge pull request #5613 from trungPa/JENKINS-66094
[JENKINS-66094]Use Path.startsWith() for subdirectory check when unzipping
2021-07-25 22:02:52 +08:00
Basil Crow 0913566aef Remove native chmod(2) and stat(2) support (#5606) 2021-07-23 00:05:06 +08:00
Trung Pham 0c89a7f457 Use Path.startsWith() for subdirectory check when unzipping 2021-07-08 19:05:32 +07:00