From dca06894a62db2826103a1e046ae78ee0ef1294a Mon Sep 17 00:00:00 2001 From: =?utf8?q?L=C3=A9o=20Geoffroy?= Date: Tue, 13 Aug 2024 15:49:15 +0200 Subject: [PATCH] SONAR-22727 Add new metric to changelog in webapi --- .../step/PersistLiveMeasuresStep.java | 13 +++++++++- .../quality-gates/components/Conditions.tsx | 24 +++++++++---------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/PersistLiveMeasuresStep.java b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/PersistLiveMeasuresStep.java index 9177eaca0bb..7ec45800832 100644 --- a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/PersistLiveMeasuresStep.java +++ b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/PersistLiveMeasuresStep.java @@ -39,6 +39,7 @@ import org.sonar.ce.task.projectanalysis.measure.MeasureToMeasureDto; import org.sonar.ce.task.projectanalysis.metric.Metric; import org.sonar.ce.task.projectanalysis.metric.MetricRepository; import org.sonar.ce.task.step.ComputationStep; +import org.sonar.core.metric.SoftwareQualitiesMetrics; import org.sonar.db.DbClient; import org.sonar.db.DbSession; import org.sonar.db.measure.LiveMeasureDto; @@ -108,7 +109,17 @@ public class PersistLiveMeasuresStep implements ComputationStep { MAJOR_VIOLATIONS_KEY, MINOR_VIOLATIONS_KEY, NCLOC_KEY, NCLOC_DATA_KEY, NCLOC_LANGUAGE_DISTRIBUTION_KEY, OPEN_ISSUES_KEY, RELIABILITY_RATING_KEY, RELIABILITY_REMEDIATION_EFFORT_KEY, REOPENED_ISSUES_KEY, SECURITY_HOTSPOTS_KEY, SECURITY_HOTSPOTS_REVIEWED_KEY, SECURITY_HOTSPOTS_REVIEWED_STATUS_KEY, SECURITY_HOTSPOTS_TO_REVIEW_STATUS_KEY, SECURITY_RATING_KEY, SECURITY_REMEDIATION_EFFORT_KEY, SECURITY_REVIEW_RATING_KEY, SQALE_DEBT_RATIO_KEY, TECHNICAL_DEBT_KEY, - SQALE_RATING_KEY, STATEMENTS_KEY, VIOLATIONS_KEY, VULNERABILITIES_KEY, ACCEPTED_ISSUES_KEY + SQALE_RATING_KEY, STATEMENTS_KEY, VIOLATIONS_KEY, VULNERABILITIES_KEY, ACCEPTED_ISSUES_KEY, + + SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_RATING_KEY, + SoftwareQualitiesMetrics.SOFTWARE_QUALITY_RELIABILITY_RATING_KEY, + SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_RATING_KEY, + SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_REVIEW_RATING_KEY, + SoftwareQualitiesMetrics.EFFORT_TO_REACH_SOFTWARE_QUALITY_MAINTAINABILITY_RATING_A_KEY, + SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_REMEDIATION_EFFORT_KEY, + SoftwareQualitiesMetrics.SOFTWARE_QUALITY_SECURITY_REMEDIATION_EFFORT_KEY, + SoftwareQualitiesMetrics.SOFTWARE_QUALITY_RELIABILITY_REMEDIATION_EFFORT_KEY, + SoftwareQualitiesMetrics.SOFTWARE_QUALITY_MAINTAINABILITY_DEBT_RATIO_KEY ); private final DbClient dbClient; private final MetricRepository metricRepository; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx index d4271a980b5..b540822929a 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx @@ -31,21 +31,21 @@ import { Spinner, SubHeading, } from 'design-system'; -import {differenceWith, map, uniqBy} from 'lodash'; +import { differenceWith, map, uniqBy } from 'lodash'; import * as React from 'react'; -import {FormattedMessage} from 'react-intl'; +import { FormattedMessage } from 'react-intl'; import DocHelpTooltip from '~sonar-aligned/components/controls/DocHelpTooltip'; -import {MetricKey} from '~sonar-aligned/types/metrics'; -import {useAvailableFeatures} from '../../../app/components/available-features/withAvailableFeatures'; -import {useMetrics} from '../../../app/components/metrics/withMetricsContext'; +import { MetricKey } from '~sonar-aligned/types/metrics'; +import { useAvailableFeatures } from '../../../app/components/available-features/withAvailableFeatures'; +import { useMetrics } from '../../../app/components/metrics/withMetricsContext'; import DocumentationLink from '../../../components/common/DocumentationLink'; -import ModalButton, {ModalProps} from '../../../components/controls/ModalButton'; -import {DocLink} from '../../../helpers/doc-links'; -import {useDocUrl} from '../../../helpers/docs'; -import {getLocalizedMetricName, translate} from '../../../helpers/l10n'; -import {Feature} from '../../../types/features'; -import {CaycStatus, Condition as ConditionType, QualityGate} from '../../../types/types'; -import {groupAndSortByPriorityConditions, isQualityGateOptimized} from '../utils'; +import ModalButton, { ModalProps } from '../../../components/controls/ModalButton'; +import { DocLink } from '../../../helpers/doc-links'; +import { useDocUrl } from '../../../helpers/docs'; +import { getLocalizedMetricName, translate } from '../../../helpers/l10n'; +import { Feature } from '../../../types/features'; +import { CaycStatus, Condition as ConditionType, QualityGate } from '../../../types/types'; +import { groupAndSortByPriorityConditions, isQualityGateOptimized } from '../utils'; import AddConditionModal from './AddConditionModal'; import CaycCompliantBanner from './CaycCompliantBanner'; import CaycCondition from './CaycCondition'; -- 2.39.5