aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2018-01-31 16:15:27 +0100
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2018-02-08 13:41:00 +0100
commit522be74684c7ba49c86f47c827356f090a1187c1 (patch)
tree5f37eb882977f7cc91ff236a136377c5ef8b46b3 /server
parent5dd8182a2b84252b2bb060d189f75daf8655fd2f (diff)
downloadsonarqube-522be74684c7ba49c86f47c827356f090a1187c1.tar.gz
sonarqube-522be74684c7ba49c86f47c827356f090a1187c1.zip
SONAR-10313 remove ruleKey field from RULES.ruleExtension index
Diffstat (limited to 'server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleExtensionDoc.java12
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleIndexDefinition.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexerTest.java1
3 files changed, 0 insertions, 15 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleExtensionDoc.java b/server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleExtensionDoc.java
index 31f7aa06ba3..74655ae0d08 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleExtensionDoc.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleExtensionDoc.java
@@ -23,7 +23,6 @@ import com.google.common.collect.Maps;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
-import org.sonar.api.rule.RuleKey;
import org.sonar.db.rule.RuleExtensionForIndexingDto;
import org.sonar.db.rule.RuleForIndexingDto;
import org.sonar.server.es.BaseDoc;
@@ -66,15 +65,6 @@ public class RuleExtensionDoc extends BaseDoc {
return this;
}
- public RuleKey getRuleKey() {
- return RuleKey.parse(getField(RuleIndexDefinition.FIELD_RULE_EXTENSION_RULE_KEY));
- }
-
- public RuleExtensionDoc setRuleKey(RuleKey ruleKey) {
- setField(RuleIndexDefinition.FIELD_RULE_EXTENSION_RULE_KEY, String.valueOf(ruleKey));
- return this;
- }
-
public RuleExtensionScope getScope() {
return RuleExtensionScope.parse(getField(RuleIndexDefinition.FIELD_RULE_EXTENSION_SCOPE));
}
@@ -96,7 +86,6 @@ public class RuleExtensionDoc extends BaseDoc {
public static RuleExtensionDoc of(RuleForIndexingDto rule) {
return new RuleExtensionDoc()
.setRuleId(rule.getId())
- .setRuleKey(rule.getRuleKey())
.setScope(RuleExtensionScope.system())
.setTags(rule.getSystemTagsAsSet());
}
@@ -104,7 +93,6 @@ public class RuleExtensionDoc extends BaseDoc {
public static RuleExtensionDoc of(RuleExtensionForIndexingDto rule) {
return new RuleExtensionDoc()
.setRuleId(rule.getRuleId())
- .setRuleKey(rule.getRuleKey())
.setScope(RuleExtensionScope.organization(rule.getOrganizationUuid()))
.setTags(rule.getTagsAsSet());
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleIndexDefinition.java b/server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleIndexDefinition.java
index df53566432d..a2d78d521cf 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleIndexDefinition.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleIndexDefinition.java
@@ -69,7 +69,6 @@ public class RuleIndexDefinition implements IndexDefinition {
/** The uuid of a {@link RuleExtensionScope} */
public static final String FIELD_RULE_EXTENSION_SCOPE = "scope";
public static final String FIELD_RULE_EXTENSION_RULE_ID = "ruleId";
- public static final String FIELD_RULE_EXTENSION_RULE_KEY = "ruleKey";
public static final String FIELD_RULE_EXTENSION_TAGS = "tags";
// Active rule fields
@@ -134,7 +133,6 @@ public class RuleIndexDefinition implements IndexDefinition {
ruleExtensionType.setAttribute("_parent", ImmutableMap.of("type", INDEX_TYPE_RULE.getType()));
ruleExtensionType.keywordFieldBuilder(FIELD_RULE_EXTENSION_SCOPE).disableNorms().build();
- ruleExtensionType.keywordFieldBuilder(FIELD_RULE_EXTENSION_RULE_KEY).disableNorms().build();
ruleExtensionType.keywordFieldBuilder(FIELD_RULE_EXTENSION_TAGS).build();
// Rule type
diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexerTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexerTest.java
index 5d0a0e80651..476ce55125f 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexerTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/rule/index/RuleIndexerTest.java
@@ -110,7 +110,6 @@ public class RuleIndexerTest {
RuleExtensionDoc doc = new RuleExtensionDoc()
.setRuleId(rule.getId())
- .setRuleKey(rule.getKey())
.setScope(RuleExtensionScope.organization(organization.getUuid()));
assertThat(
esTester.client()