Commit Graph
328 Commits
Author SHA1 Message Date
Basil Crow 4e12567881 Remove unnecessary return 2020-12-19 13:10:38 -08:00
Oleg Nenashev 152682c157 Merge pull request #5109 from basil/improvements
Code cleanup
2020-12-19 20:51:40 +01:00
Oleg NenashevandRamon Leon 9f50735a8b [JENKINS-64445] - Fix null safety for plugin categories (#5121)
* [JENKINS-64445] - Fix null safety for plugin categories

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

Co-authored-by: Ramon Leon <manuelramonleonjimenez@gmail.com>

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

Co-authored-by: Ramon Leon <manuelramonleonjimenez@gmail.com>
2020-12-19 20:50:14 +01:00
Basil Crow 3764940c2d Replace loop with Collection#removeIf where possible 2020-12-11 21:34:22 -08:00
Basil Crow 4284c3d2ab Replace lambda with method reference where possible 2020-12-11 21:34:22 -08:00
Tim Jacomb 09307ea116 JENKINS-64196 Move PluginManager available page to client side (#5051)
* Move PluginManager available to client side

* Fix in IE

* Address feedback from ux-sig demo

* Add handlebars module

* Handlebars plugin manager

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

* Remove import

* Fix input

* Remove debug

* Use rest client

* Fix bug

* Move properties to right location

* Cleanup

* Use lodash debounce

* Revert properties change

* Fmt

* Rank exact matches at the top

* Set locale

* Spotbugs

* ignore case in nicer way

* Sorting improvements
2020-12-08 07:29:21 +00:00
a9ca5ef3d4 [JEP-227] Replace Acegi Security with Spring Security & upgrade Spring Framework (#4848)
Replacing Acegi Security with Spring Security

Co-authored-by: Tim Jacomb <timjacomb1+github@gmail.com>
Co-authored-by: James Nord <jtnord@users.noreply.github.com>
2020-11-06 11:30:25 -07:00
Oleg Nenashev b8b2c47586 Revert "Omit stacktraces on ClassNotFoundException in PluginStrategy classloading (#4957)"
This reverts commit b62b6dd830.
2020-10-14 21:09:26 +02:00
Oleg Nenashev b62b6dd830 Omit stacktraces on ClassNotFoundException in PluginStrategy classloading (#4957)
* Omit stacktraces on ClassNotFoundException in PluginStrategy classloading

* Modify implementation to not fill in stacktraces by default

* Apply suggestions from code review

* Restrict withFillInStackTracesOnClassNotFoundException() at Beta API
2020-10-12 11:21:38 +02:00
Daniel BeckandDaniel Beck c632f42f07 Update at-since Javadoc (#4877)
Co-authored-by: Daniel Beck <daniel-beck@users.noreply.github.com>
2020-08-01 08:33:48 +01:00
Daniel Beck e639c64e19 Merge branch 'master' into feature/add-deprecated-plugin-monitor 2020-06-20 20:53:34 +02:00
Daniel BeckandDaniel Beck 2776f4dc77 [JENKINS-62332] Show when a plugin version newer than offered exists (#4742)
* [JENKINS-62332] Show when a plugin version newer than offered exists

* Add more obvious label/tag to entries that cannot be installed

Also link to plugin documentation from the detail message

* Also show the list if there are any unavailable updates

Co-authored-by: Daniel Beck <daniel-beck@users.noreply.github.com>
2020-06-07 10:51:16 +02:00
Daniel Beck 9ae93b67a0 Link to the deprecation URL, not the plugin URL 2020-05-26 21:40:24 +02:00
Daniel Beck 56c11a3f79 Make 'deprecated' a meta label (not shown in the regular label list) 2020-05-04 10:20:22 +02:00
Daniel Beck d213ef962c Add support for top-level 'deprecations' element in update site 2020-05-03 22:09:47 +02:00
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