-
Notifications
You must be signed in to change notification settings - Fork 75
add delete_project and bulk_delete_project #95
Conversation
WalkthroughThe recent modifications enhance project management capabilities in SonarQube by introducing new methods for both individual and bulk project deletion. Users can now manage project deletions more effectively through dedicated API endpoints. Additionally, the configuration file has been updated to reflect these new functionalities while retaining the existing operations for project display and search. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- sonarqube/rest/projects.py (2 hunks)
- sonarqube/utils/config.py (1 hunks)
Files skipped from review due to trivial changes (1)
- sonarqube/utils/config.py
Additional comments: 3
sonarqube/rest/projects.py (3)
- 6-7: The addition of
API_PROJECTS_BULK_DELETE_ENDPOINT
andAPI_PROJECTS_DELETE_ENDPOINT
aligns well with the existing naming conventions and is necessary for the new functionalities introduced in this PR. Good job on maintaining consistency.- 72-81: The
delete_project
function is well-implemented with clear documentation and appropriate use of the@POST
decorator. It's great to see the SonarQube version mentioned, which helps in understanding the API's evolution.- 82-102: The
bulk_delete_project
function is well-documented and uses the@POST
decorator appropriately. The parameters provide the necessary flexibility for bulk deletion operations. Ensure that the default values and types for parameters likeanalyzedBefore
,onProvisionedOnly
, andqualifiers
align with the SonarQube API's expectations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- sonarqube/rest/projects.py (2 hunks)
- sonarqube/utils/config.py (1 hunks)
Files skipped from review as they are similar to previous changes (2)
- sonarqube/rest/projects.py
- sonarqube/utils/config.py
This commit uses the code from two different PRs to add support for creating and deleting projects. Two new endpoints are added to projects.py See: shijl0925#95 shijl0925#97
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- sonarqube/rest/projects.py (3 hunks)
- sonarqube/utils/config.py (1 hunks)
Additional context used
Ruff
sonarqube/rest/projects.py
88-88: Undefined name
POST
(F821)
98-98: Undefined name
POST
(F821)
Additional comments not posted (2)
sonarqube/utils/config.py (1)
3-4
: LGTM!The new endpoint constants are correctly defined and follow the existing pattern.
sonarqube/rest/projects.py (1)
98-98
: Fix the undefined namePOST
.The
POST
decorator is undefined. Ensure it is imported or defined.Tools
Ruff
98-98: Undefined name
POST
(F821)
""" | ||
|
||
@POST(API_PROJECTS_DELETE_ENDPOINT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the undefined name POST
.
The POST
decorator is undefined. Ensure it is imported or defined.
+ from sonarqube.utils.common import POST
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
@POST(API_PROJECTS_DELETE_ENDPOINT) | |
+ from sonarqube.utils.common import POST | |
@POST(API_PROJECTS_DELETE_ENDPOINT) |
Tools
Ruff
88-88: Undefined name
POST
(F821)
Summary by CodeRabbit