* 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
* [JENKINS-72371] rework node monitor configuration
This PR reworks the way node monitors are configured. It ensures that
also monitors which are set to ignored, can be configured.
Previously, there was a checkbox before each monitor, where the
behaviour was not totally clear. It meant that the monitor is ignored
but still collecting data and not disabled as one might think. But when
the monitor was disabled any configuration was lost and default values
were used.
* improve description
* fix formatting
* add since
[JENKINS-72449] Specify that no fallback to the default locale should be used when looking up a resource bundle
When running the JVM with a default locale that is not english, the
resource bundle lookup for english would return a bundle with that
default locale, instead of using the "default" that is english.
Also changed bundle resolution to use uberClassloader rather than
iterating on all plugin classloaders
* show node monitors on agent page
add an advanced button on the agent page. When clicking it will show the
node monitors for this agent including any warnings/errors
* fix style
* Class loading deadlock between `PermalinkProjectAction` & `PeepholePermalink`
* Checkstyle
* Clearer reproducer
* Do not let `Permalink` refer to its subclass `PeepholePermalink` in its static initializer
* Cleaner test
* Checkstyle
* Maybe we should not run `initialized` from `Job.<clinit>` either
* Add `ExtensionList.lookupFirst` convenience method.
When introducing an extension point that is meant to allow overriding a default behaviour with another implementation,
generally the caller only cares about looking up only one implementation, the one with the highest ordinal.
* Fix javadoc
Co-authored-by: Jesse Glick <jglick@cloudbees.com>
---------
Co-authored-by: Jesse Glick <jglick@cloudbees.com>
make displayname of HistoryWidget configurable
for use with customizable-build-now plugin
make the placeholder for the history filter less specific, the title
already explains what this shows so just `Filter...` should be enough.
* [JENKINS-71715] Allow plugins with alternate build log visualizations to handle console links from core and other plugins
* [JENKINS-71715] Apply suggestions with ordinal extension and @since TODO
* [JENKINS-71715] Public @Extension
* Add or fix @since todo
we usually don't put versions but put todo instead and these versions get resolved _after_ merges.
Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com>
* [JENKINS-71715] Apply suggestions from reviews
* [JENKINS-71715] Switch ConsoleURLProvider to interface and add Functions.getContextRelativeUrl
* [JENKINS-71715] Refactor ConsoleUrlProvider API and add Functions.getConsoleUrl method for use in Jelly files
* [JENKINS-71715] Fix casing of ConsoleURLProvider.java
* [JENKINS-71715] Add global and per-user configuration options for ConsoleUrlProvider
* [JENKINS-71715] Fix Javadoc reference
* [JENKINS-71715] Remove outdated TODO comment
* [JENKINS-71715] Miscellaneous updates based on review feedback
* [JENKINS-71715] Fix Javadoc links
* [JENKINS-71715] Update console links for build list and build time trend widgets
* [JENKINS-71715] Functions.getConsoleUrl must take Queue.Executable instead of Run
* [JENKINS-71715] Simplify test using WebClient.executeOnServer
* [JENKINS-71715] Add constructor
* [JENKINS-71715] Preserve old behavior of p:console-link as a fallback for atypical consumers
* [JENKINS-71715] Ignore invalid URLs and consult global providers if user providers fail to provide a valid URL
* [JENKINS-71715] Move ConsoleUrlProviderGlobalConfiguration into AppearanceCategory
* [JENKINS-71715] Hide AppearanceGlobalConfiguration if ConsoleUrlProviderGlobalConfiguration is disabled and would be the only option on the page
* [JENKINS-71715] Update help text and Javadoc based on review feedback, and filter out default provider in global config
Co-authored-by: Daniel Beck <daniel-beck@users.noreply.github.com>
* [JENKINS-71715] getProvidersDescriptors can be an instance method
---------
Co-authored-by: Baptiste Mathus <bmathus@gmail.com>
Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com>
Co-authored-by: Devin Nusbaum <dnusbaum@cloudbees.com>
Co-authored-by: Devin Nusbaum <dwnusbaum@users.noreply.github.com>
Co-authored-by: Daniel Beck <daniel-beck@users.noreply.github.com>
[JENKINS-72159] deactivate Markedoffline monitor when agents are online
When an agent comes online again after disk space issues are resolved
the corresponding admin monitor is now deactivated if there are no other
agents left that are temporarily offline due to disk space issues.
* [JENKINS-64816] prepare for support of node monitors by JCasC
In order that configuration as code plugin can properly support node
monitors we need to add databound constructors.
* fix warnings
* add javadoc that DataBoundConstructor is a must
* remove duplicate extension
* delete obsolete install methods