diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-12-01 16:12:23 +0100 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-12-08 00:26:54 +0100 |
commit | 3197dc1e41dfb2d0072d1fbcd9697eb125984434 (patch) | |
tree | ac31d017db245137da46d6158dcabd2ec21e7e3d /server | |
parent | eee89a07d6a0bfeae589a88983df44dc2cc167b6 (diff) | |
download | sonarqube-3197dc1e41dfb2d0072d1fbcd9697eb125984434.tar.gz sonarqube-3197dc1e41dfb2d0072d1fbcd9697eb125984434.zip |
SONAR-6900 add snapshot_id column in ce_activity db table
Diffstat (limited to 'server')
-rw-r--r-- | server/sonar-server/src/main/java/org/sonar/server/component/ws/ResourcesWs.java | 23 | ||||
-rw-r--r-- | server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1004_add_ce_activity_snapshot_id.rb | 31 |
2 files changed, 44 insertions, 10 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/component/ws/ResourcesWs.java b/server/sonar-server/src/main/java/org/sonar/server/component/ws/ResourcesWs.java index aaa8d98ff6a..03f16a80f70 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/component/ws/ResourcesWs.java +++ b/server/sonar-server/src/main/java/org/sonar/server/component/ws/ResourcesWs.java @@ -26,6 +26,9 @@ import org.sonar.api.server.ws.WebService; public class ResourcesWs implements WebService { + private static final String FALSE = "false"; + private static final String TRUE = "true"; + @Override public void define(Context context) { NewController controller = context.createController("api/resources") @@ -89,8 +92,8 @@ public class ResourcesWs implements WebService { action.createParam("verbose") .setDescription("Add some data to response") - .setDefaultValue("false") - .setPossibleValues("true", "false"); + .setDefaultValue(FALSE) + .setPossibleValues(TRUE, FALSE); action.createParam("limit") .setDescription("Limit the number of results. Only used if one metric, and only one, is set") @@ -98,19 +101,19 @@ public class ResourcesWs implements WebService { action.createParam("includetrends") .setDescription("Include period variations in response: add nodes <p*> for period variations") - .setDefaultValue("false") - .setPossibleValues("true", "false"); + .setDefaultValue(FALSE) + .setPossibleValues(TRUE, FALSE); action.createParam("includealerts") .setDescription("Include alerts data: add nodes <alert> (ERROR, WARN, OK) and <alert_text>") - .setDefaultValue("false") - .setPossibleValues("true", "false"); + .setDefaultValue(FALSE) + .setPossibleValues(TRUE, FALSE); action.createParam("rules") .setDescription("Filter on rules: setting it to true will return rules id and rule name for measure having such info " + "(such as 'blocker_violations', 'critical_violations', ..., 'new_blocker_violations', ...). Possible values: true | false | list of rule ids") - .setDefaultValue("false") - .setExampleValue("true"); + .setDefaultValue(FALSE) + .setExampleValue(TRUE); RailsHandler.addFormatParam(action); } @@ -130,8 +133,8 @@ public class ResourcesWs implements WebService { action.createParam("display_key") .setDescription("Return the resource key instead of the resource id") - .setDefaultValue("false") - .setPossibleValues("true", "false"); + .setDefaultValue(FALSE) + .setPossibleValues(TRUE, FALSE); action.createParam("q") .setDescription("Comma-separated list of qualifiers") diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1004_add_ce_activity_snapshot_id.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1004_add_ce_activity_snapshot_id.rb new file mode 100644 index 00000000000..b2e67caa934 --- /dev/null +++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1004_add_ce_activity_snapshot_id.rb @@ -0,0 +1,31 @@ +# +# SonarQube, open source software quality management tool. +# Copyright (C) 2008-2014 SonarSource +# mailto:contact AT sonarsource DOT com +# +# SonarQube is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 3 of the License, or (at your option) any later version. +# +# SonarQube is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# + +# +# SonarQube 5.3 +# SONAR-6900 +# +class AddCeActivitySnapshotId < ActiveRecord::Migration + + def self.up + add_column 'ce_activity', :snapshot_id, :integer, :null => true + end + +end |