aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2013-02-21 08:25:17 +0100
committerJulien Lancelot <julien.lancelot@gmail.com>2013-02-21 08:25:17 +0100
commit5a4782df34c85ca03afc186a6b63f27aa4603618 (patch)
tree86fe168544ee6924988d0be24baec5dfcf4919cc /sonar-server
parent02b6ac319d850a24546207f0d406c63fcfeea38c (diff)
downloadsonarqube-5a4782df34c85ca03afc186a6b63f27aa4603618.tar.gz
sonarqube-5a4782df34c85ca03afc186a6b63f27aa4603618.zip
Fix issue on update center : do not always use last release to know the current release
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/java/org/sonar/server/plugins/PluginDeployer.java2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/available.html.erb6
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/index.html.erb23
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/updates.html.erb38
4 files changed, 39 insertions, 30 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/plugins/PluginDeployer.java b/sonar-server/src/main/java/org/sonar/server/plugins/PluginDeployer.java
index 66fd02d0fcb..84edb65460f 100644
--- a/sonar-server/src/main/java/org/sonar/server/plugins/PluginDeployer.java
+++ b/sonar-server/src/main/java/org/sonar/server/plugins/PluginDeployer.java
@@ -149,7 +149,7 @@ public class PluginDeployer implements ServerComponent {
}
public void uninstall(String pluginKey) {
- for (String key : getPluginReferential().findReleasesWithDependencies(pluginKey)) {
+ for (String key : getPluginReferential().findLastReleasesWithDependencies(pluginKey)) {
uninstallPlugin(key);
}
}
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/available.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/available.html.erb
index 9f0eca65f7b..bc5f84e67d3 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/available.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/available.html.erb
@@ -33,6 +33,7 @@ function installPlugin(key) {
<tbody>
<% updates.sort_by{|update| update.plugin.key}.each do |update|
plugin = update.plugin
+ release = update.release
%>
<tr class="<%= cycle('even','odd', :name => category) -%>">
<td width="150" nowrap>
@@ -44,7 +45,7 @@ function installPlugin(key) {
<table class="spaced width100">
<% index = 0 %>
- <% plugin.lastRelease.children.each do |child|
+ <% release.children.each do |child|
child_plugin = @update_center_referential.findPlugin(child.key)
%>
<tr>
@@ -58,7 +59,6 @@ function installPlugin(key) {
<% index = index + 1 %>
<% end %>
- <% release = @update_plugin_center.findLatestCompatibleRelease(plugin.key) %>
<% release.outgoingDependencies.each_with_index do |outgoing_release, index| %>
<tr>
<% if index == 0 %>
@@ -66,7 +66,7 @@ function installPlugin(key) {
<% else %>
<td>&nbsp;</td>
<% end %>
- <td><span><%= outgoing_release.artifact.name -%></span> : <span><%= @update_center_referential.findPlugin(outgoing_release.key).description -%></span></td>
+ <td><span><%= outgoing_release.artifact.name -%></span> : <span><%= outgoing_release.artifact.description -%></span></td>
</tr>
<% end %>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/index.html.erb
index 5bfeff9301f..4d5f853e752 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/index.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/index.html.erb
@@ -32,7 +32,7 @@
<table class="spaced width100">
<% index = 0 %>
- <% plugin.lastRelease.children.each do |child|
+ <% release.children.each do |child|
child_plugin = @installed_plugin_referential.findPlugin(child.key)
%>
<tr>
@@ -46,16 +46,25 @@
<% index = index + 1 %>
<% end %>
- <% release_dep_names = release.outgoingDependencies.collect { |dep| dep.artifact.name } %>
- <% unless release_dep_names.empty? %>
+ <% release.outgoingDependencies.each_with_index do |outgoing_release, index| %>
<tr>
- <td class="thin nowrap" colspan="2"><b>Depends upon: </b><%= release_dep_names.join(', ') -%></td>
+ <% if index == 0 %>
+ <td class="thin nowrap"><b>Depends upon:</b></td>
+ <% else %>
+ <td>&nbsp;</td>
+ <% end %>
+ <td><span><%= outgoing_release.artifact.name -%></span> : <span><%= outgoing_release.artifact.description -%></span></td>
</tr>
<% end %>
- <% release_dep_names = release.incomingDependencies.collect { |dep| dep.artifact.name } %>
- <% unless release_dep_names.empty? %>
+
+ <% release.incomingDependencies.each_with_index do |incoming_release, index| %>
<tr>
- <td class="thin nowrap" colspan="2"><b>Uninstalling this plugin will also uninstall: </b><%= release_dep_names.join(', ') -%></td>
+ <% if index == 0 %>
+ <td class="thin nowrap"><b>Uninstalling this plugin will also uninstall:</b></td>
+ <% else %>
+ <td>&nbsp;</td>
+ <% end %>
+ <td><span><%= incoming_release.artifact.name -%></span> : <span><%= incoming_release.artifact.description -%></span></td>
</tr>
<% end %>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/updates.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/updates.html.erb
index 99f6e3c6954..caa6b35d7e6 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/updates.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/updates.html.erb
@@ -29,7 +29,7 @@ function upgradePlugin(key) {
css=cycle('even','odd', :name => 'user-plugins')
updates=@updates_by_plugin[plugin]
updates.each_with_index do |update, index|
- release=update.getRelease()
+ release=update.release
%>
<tr class="<%= css -%>">
<td width="1%" nowrap><% if index==0 %><b><%= h(plugin.getName()) -%></b> <%= @installed_plugins[plugin.getKey()] -%> -> <% end %></td>
@@ -51,25 +51,25 @@ function upgradePlugin(key) {
end
%>
- <% release = @update_plugin_center.findLatestCompatibleRelease(plugin.key)
- releases = release.outgoingDependencies + release.incomingDependencies
- %>
- <% releases.each_with_index do |dep_release, index| %>
- <tr class="<%= css -%>">
- <td> </td>
- <td> </td>
- <% if index == 0 %>
- <td class="thin nowrap"><b>Updating this plugin will also update:</b></td>
- <% else %>
- <td >&nbsp;</td>
- <% end %>
- <td colspan="4">
- <span><%= dep_release.artifact.name -%></span> : <span><%= @update_center_referential.findPlugin(dep_release.key).description -%></span>
- </td>
- </tr>
- <% end %>
-
<% if @last_compatible[plugin.getKey()] %>
+
+ <% release = plugin.getRelease(@last_compatible[plugin.getKey()])
+ releases = release.outgoingDependencies + release.incomingDependencies %>
+ <% releases.each_with_index do |dep_release, index| %>
+ <tr class="<%= css -%>">
+ <td> </td>
+ <td> </td>
+ <% if index == 0 %>
+ <td class="thin nowrap"><b>Updating this plugin will also update:</b></td>
+ <% else %>
+ <td >&nbsp;</td>
+ <% end %>
+ <td colspan="4">
+ <span><%= dep_release.artifact.name -%></span> : <span><%= dep_release.artifact.description -%></span>
+ </td>
+ </tr>
+ <% end %>
+
<tr class="<%= css -%>">
<td> </td>
<td colspan="5">