beratio opened a new issue, #7891:
URL: https://github.com/apache/incubator-devlake/issues/7891

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/incubator-devlake/issues?q=is%3Aissue) and 
found no similar feature requirement.
   
   
   ### Use case
   
   In "Full Refresh Mode," all previously collected data is removed to 
facilitate a fresh start. However it doesn't remove deployment/incident data 
collected by a webhook linked to a project. Users need a way to reset those 
data without deleting the webhook or the project itself. It might be necessary 
in different cases: If there is some data inconsistency after a 
migration/upgrade or if for any reason project should be reset totally.
   
   ### Description
   
   This feature should enable users to clean up all data associated with a 
specific webhook. The feature must accept the webhook ID as input and remove 
all related entries in the database. This feature should be accessible from the 
GUI, allowing users to easily initiate the cleanup process without needing to 
interact with the backend directly.
   
   Based on my research, the data generated by a webhook is stored in the 
following tables and can be filtered for a given webhook by using the queries 
described below:
   
   - cicd_deployments:` SELECT * FROM cicd_deployments WHERE id LIKE 'webhook%'`
   - cicd_deployment_commits: `SELECT * FROM cicd_deployment_commits WHERE id 
LIKE 'webhook%'`
   - project_pr_metrics: `SELECT *  FROM project_pr_metrics WHERE 
deployment_commit_id LIKE 'webhook%'`
   
   Please note that this list may not be exhaustive, as I do not have full 
visibility into the project's internals. Additional steps may be required to 
ensure a complete cleanup process.
   
   Adding an option to selectively clean up only deployments or incidents, 
providing users with more control over the data they wish to remove can be 
considered also.
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to