Commit Graph
313 Commits
Author SHA1 Message Date
Daniel Beck 0dc475a1df Merge branch 'master' into feature/add-deprecated-plugin-monitor 2020-05-03 18:29:48 +02:00
Tim Jacomb aa3ad0664a Fix available tab sort order and support popularity outside 0..1 range (#4675) 2020-04-25 14:25:20 +01:00
Daniel Beck a54823769a Fix Available tab sort order and support popularity outside 0..1 range 2020-04-21 23:46:45 +02:00
Stefan Spieker c7564f8596 removed unused imports 2020-04-19 20:53:35 +02:00
Daniel Beck a6ebf3b4bf Merge branch 'master' into popularity 2020-04-16 16:41:36 +02:00
Tim JacombandDaniel Beck 9b4a62c716 JENKINS-61203 System read - Plugin Manager (#4518)
Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com>
2020-04-09 22:36:46 +01:00
James Nord 1f946961b9 s/javax.annotation.CheckForNull/edu.umd.cs.findbugs.annotations.CheckForNull/g 2020-03-26 16:12:35 +00:00
James Nord 819f80b12f s/javax.annotation.Nonnull/edu.umd.cs.findbugs.annotations.NonNull/g 2020-03-26 11:14:41 +00:00
Daniel Beck ebc46de632 Sort available plugins by popularity 2020-03-16 22:49:52 +01:00
Daniel Beck 02d57f1dc4 Highlight when plugins have the adopt-this-plugin label 2020-03-15 15:45:59 +01:00
9ead76e210 [JEP-223] Deprecate permissions RUN_SCRIPTS, UPLOAD_PLUGINS, an… (#4365)
Co-authored-by: Jesse Glick <jglick@cloudbees.com>
Co-authored-by: Tim Jacomb <t.jacomb@kainos.com>
Co-authored-by: Daniel Beck <1831569+daniel-beck@users.noreply.github.com>
2020-02-22 15:28:42 +00:00
Joseph Petersen d19fdb4c91 use stream api to collect deprecated plugins 2020-02-19 19:25:01 +01:00
Joseph Petersen ed9baefc56 Merge branch 'master' into feature/add-deprecated-plugin-monitor 2020-02-19 18:37:04 +01:00
James NordandRaihaan Shouhell b39ff9938a [JENKINS-61046] - Allow plugins to force an update of the UpdateCenter (#4488)
* Allow plugins to force an update of the UpdateCenter

* Add javadoc to updateDirectlyNow

* [JENKINS-61046] introduce updateDirectlyNow() and updateDirectly()

@oleg-nenashev notes that the public API should not expose the security
option that is for testing.  Introduced updateDirectlyNow() as the new
API and updateDirectly() to have a mirror and deprecated
updateDirectly(boolean) as a consequence.

* fix javadoc grammar

fixes the grammar of the UpdateSite#updateDirectlyNow javadoc

Co-Authored-By: Raihaan Shouhell <raihaanhimself@gmail.com>

Co-authored-by: Raihaan Shouhell <raihaanhimself@gmail.com>
2020-02-18 11:36:38 +01:00
Vincent Latombe dd59e8c11c [JENKINS-60449] Attempt to fix an odd case of OptionalExtension blowing up Jenkins (#4393)
* Add new module optional-depender and a new failing test

* Variant plugin is a dependency of optional-depender

Optional-depender contains the following class

@OptionalExtension(requirePlugins = {"dependee"})
public class OptionalDependerExtension {
      private static void foo(Dependee d) {

      }
}

* [JENKINS-60449] Move plugin initialization at the end, keep only one extension refresh

* Improve logic to detect classloading issues

Inspect all declared constructors/methods/fields recursively to exclude
failing classes from Guice rather than have Guice explode.

This also fix the failing test, but the previous commit is still better
because it avoids an extra Jenkins.get().refreshExtensions() call.

* Only test resolveClass method if the classloader is not the bootstrap one
2020-01-03 23:26:35 +01:00
StefanSpiekerandOleg Nenashev 8b893a1cbe [JENKINS-36720]: Fixed some Spotbugs issues (#4180)
* [JENKINS-36720]: Fixed Spotbugs issues WMI_WRONG_MAP_ITERATOR and OS_OPEN_STREAM in core

* merged try with resources with try finally

* reverted auto format from IDE

* reverted auto format from IDE

* use Util.fileToPath() as suggested to remove catch block

* merged try statements

* merged try statements

* reverted some whitespace fixes

* reverted another whitespace fix

* Apply suggestions from code review

Co-Authored-By: Oleg Nenashev <o.v.nenashev@gmail.com>

* reverted change

* reverted change

* reverted change

Co-authored-by: Oleg Nenashev <o.v.nenashev@gmail.com>
2019-12-29 12:50:10 +01:00
Oleg Nenashev eedf2a4e2a Merge pull request #4262 from StefanSpieker/replace_getActiveInstance
Replaced deprecated getActiveInstance() with get()
2019-11-22 10:25:21 +01:00
Allan BurdajewiczandJesse Glick e99c183566 [JENKINS-59775] Ensure that PluginManager.start runs as SYSTEM (#4320)
* [JENKINS-59775] Ensure that PluginManager.start runs as SYSTEM

* Use User#getById

Co-Authored-By: Jesse Glick <jglick@cloudbees.com>

* [JENKINS-59383] Undo indent

* [JENKINS-59383] Undo indent
2019-11-02 16:45:28 +03:00
Basil Crow 861855953b Replace <code>…</code> with {@code …} 2019-10-19 14:02:59 -07:00
Joseph Petersen aa863548bc Add Restricted no external use 2019-10-12 11:13:52 +02:00
Stefan Spieker 35dedaf917 merged master and use suggested type for tests 2019-10-08 23:35:34 +02:00
Stefan Spieker 76057897be replaced deprecated getActiveInstance() with get() 2019-10-03 21:13:14 +02:00
Raihaan Shouhell e5d578b617 Use type inference instead of specifying it 2019-10-01 13:30:39 +08:00
Daniel Beck 16145cca86 [JENKINS-59514] Use POST instead of RequirePOST for form submissions (#4223)
* [JENKINS-59514] Use POST instead of RequirePOST for form submissions

* More form submission URLs

* More form submission endpoints
2019-09-27 22:58:17 +02:00
StefanSpieker 69a524ab0b Fixed deprecated warnings without changing behaviour (#4177)
* fixed deprecated warnings without changing behaviour

* use Charset.defaultCharset() instead of null
2019-09-13 09:45:34 +02:00
Raihaan Shouhell 89702627a2 Fix annotations and remove unused imports (#4190) 2019-09-07 22:57:04 +02:00
Egor18 729ad5e540 Remove always true conditions 2019-08-21 01:28:28 -04:00
Jesse Glick 5169f14019 Batch up dynamic plugin installations from setup wizard (#4124)
* Batch up dynamic plugin installations from setup wizard.

* Reworked to thread the list of batched-up plugins properly and introduced CompleteBatchJob to force the setup wizard to wait.

* UpdateCenterPluginInstallTest.test_installKnownPlugins failure.

* @amuniz notes that an existing message could now be considered misleading.

* Introduced UpdateCenter.DownloadJob.getDisplayName for better consistency in logging, as suggested by @Vlatombe.

* Reducing log levels of messages from dynamicLoad which are not of great interest, as suggested by @Vlatombe.

* Reducing log level of another message of little interest.

* Adding classic UI for CompleteBatchJob.

* CompleteBatchJob should be used only when dynamicLoad.

* Null defense on UpdateCenterJob.site.
Otherwise can get:
java.lang.NullPointerException
	at hudson.model.UpdateCenter.getConnectionCheckJob(UpdateCenter.java:850)
	at hudson.model.UpdateCenter.addConnectionCheckJob(UpdateCenter.java:817)
	at hudson.model.UpdateCenter.addJob(UpdateCenter.java:804)
	at hudson.model.UpdateSite$Plugin.deploy(UpdateSite.java:1367)
	at hudson.PluginManager.install(PluginManager.java:1537)
	at hudson.PluginManager.install(PluginManager.java:1496)
	at hudson.PluginManager.doInstall(PluginManager.java:1445)
	at …
2019-08-01 19:55:44 +02:00
Jesse Glick b9d507cbcf Also skip detached plugin installation if a *.[jh]pl file exists. (#4100) 2019-07-11 16:55:41 +02:00
Ramon Leon 740f9eb3ed [JENKINS-57223] - Java11 ClassNotFoundExceptions Telemetry (#4003)
* Proof of concept catching exceptions for java 11 removed classes

* Add ClassLoader to a lot of places. Backup

* Commenting out wip stuff, change packages, count hits findClass

* Improvements, sending and tests

* Removing the catcher from chain to make funcional tests work

* Removing ignored places and a bit of cleaning

* Cleaning unused code after removing the catcher from the chain

* Remove imports cleaning to avoid extra changes

* Cleaning and explaining comments

* Explaining comments

* fix javadoc

* [JENKINS-57223] Address feedback from Matt Sicker. Improve in concurrency

* [JENKINS-57223] Search on cause and suppressed exceptions and fix on name reported

* [JENKINS-57223] Add cycles control on exceptions and refactor reporting method

* [JENKINS-57223] Add trim to class name comparison

* [JENKINS-57223] Address Oleg's feedback and some improvements

* Avoid sending CNFE when ignored later in code
* Disable when running on Java 8 and a test
* Avoid sending empty events

* [JENKINS-57223] Polish assertion after printing all missing classes in logs

* [JENKINS-57223] Avoid extra if and add curly braces

* [JENKINS-57223] Better comment about time window check
2019-07-05 15:27:55 +02:00
Gustavo de Souza Bezerra 0e62b68012 [JENKINS-57678] - Change getInstance() (deprecated) to get() (#4042)
* Change getInstance() (deprecated) to get()

* Reverting modifications according review

* Changing for use the variable
2019-06-27 17:24:45 +02:00
Joseph Petersen 7271e484e1 fix doc 2019-06-17 20:18:52 +02:00
Joseph Petersen 908c5ace5d Enable labels/categories with deprecated to show a warning for plugins 2019-06-17 19:00:40 +02:00
Jesse Glick 0f73231f77 [JENKINS-33843] Permit disabling optional dependencies (#4001)
* Implied dependencies on detached plugins were not being marked optional despite being listed in optionalDependencies, confusing the calculation of optionalDependents in resolveDependentPlugins.

* Javadoc improvements based on code exploration.

* [JENKINS-33843] Do not consider optional dependencies for purposes of disabling plugins.

* PluginManagerInstalledGUITest updated to reflect new behavior.
2019-06-15 11:21:20 +02:00
Jesse Glick 3bcdefcae4 [JENKINS-55582] Refinement to at least handle nonstandard $JENKINS_HOME/plugins/$shortName.hpi and warn about $shortName-$version.hpi. 2019-05-23 13:26:15 -04:00
Jesse Glick 855ea2eea2 [JENKINS-57528] - Load detached plugins which are implicit deps of other plugins at startup even w/o UC (#4000)
* Do not warn repeatedly of the same missing update site dependency.
This happens when locally testing split plugins (despite their presence in WEB-INF/detached-plugins/*.hpi).

(cherry picked from commit 918a0fd221)

* Detached plugins must be kept up to date with security advisories.

(cherry picked from commit e08d28a698)

* Load detached plugins which are implicit dependencies of other plugins at startup, even if the update center was not used.

(cherry picked from commit ad7a36001d)

* Adjusted expected version after e08d28a698.

(cherry picked from commit 84f939cebd)

* e08d28a698 exposed tests which had been incorrectly storing plugins as *.hpi rather than *.jpi.

(cherry picked from commit a0abad7ec4)

* Test failure after ad7a36001d.

(cherry picked from commit 0084e8dbdd)

* Another test failure after ad7a36001d30a6174b25e616fc3c215dd24919d1; fewer installDetachedPlugin calls are now required.

(cherry picked from commit b65bb54e99)
2019-05-17 16:22:22 +02:00
Josh Soref e1f7c6f345 IntelliJ/Java: Duplicate code
Refactored as PluginManager.logPluginWarnings
2019-05-14 21:47:37 -04:00
Josh Soref b9ef494715 Drop unnecessary casts 2019-02-21 00:42:18 -05:00
Josh Soref 2705139798 Remove useless assignment 2019-02-20 23:35:46 -05:00
Josh Soref 0fac99838c OpenJDK6: Collection.toArray() is apparently smart in modern java 2019-02-20 22:11:26 -05:00
Josh Soref b79ec4ff48 Java 7: try with resources 2019-02-20 22:01:10 -05:00
Josh Soref 264980c707 Java 7: omit explit type in favor of <> 2019-02-20 21:51:03 -05:00
Josh Soref 8825451f67 spelling: dependent (#3821)
* spelling: dependent

Writers following British writing convention often confuse dependent and dependant. Those following US writing convention have an easier time with these words because Americans do not use dependant.

A dependant is a person who is dependent on someone else. (For example, a child is dependent on its parents. Therefore, a child is a dependant of its parents.)

Jenkins does not deal with people, thus the UK rule which is confusing does not apply.

* Add deprecated shims
2019-02-28 14:12:37 +01:00
Josh Soref bd8091cf57 Drop useless local variables 2019-02-20 19:18:09 -05:00
Baptiste Mathus a78312ea0f [JENKINS-55681] - Make JAXB a detached plugin only on Java 11 (#3865)
* Move detached plugins logic into a dedicated class

ClassicPluginStrategy is already long enough, so trying to make things a
bit more focused before adding Java 11 logic. (and even if not, the change
still splits a class that is almost 1k lines).

* Install jaxb as detached only on Java 11+

* Remove duplicate @Restricted

Given the enclosing class already has it.

* Use 1.5 release

* Add more test coverage

* getMinJavaVersion => getMinimumJavaVersion

* Rename DetachedPluginsManager as DetachedPluginsUtil

as requested by Oleg and Jesse. Mainly because of the misleading
relationship (there's no inheritance) with the existing `PluginManager`
class.

* 🤦 adjust to 1.5 release method renaming

* Clarify minimum Java version column

Co-Authored-By: batmat <bmathus@gmail.com>

* Update to 2.3.0 version of the jaxb plugin

* Bump minimum core version to next expected release version

* Add preventive cycle breaks for jaxb while waiting for JENKINS-28942

As requested by Oleg.

* Add test to fail fast on wrong format for split-plugins.txt
2019-02-03 10:56:26 +01:00
Baptiste Mathus 27c49bf0a1 Merge branch 'master' into JENKINS-20679-filter-out-plugins-compiled-with-more-recent-jdk 2019-01-07 11:11:38 +01:00
M Ramon Leon b1e8c6565c [JENKINS-54731] Fix checkUpdateAttempts system property
Rename hudson.PluginManager.CHECK_UPDATE_ATTEMPTS system property to
hudson.PluginManager.checkUpdateAttempts
2018-11-20 18:12:37 +01:00
Stephen Connolly 389c5a7e60 Merge pull request #3269 from stephenc/jenkins-45235
[FIXED JENKINS-45235] When multiple update sites publish different versions, allow those versions to be seen
2018-11-19 13:35:21 +00:00
Ramon Leon 7aef24d454 [JENKINS-54459] Avoid Angry Jenkins when check now on Plugin Manager (#3718)
* [JENKINS-54459] Avoid angry Jenkins in Plugin Manager. Check Now

* [JENKINS-54459] Avoid angry Jenkins in Plugin Manager. Check Now

* [JENKINS-54459] Fix updateSiteRightJsonTest in Windows

* [JENKINS-54459] Minor fixes

* Avoid deprecated getInstance

Co-Authored-By: MRamonLeon <manuelramonleonjimenez@gmail.com>

* [JENKINS-54459] Some fixes

- Better system properties initialization
- Rename properties
- Localized messages
- Add test for change log level message
- Restore signatureCheck field after test
- Other minor improvements

* [JENKINS-54459] Add Retrier generic class and use it in the checking

* [JENKINS-54459] Improving Spanish messages

* [JENKINS-54459] Fix two javadoc errors

* [JENKINS-54459] Rename constants and its visibility

Rename the constants to do the retries and change their visibilities.

Change the package of the test to be able to access the constants in
order to redefine their values in the tests.

* [JENKINS-54459] Avoid external use of Retrier and test the delay time
2018-11-17 11:56:21 +01:00
Stephen Connolly 4bf99bae6e Merge branch 'master' into jenkins-45235 2018-11-16 21:17:13 +00:00