From 41f89aeb5b6d67f6c9329771ee097766943f130f Mon Sep 17 00:00:00 2001 From: Anita Stanisz <106669481+anita-stanisz-sonarsource@users.noreply.github.com> Date: Tue, 26 Nov 2024 16:41:55 +0100 Subject: SONAR-23619 Add aiCodeAssurance field to search quality gate endpoint (#12362) --- .../db/qualitygate/ProjectQgateAssociationDto.java | 9 +++ .../qualitygate/ProjectQgateAssociationMapper.xml | 2 +- .../assurance/AiCodeAssuranceVerifierTest.java | 12 +--- .../server/qualitygate/ws/SearchActionIT.java | 81 +++++++++++++--------- .../ai/code/assurance/AiCodeAssuranceVerifier.java | 16 +++-- .../sonar/server/qualitygate/ws/SearchAction.java | 8 ++- .../server/qualitygate/ws/search-example.json | 6 +- sonar-ws/src/main/protobuf/ws-qualitygates.proto | 8 +++ 8 files changed, 88 insertions(+), 54 deletions(-) diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/qualitygate/ProjectQgateAssociationDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/qualitygate/ProjectQgateAssociationDto.java index b2ef04f7f28..b17164e9211 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/qualitygate/ProjectQgateAssociationDto.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/qualitygate/ProjectQgateAssociationDto.java @@ -32,6 +32,7 @@ public class ProjectQgateAssociationDto { private String name; private String gateUuid; private boolean containsAiCode; + private boolean aiCodeSupportedByQg; public ProjectQgateAssociationDto() { // do nothing @@ -82,4 +83,12 @@ public class ProjectQgateAssociationDto { this.containsAiCode = containsAiCode; return this; } + + public boolean isAiCodeSupportedByQg() { + return aiCodeSupportedByQg; + } + + public void setAiCodeSupportedByQg(boolean aiCodeSupportedByQg) { + this.aiCodeSupportedByQg = aiCodeSupportedByQg; + } } diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/qualitygate/ProjectQgateAssociationMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/qualitygate/ProjectQgateAssociationMapper.xml index ae3b21a3eda..329eb55f484 100644 --- a/server/sonar-db-dao/src/main/resources/org/sonar/db/qualitygate/ProjectQgateAssociationMapper.xml +++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/qualitygate/ProjectQgateAssociationMapper.xml @@ -4,7 +4,7 @@