Skip to content

Commit

Permalink
Merge remote-tracking branch 'primary/master' into
Browse files Browse the repository at this point in the history
JENKINS-34174-plugin-download-timeout

# Conflicts:
#	core/src/main/resources/jenkins/install/pluginSetupWizard.properties
  • Loading branch information
kzantow committed Apr 22, 2016
2 parents 6974d2b + 5d90f81 commit e612f41
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 10 deletions.
10 changes: 6 additions & 4 deletions core/src/main/java/hudson/PluginManager.java
Expand Up @@ -1009,6 +1009,7 @@ public HttpResponse doPlugins() {
pluginInfo.put("bundled", plugin.isBundled);
pluginInfo.put("deleted", plugin.isDeleted());
pluginInfo.put("downgradable", plugin.isDowngradable());
pluginInfo.put("website", plugin.getUrl());
List<Dependency> dependencies = plugin.getDependencies();
if (dependencies != null && !dependencies.isEmpty()) {
Map<String, String> dependencyMap = new HashMap<>();
Expand All @@ -1033,6 +1034,7 @@ public HttpResponse doPlugins() {
pluginInfo.put("excerpt", plugin.excerpt);
pluginInfo.put("site", site.getId());
pluginInfo.put("dependencies", plugin.dependencies);
pluginInfo.put("website", plugin.wiki);
response.add(pluginInfo);
}
}
Expand Down Expand Up @@ -1198,19 +1200,19 @@ private void trackInitialPluginInstall(@Nonnull final List<Future<UpdateCenter.U
new Thread() {
@Override
public void run() {
final boolean failures[] = { false };
boolean failures = false;
INSTALLING: while (true) {
try {
updateCenter.persistInstallStatus();
Thread.sleep(500);
failures[0] = false;
failures = false;
for (Future<UpdateCenter.UpdateCenterJob> jobFuture : installJobs) {
if(!jobFuture.isDone() && !jobFuture.isCancelled()) {
continue INSTALLING;
}
UpdateCenter.UpdateCenterJob job = jobFuture.get();
if(job instanceof InstallationJob && ((InstallationJob)job).status instanceof DownloadJob.Failure) {
failures[0] = true;
failures = true;
}
}
} catch (Exception e) {
Expand All @@ -1219,7 +1221,7 @@ public void run() {
break;
}
updateCenter.persistInstallStatus();
if(!failures[0]) {
if(!failures) {
jenkins.setInstallState(InstallState.INITIAL_PLUGINS_INSTALLING.getNextState());
}
}
Expand Down
Expand Up @@ -50,6 +50,7 @@ installWizard_configureProxy_save=Save and Continue
installWizard_skipPluginInstallations=Skip Plugin Installations
installWizard_installIncomplete_dependenciesLabel=Dependencies
installWizard_installingConsole_dependencyIndicatorNote=** - required dependency
installWizard_websiteLinkLabel=Website
installWizard_pluginInstallFailure_title=Installation Failures
installWizard_pluginInstallFailure_message=Some plugins failed to install properly, you may retry installing them or continue \
with the failed plugins
Expand Down
4 changes: 2 additions & 2 deletions war/src/main/js/pluginSetupWizardGui.js
Expand Up @@ -208,7 +208,7 @@ var createPluginSetupWizard = function(appendTarget) {
decorate($container);

var $modalHeader = $container.find('.modal-header');
if($modalHeader.length > 0) {
if($modalHeader.length > 0 && $modalHeader.is('.closeable')) {
$modalHeader.prepend(
'<button type="button" class="close" aria-label="Close"><span aria-hidden="true">&times;</span></button>');
}
Expand Down Expand Up @@ -852,7 +852,7 @@ var createPluginSetupWizard = function(appendTarget) {
'.plugin-select-recommended': function() { selectedPluginNames = pluginManager.recommendedPluginNames(); refreshPluginSelectionPanel(); },
'.plugin-show-selected': toggleSelectedSearch,
'.select-category': selectCategory,
'.close': closeInstaller,
'.close': skipFirstUser,
'.resume-installation': resumeInstallation,
'.install-done-restart': restartJenkins,
'.save-first-user:not([disabled])': saveFirstUser,
Expand Down
7 changes: 4 additions & 3 deletions war/src/main/js/templates/pluginSelectionPanel.hbs
@@ -1,4 +1,4 @@
<div class="modal-header">
<div class="modal-header closeable">
<h4 class="modal-title">{{translations.installWizard_installCustom_title}}</h4>
</div>
<div class="modal-body plugin-selector">
Expand Down Expand Up @@ -40,16 +40,17 @@
<span class="title">
<input type="checkbox" id="chk-{{plugin.name}}" name="{{plugin.name}}" value="{{searchTerm}}" {{#inSelectedPlugins plugin.name}}checked="checked"{{/inSelectedPlugins}}/>
{{plugin.title}}
<a href="{{plugin.website}}" target="_blank">{{../../translations.installWizard_websiteLinkLabel}}</a>
</span>
<span class="description">
{{{plugin.excerpt}}}
</span>
{{#hasDependencies plugin.name}}
<div class="dep-list">
{{#eachDependency ../plugin.name}}
<span class="dep badge">
<a class="dep badge" href="{{website}}" target="_blank">
{{title}}
</span>
</a>
{{/eachDependency}}
</div>
{{/hasDependencies}}
Expand Down
2 changes: 1 addition & 1 deletion war/src/main/js/templates/welcomePanel.hbs
@@ -1,4 +1,4 @@
<div class="modal-header">
<div class="modal-header closeable">
<h4 class="modal-title">{{translations.installWizard_welcomePanel_title}}</h4>
</div>
<div class="modal-body">
Expand Down
4 changes: 4 additions & 0 deletions war/src/main/less/pluginSetupWizard.less
Expand Up @@ -432,6 +432,10 @@
.badge {
padding: 4px 8px;
margin: 5px 3px 0 0;

&:hover, &:active, &:focus {
color: #fff;
}
}
}

Expand Down

0 comments on commit e612f41

Please sign in to comment.