From be73eb6194f8485df125f6ddffd3859859ff6a78 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Mon, 5 Mar 2018 23:33:31 +0100 Subject: [PATCH] [WEBSITE-328] Distinguish between implied and required dependencies Complete with modal dialog with explanation what implied dependencies are. --- app/components/PluginDetail.jsx | 49 ++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/app/components/PluginDetail.jsx b/app/components/PluginDetail.jsx index 18af008e4..1e1dab6e7 100644 --- a/app/components/PluginDetail.jsx +++ b/app/components/PluginDetail.jsx @@ -35,6 +35,7 @@ class PluginDetail extends React.PureComponent { name: PropTypes.string, title: PropTypes.string, optional: PropTypes.bool, + implied: PropTypes.bool, version: PropTypes.string })), excerpt: PropTypes.string, @@ -111,11 +112,18 @@ class PluginDetail extends React.PureComponent { return (
No dependencies found
); } - return dependencies.sort((a, b) => a.optional === b.optional ? 0 : (a.optional ? 1 : -1)).map((dependency) => { - const required = !dependency.optional ? 'required' : 'optional'; + return dependencies.sort((a, b) => a.implied === b.implied ? (a.optional === b.optional ? 0 : a.optional ? 1 : -1 ) : (a.implied ? 1 : -1)).map((dependency) => { + const kind = !dependency.optional ? (dependency.implied ? 'implied' : 'required') : 'optional'; + if (kind === 'implied') { + return ( +
+ {dependency.title} v.{dependency.version} ({kind}) (what's this?) +
+ ); + } return ( -
- {dependency.title} v.{dependency.version} ({required}) +
+ {dependency.title} v.{dependency.version} ({kind})
); }); @@ -170,6 +178,38 @@ class PluginDetail extends React.PureComponent { this.warningsModal.show(); } + showImplied = () => { + this.impliedModal.show(); + } + + getImpliedModal() { + return ( +
+ { this.impliedModal = modal; }}> +
+
About Implied Plugin Dependencies
+
+ +
+

+ Features are sometimes detached (or split off) from Jenkins core and moved into a plugin. + Many plugins, like Subversion or JUnit, started as features of Jenkins core. +

+

+ Plugins that depend on a Jenkins core version before such a plugin was detached from core may or may not actually use any of its features. + To ensure that plugins don't break whenever functionality they depend on is detached from Jenkins core, it is considered to have a dependency on the detached plugin if it declares a dependency on a version of Jenkins core before the split. + Since that dependency to the detached plugin is not explicitly specified, it is implied. +

+

+ Plugins that don't regularly update which Jenkins core version they depend on will accumulate implied dependencies over time. +

+
+ +
+
+ ); + } + getActiveWarnings(securityWarnings) { if (!securityWarnings) { return null; @@ -284,6 +324,7 @@ class PluginDetail extends React.PureComponent {

{cleanTitle(plugin.title)} {this.getActiveWarnings(plugin.securityWarnings)} + {this.getImpliedModal()} {plugin.version} Minimum Jenkins requirement: {plugin.requiredCore} ID: {plugin.name}