From 45f553473c2f1c26f765143e89d6a971f676c99d Mon Sep 17 00:00:00 2001 From: Mauro Faccenda Date: Thu, 19 Sep 2024 22:14:29 +0200 Subject: [PATCH 1/2] implemented qualitygates/get_by_project --- sonarqube/rest/qualitygates.py | 10 ++++++++++ sonarqube/utils/config.py | 1 + 2 files changed, 11 insertions(+) diff --git a/sonarqube/rest/qualitygates.py b/sonarqube/rest/qualitygates.py index 040df82..b36ca22 100644 --- a/sonarqube/rest/qualitygates.py +++ b/sonarqube/rest/qualitygates.py @@ -59,3 +59,13 @@ def select_quality_gate_for_project(self, projectKey, gateName, organization=Non :param organization: Organization key. If no organization is provided, the default organization is used. :return: """ + + @GET(API_QUALITYGATES_GET_BY_PROJECT) + def get_by_project(self, project): + """ + SINCE 6.1 # https://next.sonarqube.com/sonarqube/web_api/api/qualitygates/get_by_project + Get qualitygates associated to a specific project + + :param project: Project key + :return: + """ \ No newline at end of file diff --git a/sonarqube/utils/config.py b/sonarqube/utils/config.py index fbbba22..fc6f1a7 100644 --- a/sonarqube/utils/config.py +++ b/sonarqube/utils/config.py @@ -17,6 +17,7 @@ API_PROJECT_BRANCHES_LIST_ENDPOINT = "/api/project_branches/list" API_ISSUES_SEARCH_ENDPOINT = "/api/issues/search" API_ISSUES_ASSIGN_ENDPOINT = "/api/issues/assign" +API_QUALITYGATES_GET_BY_PROJECT = "/api/qualitygates/get_by_project" API_QUALITYGATES_LIST_ENDPOINT = "/api/qualitygates/list" API_QUALITYGATES_SELECT_ENDPOINT = "/api/qualitygates/select" API_QUALITYGATES_SEARCH_ENDPOINT = "/api/qualitygates/search" From 82f63247c9d2081d3831afe596582739d49fcfdf Mon Sep 17 00:00:00 2001 From: Mauro Faccenda Date: Fri, 27 Sep 2024 15:11:26 +0200 Subject: [PATCH 2/2] Added API_QUALITYGATES_GET_BY_PROJECT to the config --- sonarqube/rest/qualitygates.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sonarqube/rest/qualitygates.py b/sonarqube/rest/qualitygates.py index b36ca22..5e19288 100644 --- a/sonarqube/rest/qualitygates.py +++ b/sonarqube/rest/qualitygates.py @@ -3,9 +3,10 @@ # @Author: Jialiang Shi from sonarqube.utils.rest_client import RestClient from sonarqube.utils.config import ( + API_QUALITYGATES_GET_BY_PROJECT, API_QUALITYGATES_LIST_ENDPOINT, - API_QUALITYGATES_SELECT_ENDPOINT, API_QUALITYGATES_SEARCH_ENDPOINT, + API_QUALITYGATES_SELECT_ENDPOINT, ) from sonarqube.utils.common import GET, POST