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

function get_number_of_issues() from file test_cnes_sonar_scanner.py is not working in case of an issue number superior to 100 #26

Open
begarco opened this issue Feb 16, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@begarco
Copy link
Contributor

begarco commented Feb 16, 2021

function get_number_of_issues() from file test_cnes_sonar_scanner.py is not working in case of an issue number superior to 100.

def get_number_of_issues():
            """
            Factor out the resquest to get the number of issues of a project on SonarQube

            :returns: the number of issues
            """
            output = requests.get(f"{cls.SONARQUBE_LOCAL_URL}/api/issues/search?componentKeys={project_key}",
                        auth=("admin", cls.SONARQUBE_ADMIN_PASSWORD)).json()['issues']
            issues = [ issue for issue in output if issue['status'] in ('OPEN', 'TO_REVIEW') ]
            return len(issues)

This function does not handle paging of API/issues/search result.
In the case of the VHDL project the return of the query is:
image

Therefore the query result should be iterate over every 8 pages to return the good number of issues.

In fact, as it is a new project, all the issues should be open . So there won't need iteration around issues to check status.
I think you can simply query to get the total value from paging field.

Originally posted by @LeFl0w in #18 (comment)

@begarco begarco added the bug Something isn't working label Feb 16, 2021
@begarco begarco added this to the 1.1.0 milestone Feb 16, 2021
@diegorodriguez31 diegorodriguez31 removed this from the 1.1.0 milestone Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants