Commit Graph
14351 Commits
Author SHA1 Message Date
Daniel BeckandDaniel Beck 3ad945f7f3 [JENKINS-72636] Prevent authenticated access to Resource Root URL (#8922)
Co-authored-by: Daniel Beck <daniel-beck@users.noreply.github.com>
2024-02-02 16:44:33 +01:00
Jesse Glick 81679b4598 AbstractPasswordBasedSecurityRealm.authenticateByPassword (#8921) 2024-02-02 16:40:21 +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
Bob Du abf3b41ab3 [JENKINS-72627] Improve locale parsing for loading of localised help files (#8912)
* fix only use preferred accept-language

Signed-off-by: BobDu <i@bobdu.cc>

* revert asterisk imports

Signed-off-by: BobDu <i@bobdu.cc>

* add unit test getStaticHelpUrl

Signed-off-by: BobDu <i@bobdu.cc>

* improve unit test getStaticHelpUrl

Signed-off-by: BobDu <i@bobdu.cc>

* rename assertThatLocaleResourceIs method

Signed-off-by: BobDu <i@bobdu.cc>

---------

Signed-off-by: BobDu <i@bobdu.cc>
2024-02-02 16:39:56 +01:00
Jesse Glick 57419f43b9 [JENKINS-72613] Introduced ItemGroup.getItemName (#8902) 2024-02-01 08:57:44 +01:00
Markus Winter ef378cc38d [JENKINS-71700] avoid stacktrace from artifactarchiver when no artifacts are found (#8908)
[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.
2024-02-01 08:56:48 +01:00
Jesse Glick ddf68d3874 Fixing NotSerializableException: org.acegisecurity.context.SecurityContext$1 (#8918) 2024-02-01 08:55:14 +01:00
Filipe Roque c32f4dfc7f Replace reference to ui-samples-plugin with design-library in javadoc (#8909)
ui-samples-plugin is suspended and has been replaced with design-library:

> Plugin distribution has been suspended, see https://groups.google.com/g/jenkinsci-dev/c/2vGn3t9gZ0Y for details.
https://plugins.jenkins.io/ui-samples-plugin/

https://github.com/jenkinsci/design-library-plugin/pull/14
2024-01-28 09:30:20 -07:00
Markus Winter f640efc087 [JENKINS-71025] Remove inline JS from configure-common (#8866)
* [JENKINS-71025] Remove inline JS from configure-common

replaces #6861

* remove inline jd for jdk check
2024-01-25 07:45:20 -07:00
Jesse GlickandDaniel Beck a665b45ba5 Missing VirtualFile.run usage in DirectoryBrowserSupport (#8874)
* 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>
2024-01-25 07:43:09 -07:00
Balaji Sivasakthi a32f24c449 [JENKINS-72579] Adjust heap dump file name for compatibility with OpenJDK file suffix requirements (#8881) 2024-01-24 13:36:49 -08:00
Kevin-CB 554f037820 [SECURITY-3314] 2024-01-16 17:07:44 +00:00
Daniel Beck de450967f3 [SECURITY-3315] 2024-01-16 17:07:37 +00:00
Mark Waite 72eb26a63b Update operating system end of life data (#8864)
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.
2024-01-14 07:17:49 -07:00
Alexander Brandes 50bc384abd Fill in since todo (#8839) 2024-01-08 09:42:13 +00:00
Tim Jacomb e859e9cd9c Allow plugins to override boot failure view (#8442) 2024-01-05 20:40:12 +00:00
Basil CrowandTim Jacomb 444f2de993 Improve crash consistency on Linux (#8815)
* Improve crash consistency

* `fsync` the correct parent directory

* More flexibility

* Add reference to man page

* fix formatting

---------

Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com>
2024-01-03 10:27:32 +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
Markus Winter 3a92445c2b [JENKINS-72370][JENKINS-11889] fix SimpleScheduledRetentionStrategy with inbound agents (#8717)
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.
2023-12-28 10:59:43 +01:00
Markus Winter 48da635be2 [JENKINS-71965] fix timezone in build history (#8800)
* [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
2023-12-25 07:21:53 -07:00
Jesse Glick df03159afe Restore JCasC compatibility for JNLPLauncher.tunnel (#8793)
* Restore JCasC compatibility for `JNLPLauncher.tunnel`

* Also removing `@Deprecated` on fields & getters
2023-12-23 16:49:49 -07:00
Daniel BeckandDaniel Beck 044c071235 Fix import used for Javadoc (#8790)
Co-authored-by: Daniel Beck <daniel-beck@users.noreply.github.com>
2023-12-21 11:37:09 -07:00
Daniel Beck b0cec67728 Add telemetry for basic Java system properties (#8787) 2023-12-19 09:42:55 +01:00
Markus Winter 7258cad414 [JENKINS-72371] rework node monitor configuration (#8719)
* [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
2023-12-18 18:21:48 +01:00
Basil Crow 3f1880179c EOL Global-Mask-Classes (#8785) 2023-12-16 09:47:37 +01:00
Vincent Latombe 259ccc06fb [JENKINS-72449] Specify that no fallback to the default locale should be used when looking up a resource bundle via I18n action. (#8776)
[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
2023-12-14 21:35:49 +01:00
Vincent Latombe 302e6ac2d1 Logging improvements to Run related classes (#8777)
Logging improvements to Run related classes
2023-12-14 21:35:18 +01:00
Markus Winter 0a7ab5f06e [JENKINS-72157] ensure uptime is independent of system clock (#8771) 2023-12-13 21:01:01 +01:00
Markus Winter 64dc3844b5 show node monitors on agent page (#8725)
* 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
2023-12-13 21:00:17 +01:00
Jesse Glick 6a2d94bfbe Simplifying JNLPLauncher (#8762) 2023-12-13 11:10:29 -08:00
Basil Crow 05037a087f Print deprecation warning when using -jnlpUrl (#8773) 2023-12-13 11:10:02 -08:00
Jesse Glick f9a777bc68 Class loading deadlock between PermalinkProjectAction.Permalink & PeepholePermalink (#8736)
* 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
2023-12-09 10:25:15 +01:00
Hervé Le Meur b8344b98ec [JENKINS-72343] Accept all 2xx and 3xx status codes to validate proxy in HTTP Proxy Configuration (#8700)
* Accept all 2xx and 3xx status codes validate proxy in HTTP Proxy Configuration

* add status code in the response to the user
2023-12-05 07:28:30 +01:00
Vincent LatombeandJesse Glick 0f0d81b306 Add ExtensionList.lookupFirst convenience method. (#8735)
* 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>
2023-12-05 07:27:39 +01:00
Markus Winter c637d4168e make displayname of HistoryWidget configurable for alternate text (#8740)
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.
2023-12-04 09:16:10 +01:00
Olivier Lamy 1e9372ee57 Move proxy configuration form out of pluginManager screens as it is not related (#8693)
* Move proxy configuration form out of pluginManager screens as it is not related

---------

Signed-off-by: Olivier Lamy <olamy@apache.org>
2023-12-04 11:02:08 +10:00
Carroll ChiouandAlexander Brandes ec27a074c9 [JENKINS-71737] fix redirect when submitting cloud changes (#8505)
Co-authored-by: Alexander Brandes <mc.cache@web.de>
2023-11-29 09:02:20 +00:00
Santhosh-CloudBandDaniel Beck f9f542bffd Added validation of FIPS password length (#8694)
Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com>
2023-11-27 10:09:15 +00:00
Markus Winter aad79effa1 [JENKINS-72009, JENKINS-72200, JENKINS-24947] various fixes and improvements around disk space monitoring (#8593) 2023-11-24 22:16:57 +00:00
Basil Crow f4fe5710a5 Refuse to load the Jenkins test harness in production (#8714) 2023-11-23 14:04:38 +01:00
d9cbaa006a [JENKINS-71726] [JENKINS-71727] remove inline javascript (#8313)
* [JENKINS-71727] remove inline javascript

Also JENKINS-71726

* missing id

* fix script tag

Co-authored-by: Kevin Guerroudj <91883215+Kevin-CB@users.noreply.github.com>

---------

Co-authored-by: Kevin Guerroudj <91883215+Kevin-CB@users.noreply.github.com>
Co-authored-by: Mark Waite <mark.earl.waite@gmail.com>
2023-11-20 04:36:12 -07:00
b9b3e6bfa8 [JENKINS-71715] Allow plugins with alternate build log visualizations to handle console links from core and other plugins (#8321)
* [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>
2023-11-18 14:58:20 -07:00
Markus Winter fda0949dc5 [JENKINS-72159] deactivate MarkedOffline monitor when agents are online (#8618)
[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.
2023-11-18 14:57:44 -07:00
Markus Winter 442a42f438 [JENKINS-64816] prepare for support of node monitors by JCasC (#8629)
* [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
2023-11-18 14:56:47 -07:00
Jesse Glick 0297870148 Pull up AbstractFolder.delete logic into AbstractItem (#8645)
* Pull up `AbstractFolder.delete` logic into `AbstractItem`

* Warn if `Queue.cancel(Item)` returns `false`
2023-11-16 22:47:32 +01:00
Basil Crow 41d09e0fa0 Stop recommending -jnlpUrl (#8639) 2023-11-09 08:09:00 -07:00
Jesse Glick e4fe5042e4 Temporary memory leak in FutureImpl.executors (#8640)
* Temporary memory leak in `FutureImpl.executors`

* https://github.com/jenkinsci/jenkins-test-harness/pull/669 released

* Skip new test on Windows https://github.com/jenkinsci/jenkins/pull/8640#discussion_r1373797374
2023-11-08 06:39:28 -07:00
Stefan Spieker 293b86fd86 Deleted long deprecated and unused UserProperties (#8679)
deleted deprecated UserProperties
2023-11-07 21:32:59 +01:00
dd04e33567 [JENKINS-60866][JENKINS-71797] Remove timeline widget (#6869)
Co-authored-by: Daniel Beck <daniel-beck@users.noreply.github.com>
Co-authored-by: Basil Crow <me@basilcrow.com>
Co-authored-by: Alexander Brandes <mc.cache@web.de>
2023-11-05 19:24:25 +00:00
Jesse Glick d06f36076f Log Errors from SlaveComputer._connect (#8675) 2023-11-05 13:43:01 +01:00