Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implemented qualitygates/get_by_project #102

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion sonarqube/rest/qualitygates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -59,3 +60,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:
"""
1 change: 1 addition & 0 deletions sonarqube/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down