Selaa lähdekoodia

SONAR-20931 storing all information in change_data column in qprofile_changes. This reverts most of the commit 762c9190c6

tags/10.3.0.82913
lukasz-jarocki-sonarsource 6 kuukautta sitten
vanhempi
commit
9560b3c9b5

+ 4
- 0
server/sonar-server-common/src/main/java/org/sonar/server/qualityprofile/ActiveRuleChange.java Näytä tiedosto

@@ -24,6 +24,7 @@ import java.util.HashMap;
import java.util.Map;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import org.apache.commons.lang.StringUtils;
import org.sonar.db.qualityprofile.ActiveRuleDto;
import org.sonar.db.qualityprofile.ActiveRuleKey;
import org.sonar.db.qualityprofile.QProfileChangeDto;
@@ -130,6 +131,9 @@ public class ActiveRuleChange {
.filter(param -> !param.getKey().isEmpty())
.forEach(param -> data.put("param_" + param.getKey(), param.getValue()));

if (StringUtils.isNotEmpty(severity)) {
data.put("severity", severity);
}
dto.setData(data);
return dto;
}

+ 1
- 1
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/QProfileRulesImplIT.java Näytä tiedosto

@@ -97,7 +97,7 @@ public class QProfileRulesImplIT {

assertThat(db.getDbClient().qProfileChangeDao().selectByQuery(db.getSession(), new QProfileChangeQuery(qProfile.getKee())))
.extracting(QProfileChangeDto::getUserUuid, QProfileChangeDto::getDataAsMap)
.containsExactlyInAnyOrder(tuple(user.getUuid(), ImmutableMap.of("ruleUuid", rule.getUuid())));
.containsExactlyInAnyOrder(tuple(user.getUuid(), ImmutableMap.of("ruleUuid", rule.getUuid(), "severity", Severity.CRITICAL)));
verify(qualityProfileChangeEventService).distributeRuleChangeEvent(any(), any(), eq(qProfile.getLanguage()));
}
}

+ 1
- 0
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/builtin/BuiltInQProfileInsertImplIT.java Näytä tiedosto

@@ -221,6 +221,7 @@ public class BuiltInQProfileInsertImplIT {
assertThat(change.getUuid()).isNotEmpty();
assertThat(change.getUserUuid()).isNull();
assertThat(change.getRulesProfileUuid()).isEqualTo(profile.getRulesProfileUuid());
assertThat(change.getDataAsMap()).containsEntry("severity", expectedSeverity);
assertThat(change.getSqVersion()).isEqualTo(sonarQubeVersion.toString());
}


Loading…
Peruuta
Tallenna