Commit Graph
14312 Commits
Author SHA1 Message Date
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
Mark Waite acd81964c0 Warn users of old Java version 18 months before end of life (#8543) 2023-10-02 11:57:45 -07:00
Tim JacombandBasil Crow e37ef3a8e6 [JENKINS-70906] Remove prototype from core (#7781)
* Remove Ajax.Request from breadcrumbs

* Remove Ajax.Request from build-timeline-widget

* WIP

* Use crumb API for setting up crumb

* Use existing semantics

* Fix build button column

* Add comment explaining why catch is added

* Use post and crumb for combobox

* Lint fix

* More fixes

* Fixes

* Fix

* Fix validate button

htmlunit was a pain...

* Lint fix

* Fix URICheckEncodingMonitor

* Add a user experimental flag to run Jenkins without Prototype.js

* Adapt select.js

* Fix parameter support

* JENKINS-70922 Remove Prototype Ajax.Request usage from select.js

* Lint:fix

* More

* lint

* Rebased

* Lint

* Fix bad merge

* JENKINS-70931 Remove Prototype Ajax.Request usages from hudson-behavior.js

Co-authored-by: Basil Crow <me@basilcrow.com>

* Fix URICheckEncodingMonitor

* JENKINS-70921 Remove Prototype Ajax.Request usages from link.js

* Remove dead code

* JENKINS-70910 Remove Prototype.Browser usages from hudson-behavior.js

* JENKINS-70947 Remove Prototype $ usage from section_.js

* Prototype removal true

* Remove unneeded test

* Remove hacky test that doesn't work with fetch

* Remove unneeded workaround

* Fix test

* Minor improvements while debugging

* Fix repeatable.js

* JENKINS-71020 Remove Prototype usages from buildTimeTrend_resources.js

* lint

* JENKINS-71020 Remove Prototype usages from buildTimeTrend_resources.js

* Use escapeHTML instead of inlined references

* Fix issues

* JENKINS-70931 Remove Prototype Ajax.Request usages from hudson-behavior.js

Co-authored-by: Basil Crow <me@basilcrow.com>

* Remove hacky test that doesn't work with fetch

* Remove unused checkMethod

* Revert "Revert "JENKINS-70922 Remove Prototype Ajax.Request usage from select.js""

This reverts commit 2cff5b87b5.

* Serialise refills

Co-authored-by: Basil Crow <me@basilcrow.com>

* More reverts

* More merge

* Remove prototype.js

* Remove more references

---------

Co-authored-by: Basil Crow <me@basilcrow.com>
2023-10-01 15:56:56 -06:00
Basil Crow 02502e28b6 Automate Java version recommendation administrative monitor (#8526)
* Automate Java version recommendation administrative monitor

* Improve dates
2023-09-29 10:33:03 -06:00
Jesse Glick 823ab34596 Avoid saving disabled status when deleting a project (#8528) 2023-09-29 10:32:36 -06:00
Basil Crow 91527dce3a [JENKINS-72067] High memory usage from XStream2.AssociatedConverterImpl (#8529) 2023-09-29 10:26:14 -06:00
Alexander Brandes 58a8f2e018 Fill in since annotations (#8530) 2023-09-28 12:18:18 +02:00
James Nord db48740dd2 [JEP-237] introduce FIPS property (#8482)
Introduces the code that core and plugins can use to switch behaviour
based on FIPS-140 requirements
2023-09-27 11:23:26 +02:00
Vincent LatombeandAlexander Brandes 105951c11c Add data-bound setters for View (#8511)
* Add data-bound setters for View

This allows programmatic edit of View

* Clean up

* Fix test

---------

Co-authored-by: Alexander Brandes <mc.cache@web.de>
2023-09-27 11:21:10 +02:00
Vincent Latombe 77e6e4de69 Logging XmlFile write to help track race conditions during tests. (#8513) 2023-09-26 09:54:46 +02:00
Basil Crow 3f1c555052 Fix compilation error with maven.compiler.release=21 (#8520) 2023-09-24 08:38:48 -06:00
Markus Winter 2fc718da2a [JENKINS-71866] Allow to use alternate values for "Build with Parameters" and the "Build" button on the parameters page (#8496)
[JENKINS-71866] alternate for Build with Parameters

Allow to use alternate values for "Build with Parameters" and the
"Build" button on the parameters page.
See also JENKINS-46554 and JENKINS-27214
2023-09-22 16:01:52 +02:00
Basil Crow 9edaffcf7b Use functionality from XStream2 where possible (#8504) 2023-09-20 20:48:04 +02:00
Pierre Beitz af260cb526 [chore] Remove useless TODO (#8501) 2023-09-20 20:47:44 +02:00
Jesse Glick e996d0cd53 Optimization for AbstractLazyLoadRunMap.loadNumberOnDisk (#8494) 2023-09-20 20:46:09 +02:00
Jesse Glick 3e1747eca6 [JENKINS-72016] Define a thread pool for ProxyConfiguration’s HttpClient (#8490)
* Define a thread pool for `ProxyConfiguration`’s `HttpClient`

* Skip test on Windows https://github.com/jenkinsci/jenkins/pull/8490#issuecomment-1720108881
2023-09-20 20:45:14 +02:00
Vincent Latombe 7d285718c2 LogRecorder programmatic deletion support (#8489)
* Add programmatic deletion support for LogRecorder.
* Also added event handling through SaveableListener whenever it gets deleted.
2023-09-20 20:44:29 +02:00
Basil Crow b7920ec5ea Remove finalization from RegistryKey (#8488) 2023-09-20 20:44:04 +02:00
Basil Crow 807243e6bf Remove usages of deprecated ThreadDeath (#8487) 2023-09-20 20:43:47 +02:00
Basil Crow febca34a3d Migrate from deprecated finalization API to Java 9+ API (#8486)
* Migrate from deprecated finalization API to Java 9+ API

* Use non-deprecated JTH method
2023-09-20 20:43:16 +02:00