Commit Graph
14331 Commits
Author SHA1 Message Date
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
Mark Waite aeb64c0c3d [JENKINS-72252] Warn 12 months and 3 months before end of Java support (#8661)
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.
2023-11-04 21:22:05 -06:00
Mustafa UluandDaniel Beck e70dc62ed3 [JENKINS-72222] Fix inconsistent wording between login page and security configuration (#8633)
* [JENKINS-72222] Fix inconsistent wording between login page and security configuration

* Update the label

* Update core/src/main/resources/hudson/security/GlobalSecurityConfiguration/index.properties

Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com>

---------

Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com>
2023-10-30 12:56:03 +01:00
Jesse Glick 36de7a568d More helpful error message for ExtensionList.lookupSingleton (#8646) 2023-10-30 12:55:31 +01:00
Basil Crow 8c921e7a9e [JENKINS-72203] Revert jenkinsci/jenkins#8565 (#8637)
This reverts commit dc190bac8a.
2023-10-23 12:36:05 -07:00
Stefan Spieker 87c6732e60 Rename Hudson to Jenkins in JavaDoc (#8628) 2023-10-22 20:35:10 +02:00
Daniel Beck 8f5167d1ba [JENKINS-72181] Restore flushed output for groovy CLI command (#8622) 2023-10-20 10:10:17 -07:00
SujathaH 577f427871 [JEP-237] Do not support shortening of HMAC code on FIPS mode (#8612) 2023-10-19 10:40:15 +01:00
Daniel BeckandDaniel Beck 3218599fc3 Add telemetry for Jenkins uptime (#8596)
Co-authored-by: Daniel Beck <daniel-beck@users.noreply.github.com>
2023-10-14 16:55:54 +02:00
Vincent Latombe 3df097f1b8 [JENKINS-72107] Introduce Loadable interface (#8544)
* Introduce `Loadable` interface

CloudBees CI uses `load()` method to reload selectively parts of the Jenkins object model, without reloading everything.

This formalizes the interface that gets used for this purpose, even if most of the Saveable implementations were using a `load()` method by convention.

* Add missing @Override

* Jenkins#load can throw IOException

* Inline loadConfig into load

* Make Plugin#load/save synchronized (same as Descriptor)
2023-10-13 17:22:28 +02:00
Jesse Glick 298e34b4e2 [JENKINS-72111] Allow Lifecycle to load implementations from plugins (#8589)
Allow `Lifecycle` to load implementations from plugins
2023-10-13 17:21:44 +02:00
Vincent Latombe 16bca2e2ea [JENKINS-72020] Restore ability to reorder clouds (#8492)
* [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.
2023-10-12 00:47:48 +02:00
Daniel BeckandDaniel Beck 0ace9ad585 Restrict helper classes in ScriptListener for internal use (#8588)
Restrict helper classes for internal use

While they might be useful for anyone needing to call #fire...
methods, that alone is fairly unlikely to be necessary.

Co-authored-by: Daniel Beck <daniel-beck@users.noreply.github.com>
2023-10-12 00:47:25 +02:00
df475c1df7 [JENKINS-72028] replace deprecated URL() at core/src/main/java/jenkins/ (#8568)
* 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()

* Update core/src/main/java/jenkins/security/ResourceDomainConfiguration.java

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

---------

Co-authored-by: James Nord <jtnord@users.noreply.github.com>
Co-authored-by: Alexander Brandes <mc.cache@web.de>
2023-10-12 00:46:04 +02: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
Vincent Latombe d1b847366f [JENKINS-72114] Fix serialization of HudsonPrivateSecurityRealm.UserDetailsImpl (#8557)
[JENKINS-72114] Fix Serialization of HudsonPrivateSecurityRealm.UserDetailsImpl
2023-10-07 06:40:56 +02:00
Vincent LatombeandBasil Crow 6fdfdd01c6 [JENKINS-71937] Fix deprecated Slave constructor (#8564)
[JENKINS-71937] Fix deprecated Slave constructor

Got broken in https://github.com/jenkinsci/jenkins/pull/8395

Co-authored-by: Basil Crow <me@basilcrow.com>
2023-10-06 06:16:25 -06:00
270062ace3 [JENKINS-41516] Add script console listener (alternative/extended proposal) (#7056)
* Set location for listener

* Add ScriptListener

* Remove debugging statements

* Add listener for CLI

* Add new listener for other sources

* Simplify listener

* Fix whitespace and comments

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

Co-authored-by: Wadeck Follonier <Wadeck@users.noreply.github.com>

* Add precise origins; Correctly log CLI input

* Add LoggingGroovySh as suggested by @daniel-beck

* Add ScriptListener Tests

* Add basic default listener that just logs

* WIP Script Listener

* Cleaner ScriptListener API

* Add license

* Cleaner Binding stringification

* Note TODO

* Add Object feature parameters

* Thanks Checkstyle

* Thanks Spotbugs

* Simplify test, make it pass again

* Add since TODO

* No mocking, use CLICommandInvoker for CLI commands

* Minor cleanup

* Fix imports

* So far, #onScriptDefinition would be unused, so remove it

* Checkstyle

* Add test for DefaultScriptListener

* Nicer message for the (hopefully rare) case of anon script execution

* More thoroughly test logging

* Remove obsolete TODO

---------

Co-authored-by: Meiswinkel, Jan  SF/HZA-ZC2S <meiswjn@schaeffler.com>
Co-authored-by: Jan Meiswinkel <meiswinkel.jan@googlemail.com>
Co-authored-by: meiswjn <41284403+meiswjn@users.noreply.github.com>
Co-authored-by: Daniel Beck <daniel-beck@users.noreply.github.com>
Co-authored-by: Wadeck Follonier <Wadeck@users.noreply.github.com>
Co-authored-by: Basil Crow <me@basilcrow.com>
2023-10-05 17:04:01 +02:00
32834c5cf7 [JENKINS-71971][JEP-237] FIPS-140 compliant version of HudsonPrivateSecurityRealm (#8393)
Implement a password storage using PBKDF2 when in FIPS mode for  HudsonPrivateSecurityRealm

Co-authored-by: James Nord <jtnord@users.noreply.github.com>
Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com>
2023-10-05 15:03:00 +01:00
James NordandDaniel Beck c4d6fa2f20 [JEP-237] Disable usage stats in fips mode (#8483)
* [JEP-237] disable UsageStats in FIPS mode

UsageStatistics is so close to being FIPS-140 compliant but fails at the
last hurdle.

We can not encrypt with RSA but we can perform key wrap.  The output does
separate the key and data, by creating a new Key for encrypting the data
and that key is encrypted with RSA.  If only the RSA cipher was created with
Cipher.WRAP_MODE (or Cipher.UNWRAP_MODE) instead of CIPHER.ENCRYPT_MODE (or
CIPHER.DECRYPT_MODE) we would be fine, alas it is not and changing this
would mean a change on the backend and to be able to continue to support
both whilst older versions are in the wild.

The goal of JEP-237 is not to fix all non compliant issues, so here we
just ensure that in FIPS mode the usage statistics are disabled.

Updates the UI in the global config page to adapt to usagestats being fully disabled by system property or partially disabled by the FIPS property

Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com>
2023-10-05 11:38:40 +01:00
Jesse Glick 5d1cde72ab Allow location of queue.xml to be overridden (#8531) 2023-10-02 17:23:07 -06:00