{"id":20364887,"url":"https://github.com/joeri-abbo/python-github-sonarqube","last_synced_at":"2025-03-04T18:46:23.936Z","repository":{"id":171141954,"uuid":"647458525","full_name":"Joeri-Abbo/python-github-sonarqube","owner":"Joeri-Abbo","description":"Integrate with SonarQube for continuous code quality inspection. Import GitHub projects, set up automated workflows, and ensure codebase quality.","archived":false,"fork":false,"pushed_at":"2024-09-04T22:42:49.000Z","size":46,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-18T11:41:25.538Z","etag":null,"topics":["automation","code-analysis","code-quality","continuous-integration","devops","github-integration","sonarqube","workflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Joeri-Abbo.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-30T20:37:14.000Z","updated_at":"2024-09-04T22:42:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"9e09db94-a264-4a8d-aab0-736b09c7d8f8","html_url":"https://github.com/Joeri-Abbo/python-github-sonarqube","commit_stats":null,"previous_names":["joeri-abbo/python-github-sonarqube"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joeri-Abbo%2Fpython-github-sonarqube","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joeri-Abbo%2Fpython-github-sonarqube/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joeri-Abbo%2Fpython-github-sonarqube/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joeri-Abbo%2Fpython-github-sonarqube/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Joeri-Abbo","download_url":"https://codeload.github.com/Joeri-Abbo/python-github-sonarqube/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241904711,"owners_count":20040021,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","code-analysis","code-quality","continuous-integration","devops","github-integration","sonarqube","workflow"],"created_at":"2024-11-15T00:14:08.338Z","updated_at":"2025-03-04T18:46:23.896Z","avatar_url":"https://github.com/Joeri-Abbo.png","language":"Python","readme":"# Project SonarQube Integration\n\nThis project contains code that integrates with SonarQube, a platform for continuous code quality inspection. The integration allows importing GitHub projects into SonarQube and setting up SonarQube workflows for automated code analysis.\n\n## Prerequisites\n\nBefore running this code, make sure you have the following prerequisites:\n\n- Python 3.x installed\n- `config.yaml` file with the following configuration:\n  - `github_token`: GitHub personal access token with necessary permissions\n  - `sonarqube_token`: SonarQube token for authentication\n  - `sonarqube_host`: URL of the SonarQube server\n  - `organization`: GitHub organization name\n  - `alm_setting`: ALM (Application Lifecycle Management) setting for SonarQube integration\n  - `runs_on`: Target platform for SonarQube workflows (e.g., `ubuntu-latest`, `windows-latest`, `macos-latest`)\n\n## Installation\n\n1. Clone this repository to your local machine:\n\n   ```shell\n   git clone \u003crepository_url\u003e\n   ```\n\n2. Install the required dependencies by running the following command:\n\n   ```shell\n   pip install -r requirements.txt\n   ```\n\n## Usage\n\n1. Open the `config.yaml` file and provide the required configuration values.\n\n2. Run the following command to execute the code:\n\n   ```shell\n   python main.py\n   ```\n\n   The script will perform the following steps for each repository in the specified GitHub organization:\n\n   - Clone the repository locally.\n   - Import the GitHub project into SonarQube.\n   - Create a `sonar-project.properties` file for the project.\n   - Create a SonarQube workflow file (`sonarqube.yml`) in the repository's `.github/workflows` directory.\n   - Commit and push the changes to the repository.\n\n3. After running the script, the GitHub repositories will be integrated with SonarQube, and the SonarQube workflows will be set up for continuous code analysis.\n\n## Note\n\n- Make sure the provided GitHub personal access token has the necessary permissions to access and modify repositories.\n- Ensure that the SonarQube server is accessible and the provided SonarQube token has sufficient privileges.\n- The code assumes the presence of a `sonar-project.properties` file in each repository. If the file doesn't exist, it will be created during the integration process.\n- The code uses the GitHub API and the `git` Python library to clone repositories and perform Git operations. Make sure these dependencies are installed.\n\nFor any issues or questions, please contact the project maintainers.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeri-abbo%2Fpython-github-sonarqube","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoeri-abbo%2Fpython-github-sonarqube","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeri-abbo%2Fpython-github-sonarqube/lists"}