Commit Graph
14378 Commits
Author SHA1 Message Date
Jesse Glick 5cec09d7ed RunListener.allowLoad + AbstractLazyLoadRunMap.recognizeNumber (#9050) 2024-03-24 05:32:17 -06:00
Smith Chang 50269cabe4 Remove duplicated words in Javadoc comments (#9056)
chore: remove repetitive words

Signed-off-by: veryyet <zhengxingru@outlook.com>
2024-03-21 17:03:13 +01:00
Jesse Glick c0f27461fc QueueIdStrategy (#9020) 2024-03-18 15:59:19 +01:00
Markus Winter 229724953b [JENKINS-69191] new icon for agent not accepting tasks and computer icon legend (#8823)
* [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
2024-03-18 15:59:05 +01:00
Jesse Glick 46b0db7783 Lifecycle.supportsDynamicLoad (#9013) 2024-03-10 08:57:30 +01:00
Jesse Glick 2dca2b18ae Job.fastUpdateNextBuildNumber (#9019) 2024-03-10 08:57:12 +01:00
Basil Crow 434bf2b0f8 [JENKINS-72833] Do not attempt to self-exec on systems without libc (#9025) 2024-03-10 08:56:31 +01:00
Basil Crow c9af352f6f [JENKINS-65911] Correct JNA method signature for fcntl(2) (#9026) 2024-03-10 08:56:17 +01:00
James NordandTim Jacomb 89195cc248 [JENKINS-72796] stable context classloader for Computer.threadPoolForRemoting (#9012)
* [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>
2024-03-06 15:19:31 +01:00
Abhishek Kumar b5c5caa7ea Adds support of sessionId for External-Job-Monitor (#8825)
adds support of sessionId and minor bug fix
2024-03-05 21:01:47 +01:00
Lutz Neugebauer 9f68c181de [JENKINS-72540] FilePath.copyRecursiveTo() copying now also if local and remote have incompatible character sets at binary level (#8860)
* 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
2024-03-05 21:01:35 +01:00
Jesse GlickandVincent Latombe 13c86eeaf6 Nodes persistence cleanup, APIs to control loading (#8979)
Co-authored-by: Vincent Latombe <vincent@latombe.net>
2024-03-05 21:01:15 +01:00
Jesse Glick c7ccbfdde1 [JENKINS-72799] Apply SlaveComputer.decorate also to openLogFile (#9009) 2024-03-04 15:46:10 +01:00
Basil Crow 77731ddea9 Remove usages of ArrayUtils (#9001) 2024-03-03 10:35:02 +01:00
Jesse Glick e82487f257 Use ABORTED from Run.reload (#8986) 2024-03-03 10:34:40 +01:00
Basil Crow b8e916a536 Further reduce usages of StringUtils (#9002) 2024-03-02 11:36:43 +01:00
Basil Crow 3c042d12b8 Reduce usage of StringUtils (#8999) 2024-03-01 23:18:05 +01:00
Jesse Glick d42e0786a4 Null out ProxyConfiguration.userName on save (#8990)
* Null out `ProxyConfiguration.userName` on save

* Since we already have a `readResolve`, may as well use it to clean up historical `userName` of `""` https://github.com/jenkinsci/jenkins/pull/8990#discussion_r1502295510

* Linking to new JDK-8326949
2024-02-28 22:21:50 +01:00
Jesse GlickandVincent Latombe 20263d06d4 Move CloudList.setOwner call from Jenkins.loadTasks to load (#8976)
Co-authored-by: Vincent Latombe <vincent@latombe.net>
2024-02-28 22:20:57 +01:00
dependabot[bot] 0eed048866 Bump org.jenkins-ci:jenkins from 1.110 to 1.111 (#8993)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-27 13:24:55 -08:00
64607784f8 [JENKINS-60866][JENKINS-71513] Apply Stapler update for CSP-compliant st:bind and renderOnDemand (#6865)
* [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>
2024-02-24 07:34:33 +01:00
824f64c23e Allow update sites to define a custom URL for wizard plugin suggestion (#8951)
* currently suggested plugins list as setup time is hardcoded, we can make it configurable

Signed-off-by: Olivier Lamy <olamy@apache.org>

* add new method to UpdateSite to avoid using System property

Signed-off-by: Olivier Lamy <olamy@apache.org>

* Update core/src/main/java/hudson/model/UpdateSite.java

Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com>

---------

Signed-off-by: Olivier Lamy <olamy@apache.org>
Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com>
Co-authored-by: Alexander Brandes <mc.cache@web.de>
2024-02-18 08:17:50 +00:00
Jesse Glick db61f04af8 WebSockets.upgradeResponse (#8917) 2024-02-13 16:48:45 +01:00
eduardojandreandAlexander Brandes 8b949243a9 [JENKINS-71326] - Support colored badges in breadcrumb dropdown (#8853)
* [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>
2024-02-12 14:09:21 +01:00
Daniel BeckandDaniel Beck e05ffb8a78 [JENKINS-72637] Make Cloud permission scope inherit from Jenkins (#8944)
[JENKINS-72637] Make Cloud permission scope inherit from Overall

Co-authored-by: Daniel Beck <daniel-beck@users.noreply.github.com>
2024-02-09 09:04:56 +01:00
Daniel BeckandDaniel Beck b8236f8290 Create new index page for heap dump creation (#8929)
Co-authored-by: Daniel Beck <daniel-beck@users.noreply.github.com>
2024-02-08 10:00:18 +01:00
Robert Sandell b91a57ca20 Cleaning up more FilePath API restrictions (#8924) 2024-02-06 23:14:52 +01:00
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