]> source.dussan.org Git - sonarqube.git/commitdiff
forbid to use releasability metrics in quality gate conditions
authorStas Vilchik <stas.vilchik@sonarsource.com>
Fri, 28 Dec 2018 15:30:50 +0000 (16:30 +0100)
committerSonarTech <sonartech@sonarsource.com>
Tue, 8 Jan 2019 19:21:07 +0000 (20:21 +0100)
server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx

index 5e36418900fcb769305a1b9c1d36df3f01eb0456..6dae3053fc340bee7795f40a6f5fa211acb6a30c 100644 (file)
@@ -39,6 +39,7 @@ interface Props {
 }
 
 const FORBIDDEN_METRIC_TYPES = ['DATA', 'DISTRIB', 'STRING', 'BOOL'];
+const FORBIDDEN_METRICS = ['alert_status', 'releasability_rating'];
 
 export default class Conditions extends React.PureComponent<Props> {
   getConditionKey = (condition: T.Condition, index: number) => {
@@ -71,7 +72,10 @@ export default class Conditions extends React.PureComponent<Props> {
 
     const availableMetrics = differenceWith(
       map(metrics, metric => metric).filter(
-        metric => !metric.hidden && !FORBIDDEN_METRIC_TYPES.includes(metric.type)
+        metric =>
+          !metric.hidden &&
+          !FORBIDDEN_METRIC_TYPES.includes(metric.type) &&
+          !FORBIDDEN_METRICS.includes(metric.key)
       ),
       conditions,
       (metric, condition) => metric.key === condition.metric