* [JENKINS-69191] icon for agent not accepting tasks
This change adds another icon for the case when an agent is not
accepting tasks, e.g. because the retention strategy avoids this.
The makes it easier to decide whether an agent is in a non healthy
state.
A legend button is added below the computer overview table that shows an
explanation for the icons.
* fix style
* [JENKINS-72796] stable context classloader for Computer.threadPoolForRemoting
Whilst the threadpool used reset the context classloader at the end of
any task, it did not ensure that the initial c;lassloader used was
anything sepcific, rather it would use whatever the calling threads
contextClassLoader was.
This is now fixed as we use the Jenkins WebApp classloader (same as
the Timer) which is used by (A)PeriodicTasks.
Whilst we should really not have a context classloader (aka null) and
this should be set where needed by code, almost everywhere in Jenkins
the context classloader is already the webapp classloader, and so
setting this to be different depending on how things where called would
seemingly be a little scary. Arguably this and other context
classloaders should be all set to null and any code that wants different
should be changed, but this is a larger piece of work that would have
potential impact on an unknown number of plugins in the ecosystem, so
this fix uses what was set > 90% of the time.
* Update core/src/test/java/hudson/model/ComputerTest.java
---------
Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com>
* 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
* [JENKINS-60866] Apply Stapler update for CSP-compliant st:bind
* [JENKINS-60866] Make renderOnDemand CSP-compliant
* Thanks Spotless
* Make Stapler incrementals work
* Update Stapler to new incremental
* Fixup bad merge
* Update Stapler, add test demonstrating st:bind working
* Address review feedback
* Add test for null bind, update Stapler
* Checkstyle
* More tests
* Use released Stapler
---------
Co-authored-by: Daniel Beck <daniel-beck@users.noreply.github.com>
Co-authored-by: Basil Crow <me@basilcrow.com>
* [JENKINS-71326] - Support colored badges in breadcrumb dropdown
* [JENKINS-71326] - Support colored badges in breadcrumb dropdown - Creating a badge jelly view.
* [JENKINS-71326] - Support colored badges in breadcrumb dropdown - Adding class attribute to the badge jelly.
* Apply suggestions from code review
Co-authored-by: Alexander Brandes <brandes.alexander@web.de>
* [JENKINS-71326] - Support colored badges in breadcrumb dropdown - Lint and license Fix
---------
Co-authored-by: Alexander Brandes <brandes.alexander@web.de>
* 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>
[JENKINS-71700] avoid stacktrace in artifactarchiver when no artifacts
When the validateAntFileMask fails because there are too many files or
it takes too long an exception is thrown that was intendend to be
catched in the ArtifactArchiver. But when the build happens on an agent
and not the built-in, this didn't work as the the exception is deeply
wrapped in 2 other exceptions.
As printing this information is of no real help, just catch all
exceptions and print them to the jenkins log but not the build log. Any
other message might just be misleading as one could get the impression
that jenkins stopped after looking at 10000 files and only because of
this no files where archived but this is not the case. At this place the
ArtifactArchiver is just trying to give a hint why it didn't archive
anything.
* Missing `VirtualFile.run` usage in `DirectoryBrowserSupport`
* Might as well handle `containsSymLink` the same way. Will never matter for artifact display with either the built-in or pluggable managers, but could improve performance of workspace listing with slow agent connections.
* Checkstyle
---------
Co-authored-by: Daniel Beck <daniel-beck@users.noreply.github.com>
Add end of life data for several more Linux releases
Adds data for:
* Alpine Linux 3.19
* Amazon Linux 2 (already end of life for Jenkins)
* Amazon Linux 2023
* Fedora 39
Includes test data for more Linux operating systems that were already
included in the end of life data.
* [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
by implementing `isAcceptingTasks` the availability strategy ensures
that no builds can start when the agent should not do anything.
The current behaviour with an inbound agent is that the strategy
disconnects the agent, just to get connected again by the agents java
process followed by a disconnection a minute later and so on.
After it is connected, the agent is actually accepting tasks.
Additionally the change will only disconnect the agent when the controller
the controller can itself launch the agent, this means inbound agents
are not connected, to avoid playing jojo. The agent will just not accept
new tasks for execution.
The change also avoids the problem in [JENKINS-11889] for outbound
agents where the accepting tasks of an agents seems to be not reset when
changing the availability strategy to always on.
* [JENKINS-71965] fix timezone in build history
the timezone shown was always the daylight saving time when the users
selected timezone has daylight saving. The change will now consider the
actual timestamp of the build to determine if it was in daylight saving
time to properly calculate the timezone to show.
* make locale aware