aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorZipeng WU <zipeng.wu@sonarsource.com>2021-06-25 09:18:27 +0200
committersonartech <sonartech@sonarsource.com>2021-07-07 20:03:24 +0000
commit7994ab1cd1740e5b25842bc99cd05209e9813520 (patch)
tree3d51a17d108f6f0b79a04c2efcb11d6db1a0372c /server
parent24036f4a57961c5652bfa0508f6544cc66085596 (diff)
downloadsonarqube-7994ab1cd1740e5b25842bc99cd05209e9813520.tar.gz
sonarqube-7994ab1cd1740e5b25842bc99cd05209e9813520.zip
SONAR-10762 Drop Manual Measure from portfolios
Diffstat (limited to 'server')
-rw-r--r--server/sonar-ce-task-projectanalysis/src/test/resources/org/sonar/ce/task/projectanalysis/step/CustomMeasuresCopyStepTest/report-custom-measures.xml22
-rw-r--r--server/sonar-ce-task-projectanalysis/src/test/resources/org/sonar/ce/task/projectanalysis/step/CustomMeasuresCopyStepTest/view-custom-measures.xml22
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeCommands.java10
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeMapper.java2
-rw-r--r--server/sonar-db-dao/src/main/resources/org/sonar/db/measure/custom/CustomMeasureMapper.xml99
-rw-r--r--server/sonar-db-dao/src/main/resources/org/sonar/db/purge/PurgeMapper.xml7
-rw-r--r--server/sonar-db-dao/src/test/java/org/sonar/db/purge/PurgeDaoTest.java5
-rw-r--r--server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/ws/ComponentAction.java2
-rw-r--r--server/sonar-webserver-webapi/src/main/resources/org/sonar/server/platform/ws/l10n-index-example.json1
-rw-r--r--server/sonar-webserver-webapi/src/main/resources/org/sonar/server/ui/ws/component-example.json1
-rw-r--r--server/sonar-webserver-webapi/src/test/java/org/sonar/server/ui/ws/ComponentActionTest.java2
-rw-r--r--server/sonar-webserver-webapi/src/test/resources/org/sonar/server/ui/ws/ComponentActionTest/return_configuration_for_admin.json1
-rw-r--r--server/sonar-webserver-webapi/src/test/resources/org/sonar/server/ui/ws/ComponentActionTest/return_configuration_for_quality_gate_admin.json1
-rw-r--r--server/sonar-webserver-webapi/src/test/resources/org/sonar/server/ui/ws/ComponentActionTest/return_configuration_for_quality_profile_admin.json1
-rw-r--r--server/sonar-webserver-webapi/src/test/resources/org/sonar/server/ui/ws/ComponentActionTest/return_configuration_with_all_properties.json1
15 files changed, 0 insertions, 177 deletions
diff --git a/server/sonar-ce-task-projectanalysis/src/test/resources/org/sonar/ce/task/projectanalysis/step/CustomMeasuresCopyStepTest/report-custom-measures.xml b/server/sonar-ce-task-projectanalysis/src/test/resources/org/sonar/ce/task/projectanalysis/step/CustomMeasuresCopyStepTest/report-custom-measures.xml
deleted file mode 100644
index 507508f8587..00000000000
--- a/server/sonar-ce-task-projectanalysis/src/test/resources/org/sonar/ce/task/projectanalysis/step/CustomMeasuresCopyStepTest/report-custom-measures.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<dataset>
- <manual_measures id="1"
- metric_id="10"
- component_uuid="FILE1"
- value="3.14"
- text_value="[null]"
- user_login="roger"
- description="float measure"
- created_at="123456789"
- updated_at="123456789"/>
-
- <manual_measures id="2"
- metric_id="11"
- component_uuid="PROJECT"
- value="[null]"
- text_value="good"
- user_login="simone"
- description="string measure"
- created_at="123456789"
- updated_at="123456789"/>
-
-</dataset>
diff --git a/server/sonar-ce-task-projectanalysis/src/test/resources/org/sonar/ce/task/projectanalysis/step/CustomMeasuresCopyStepTest/view-custom-measures.xml b/server/sonar-ce-task-projectanalysis/src/test/resources/org/sonar/ce/task/projectanalysis/step/CustomMeasuresCopyStepTest/view-custom-measures.xml
deleted file mode 100644
index c3dbc637c01..00000000000
--- a/server/sonar-ce-task-projectanalysis/src/test/resources/org/sonar/ce/task/projectanalysis/step/CustomMeasuresCopyStepTest/view-custom-measures.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<dataset>
- <manual_measures id="1"
- metric_id="10"
- component_uuid="SUBVIEW"
- value="3.14"
- text_value="[null]"
- user_login="roger"
- description="float measure"
- created_at="123456789"
- updated_at="123456789"/>
-
- <manual_measures id="2"
- metric_id="11"
- component_uuid="VIEW"
- value="[null]"
- text_value="good"
- user_login="simone"
- description="string measure"
- created_at="123456789"
- updated_at="123456789"/>
-
-</dataset>
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeCommands.java b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeCommands.java
index 55d68363c8b..a4f366c7c98 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeCommands.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeCommands.java
@@ -229,11 +229,6 @@ class PurgeCommands {
uuidsPartitions.forEach(purgeMapper::deletePropertiesByComponentUuids);
session.commit();
profiler.stop();
-
- profiler.start("deleteByRootAndModulesOrSubviews (manual_measures)");
- uuidsPartitions.forEach(purgeMapper::deleteManualMeasuresByComponentUuids);
- session.commit();
- profiler.stop();
}
void deleteDisabledComponentsWithoutIssues(List<String> disabledComponentsWithoutIssue) {
@@ -247,11 +242,6 @@ class PurgeCommands {
session.commit();
profiler.stop();
- profiler.start("deleteDisabledComponentsWithoutIssues (manual_measures)");
- uuidsPartitions.forEach(purgeMapper::deleteManualMeasuresByComponentUuids);
- session.commit();
- profiler.stop();
-
profiler.start("deleteDisabledComponentsWithoutIssues (projects)");
uuidsPartitions.forEach(purgeMapper::deleteComponentsByUuids);
session.commit();
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeMapper.java b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeMapper.java
index 41c87deb1a9..4d7c72313f1 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeMapper.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeMapper.java
@@ -78,8 +78,6 @@ public interface PurgeMapper {
void deleteUserRolesByComponentUuid(@Param("rootUuid") String rootUuid);
- void deleteManualMeasuresByComponentUuids(@Param("componentUuids") List<String> componentUuids);
-
void deleteEventsByComponentUuid(@Param("componentUuid") String componentUuid);
void deleteEventComponentChangesByComponentUuid(@Param("componentUuid") String componentUuid);
diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/measure/custom/CustomMeasureMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/measure/custom/CustomMeasureMapper.xml
deleted file mode 100644
index c2dc6a9be5b..00000000000
--- a/server/sonar-db-dao/src/main/resources/org/sonar/db/measure/custom/CustomMeasureMapper.xml
+++ /dev/null
@@ -1,99 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd">
-
-<mapper namespace="org.sonar.db.measure.custom.CustomMeasureMapper">
- <sql id="selectColumns">
- m.uuid,
- m.metric_uuid as metricUuid,
- m.component_uuid as componentUuid,
- m.value,
- m.text_value as textValue,
- m.user_uuid as userUuid,
- m.description,
- m.created_at as createdAt,
- m.updated_at as updatedAt
- </sql>
-
- <select id="selectByUuid" resultType="CustomMeasure">
- select
- <include refid="selectColumns"/>
- from manual_measures m
- where m.uuid=#{uuid}
- </select>
-
- <select id="selectByMetricUuid" resultType="CustomMeasure">
- select
- <include refid="selectColumns"/>
- from manual_measures m
- where m.metric_uuid=#{metricUuid}
- </select>
-
- <select id="selectByComponentUuid" resultType="CustomMeasure">
- select
- <include refid="selectColumns"/>
- from manual_measures m
- where m.component_uuid=#{componentUuid}
- </select>
-
- <select id="selectByMetricKeyAndTextValue" resultType="CustomMeasure">
- SELECT
- <include refid="selectColumns"/>
- FROM manual_measures m
- INNER JOIN metrics metric ON metric.uuid=m.metric_uuid AND metric.name=#{metricKey}
- <where>
- m.text_value=#{textValue}
- </where>
- </select>
-
- <insert id="insert" parameterType="CustomMeasure" useGeneratedKeys="false">
- INSERT INTO manual_measures (
- uuid, metric_uuid, component_uuid, value, text_value, user_uuid, description, created_at, updated_at
- )
- VALUES (
- #{uuid, jdbcType=VARCHAR},
- #{metricUuid, jdbcType=VARCHAR},
- #{componentUuid, jdbcType=VARCHAR},
- #{value, jdbcType=DOUBLE},
- #{textValue, jdbcType=VARCHAR},
- #{userUuid, jdbcType=VARCHAR},
- #{description, jdbcType=VARCHAR},
- #{createdAt, jdbcType=BIGINT},
- #{updatedAt, jdbcType=BIGINT}
- )
- </insert>
-
- <update id="update" parameterType="CustomMeasure">
- update manual_measures
- set value = #{value, jdbcType=DOUBLE},
- text_value = #{textValue, jdbcType=VARCHAR},
- description = #{description, jdbcType=VARCHAR},
- user_uuid = #{userUuid, jdbcType=VARCHAR},
- updated_at = #{updatedAt, jdbcType=BIGINT}
- where uuid = #{uuid}
- </update>
-
- <delete id="deleteByMetricUuids">
- delete from manual_measures
- where metric_uuid in
- <foreach collection="metricUuids" item="metricUuid" open="(" close=")" separator=",">
- #{metricUuid}
- </foreach>
- </delete>
-
- <delete id="delete">
- delete from manual_measures
- where uuid=#{uuid}
- </delete>
-
- <select id="countByComponentUuid" resultType="Integer">
- select count(1)
- from manual_measures m
- where m.component_uuid=#{componentUuid}
- </select>
-
- <select id="countByComponentIdAndMetricUuid" resultType="Integer">
- select count(1)
- from manual_measures m
- where m.metric_uuid=#{metricUuid} and m.component_uuid=#{componentUuid}
- </select>
-</mapper>
diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/purge/PurgeMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/purge/PurgeMapper.xml
index e2e04898f38..75c93120ff2 100644
--- a/server/sonar-db-dao/src/main/resources/org/sonar/db/purge/PurgeMapper.xml
+++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/purge/PurgeMapper.xml
@@ -256,13 +256,6 @@
component_uuid = #{rootUuid,jdbcType=INTEGER}
</delete>
- <delete id="deleteManualMeasuresByComponentUuids" parameterType="map">
- delete from manual_measures where component_uuid in
- <foreach collection="componentUuids" open="(" close=")" item="componentUuid" separator=",">
- #{componentUuid,jdbcType=VARCHAR}
- </foreach>
- </delete>
-
<delete id="deleteEventsByComponentUuid" parameterType="map">
delete from events
where
diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/purge/PurgeDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/purge/PurgeDaoTest.java
index a6346864bb3..6157294c7a9 100644
--- a/server/sonar-db-dao/src/test/java/org/sonar/db/purge/PurgeDaoTest.java
+++ b/server/sonar-db-dao/src/test/java/org/sonar/db/purge/PurgeDaoTest.java
@@ -1611,11 +1611,6 @@ public class PurgeDaoTest {
db.getSession().commit();
}
- private Stream<String> getComponentUuidsOfManualMeasures() {
- return db.select("select component_uuid as \"COMPONENT_UUID\" from manual_measures").stream()
- .map(row -> (String) row.get("COMPONENT_UUID"));
- }
-
private Stream<String> getResourceIdOfProperties() {
return db.select("select component_uuid as \"uuid\" from properties").stream()
.map(row -> (String) row.get("uuid"));
diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/ws/ComponentAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/ws/ComponentAction.java
index ab048d25484..c52ec34432a 100644
--- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/ws/ComponentAction.java
+++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/ui/ws/ComponentAction.java
@@ -286,7 +286,6 @@ public class ComponentAction implements NavigationWsAction {
private void writeConfigPageAccess(JsonWriter json, boolean isProjectAdmin, ComponentDto component) {
boolean isProject = Qualifiers.PROJECT.equals(component.qualifier());
- boolean showManualMeasures = isProjectAdmin && !Qualifiers.DIRECTORY.equals(component.qualifier());
boolean showBackgroundTasks = isProjectAdmin && (isProject || Qualifiers.VIEW.equals(component.qualifier()) || Qualifiers.APP.equals(component.qualifier()));
boolean isQualityProfileAdmin = userSession.hasPermission(GlobalPermission.ADMINISTER_QUALITY_PROFILES);
boolean isQualityGateAdmin = userSession.hasPermission(GlobalPermission.ADMINISTER_QUALITY_GATES);
@@ -298,7 +297,6 @@ public class ComponentAction implements NavigationWsAction {
json.prop("showSettings", isProjectAdmin && componentTypeHasProperty(component, PROPERTY_CONFIGURABLE));
json.prop("showQualityProfiles", isProject && (isProjectAdmin || isQualityProfileAdmin));
json.prop("showQualityGates", isProject && (isProjectAdmin || isQualityGateAdmin));
- json.prop("showManualMeasures", showManualMeasures);
json.prop("showLinks", isProjectAdmin && isProject);
json.prop("showPermissions", isProjectAdmin && componentTypeHasProperty(component, PROPERTY_HAS_ROLE_POLICY)
&& (isGlobalAdmin || allowChangingPermissionsByProjectAdmins));
diff --git a/server/sonar-webserver-webapi/src/main/resources/org/sonar/server/platform/ws/l10n-index-example.json b/server/sonar-webserver-webapi/src/main/resources/org/sonar/server/platform/ws/l10n-index-example.json
index e4ce8a21d1d..e2b31870b6e 100644
--- a/server/sonar-webserver-webapi/src/main/resources/org/sonar/server/platform/ws/l10n-index-example.json
+++ b/server/sonar-webserver-webapi/src/main/resources/org/sonar/server/platform/ws/l10n-index-example.json
@@ -96,7 +96,6 @@
"rule.php.S101.param.format": "Regular expression used to check the class names against.",
"select2.tooShort": "Please enter at least {0} characters",
"widget.custom_measures.property.metric10.name": "Metric 10",
- "manual_measures.save_button": "Save",
"issue_filter.sharing": "Sharing",
"widget.measure_filter_cloud.property.colorMetric.name": "Color Metric",
"dashboard.TimeMachine.name": "Time Machine",
diff --git a/server/sonar-webserver-webapi/src/main/resources/org/sonar/server/ui/ws/component-example.json b/server/sonar-webserver-webapi/src/main/resources/org/sonar/server/ui/ws/component-example.json
index b8c00a6257f..db129fcf724 100644
--- a/server/sonar-webserver-webapi/src/main/resources/org/sonar/server/ui/ws/component-example.json
+++ b/server/sonar-webserver-webapi/src/main/resources/org/sonar/server/ui/ws/component-example.json
@@ -37,7 +37,6 @@
"showSettings": true,
"showQualityProfiles": true,
"showQualityGates": true,
- "showManualMeasures": true,
"showLinks": true,
"showPermissions": true,
"showHistory": true,
diff --git a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/ui/ws/ComponentActionTest.java b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/ui/ws/ComponentActionTest.java
index 4ea440392d4..fa84b71e132 100644
--- a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/ui/ws/ComponentActionTest.java
+++ b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/ui/ws/ComponentActionTest.java
@@ -451,7 +451,6 @@ public class ComponentActionTest {
" \"showSettings\": true,\n" +
" \"showQualityProfiles\": true,\n" +
" \"showQualityGates\": true,\n" +
- " \"showManualMeasures\": true,\n" +
" \"showLinks\": true,\n" +
" \"showPermissions\": true,\n" +
" \"showHistory\": true,\n" +
@@ -480,7 +479,6 @@ public class ComponentActionTest {
" \"showSettings\": true,\n" +
" \"showQualityProfiles\": true,\n" +
" \"showQualityGates\": true,\n" +
- " \"showManualMeasures\": true,\n" +
" \"showLinks\": true,\n" +
" \"showPermissions\": false,\n" +
" \"showHistory\": true,\n" +
diff --git a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/ui/ws/ComponentActionTest/return_configuration_for_admin.json b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/ui/ws/ComponentActionTest/return_configuration_for_admin.json
index 804191d9aa8..31847f32a6a 100644
--- a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/ui/ws/ComponentActionTest/return_configuration_for_admin.json
+++ b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/ui/ws/ComponentActionTest/return_configuration_for_admin.json
@@ -3,7 +3,6 @@
"showSettings": true,
"showQualityProfiles": true,
"showQualityGates": true,
- "showManualMeasures": true,
"showLinks": true,
"showPermissions": true,
"showHistory": true,
diff --git a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/ui/ws/ComponentActionTest/return_configuration_for_quality_gate_admin.json b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/ui/ws/ComponentActionTest/return_configuration_for_quality_gate_admin.json
index 893e9dfc04a..3b7f460cc5c 100644
--- a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/ui/ws/ComponentActionTest/return_configuration_for_quality_gate_admin.json
+++ b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/ui/ws/ComponentActionTest/return_configuration_for_quality_gate_admin.json
@@ -3,7 +3,6 @@
"showSettings": false,
"showQualityProfiles": false,
"showQualityGates": true,
- "showManualMeasures": false,
"showLinks": false,
"showPermissions": false,
"showHistory": false,
diff --git a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/ui/ws/ComponentActionTest/return_configuration_for_quality_profile_admin.json b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/ui/ws/ComponentActionTest/return_configuration_for_quality_profile_admin.json
index 8a8dd68ca93..c08cdaff46b 100644
--- a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/ui/ws/ComponentActionTest/return_configuration_for_quality_profile_admin.json
+++ b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/ui/ws/ComponentActionTest/return_configuration_for_quality_profile_admin.json
@@ -3,7 +3,6 @@
"showSettings": false,
"showQualityProfiles": true,
"showQualityGates": false,
- "showManualMeasures": false,
"showLinks": false,
"showPermissions": false,
"showHistory": false,
diff --git a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/ui/ws/ComponentActionTest/return_configuration_with_all_properties.json b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/ui/ws/ComponentActionTest/return_configuration_with_all_properties.json
index 48844dacf26..115f3521456 100644
--- a/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/ui/ws/ComponentActionTest/return_configuration_with_all_properties.json
+++ b/server/sonar-webserver-webapi/src/test/resources/org/sonar/server/ui/ws/ComponentActionTest/return_configuration_with_all_properties.json
@@ -3,7 +3,6 @@
"showSettings": true,
"showQualityProfiles": true,
"showQualityGates": true,
- "showManualMeasures": true,
"showLinks": true,
"showPermissions": true,
"showHistory": true,