* [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
(cherry picked from commit c8156d41f2)
Show Java version admin monitor at 12 months and 3 months
Daniel Beck described his recommendation to alert users at 12 months
and at 3 months prior to the end of support of a Java version.
He wrote:
> The second warning in particular needs to strike a balance between
> being shown late enough so it's actually relevant for whoever hasn't
> acted yet, while being shown early enough that slightly more elaborate
> environments (difficult to schedule maintenance windows) are informed
> in time. 3 months aligns rather nicely with the LTS schedule where
> we kinda expect folks to do that anyway.
>
> 18/9, or even 12/6 errs too far on the side of those for whom this is
> extreme effort (and who dismissed the first message more appropriate for
> their environment!), while showing everyone else completely irrelevant
> notices they won't care about for many months to come.
https://github.com/jenkinsci/jep/pull/400#discussion_r1371510566 provides
more details.
The Java 8 to Java 11 transition saw a significant change in adoption of
Java 11 once the admin monitor was visible to users. That was shown
slightly over 12 months before the release that required Java 11.
This change continues that pattern of 12 months warning before end
of support.
https://github.com/jenkinsci/jep/pull/400#discussion_r1375623888 has a
graph that shows the adoption curves for Java 8, Java 11, and Java 17.
(cherry picked from commit aeb64c0c3d)
* [JENKINS-72020] Reorder clouds
Adding back controls to reorder clouds.
Since clouds order is taken into account for node provisioning, users should be able to reorder them as needed.
* Use tertiary buttons
* Separate screen for reordering
* Include reordering in the cloud list directly (thanks @timja)
* Show the save button after the first reordering
* Separate JS
Only display order column when admin
* Fix reviews
* Remove unused string
* Put drag-and-drop handle in the cloud icon column
* Add missing permission check
* Add a small blurb to clarify what cloud order is used for.
(cherry picked from commit 16bca2e2ea)
* [JENKINS-72170] fix for nested-hetero-list entries
when a plugin defines the hetero-list elements on its own and still uses
an <input type="button"> element and an inner element is already using
a hetero-list with a <button> element, then the old input wasn't
converted to a button as the inner button was found first.
Avoid this by converting all inputs to buttons before actually looking
up the button.
Recreate the hetero-list.js file to avoid the "No such adjunct found"
warning message
* remove hetero-list.js again
(cherry picked from commit 97dde8f184)
* [JENKINS-71252] Show form validation for hidden elements
* [JENKINS-70793] Clear all validation output on update
---------
Co-authored-by: Daniel Beck <daniel-beck@users.noreply.github.com>
(cherry picked from commit 012fa00451)
Upgrade to Winstone 6.14 which contains an upgrade to Jetty 10.0.17
Signed-off-by: Olivier Lamy <olamy@apache.org>
(cherry picked from commit 8792ea07e4)