You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by "klesh (via GitHub)" <gi...@apache.org> on 2023/06/20 10:33:42 UTC

[GitHub] [incubator-devlake] klesh opened a new issue, #5535: [Bug][Module Name] Data Deletion may cause collateral damage

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

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/incubator-devlake/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### What happened
   
   During investigation of #5534 , I notice the following logic
   https://github.com/apache/incubator-devlake/blob/8f8edfc2a02b114160470fe68fad6f1dee3490fb/backend/helpers/pluginhelper/api/scope_generic_helper.go#L627
   
   Seems like we are deleting records from all tables by examining the `raw_data_params` only with the `LIKE` clause.
   
   1. `raw_data_params` itself doesn't contain the **plugin name** and **connection id**, which means it may delete records that belongs to other plugins or even connection id
   2. `LIKE` clause is fuzzy, it is likely to match records belongs to another scope
   
   ### What do you expect to happen
   
   connectionId and pluginName should be included in the SQL, and we should use the exact match `=` instead of `LIKE`
   
   ### How to reproduce
   
   ...
   
   ### Anything else
   
   _No response_
   
   ### Version
   
   b40efa574abbe0530d3cf623cbddb5a3e34bcc7f
   
   ### Are you willing to submit 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: commits-unsubscribe@devlake.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] keon94 closed issue #5535: [Bug][pluginhelper] Data Deletion may cause collateral damage

Posted by "keon94 (via GitHub)" <gi...@apache.org>.
keon94 closed issue #5535: [Bug][pluginhelper] Data Deletion may cause collateral damage
URL: https://github.com/apache/incubator-devlake/issues/5535


-- 
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: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] keon94 commented on issue #5535: [Bug][pluginhelper] Data Deletion may cause collateral damage

Posted by "keon94 (via GitHub)" <gi...@apache.org>.
keon94 commented on issue #5535:
URL: https://github.com/apache/incubator-devlake/issues/5535#issuecomment-1599362553

   Here's what it's going to look like now
   ![image](https://github.com/apache/incubator-devlake/assets/25063936/6c77878b-b619-405b-bd23-a937331ae125)
   


-- 
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: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] klesh commented on issue #5535: [Bug][pluginhelper] Data Deletion may cause collateral damage

Posted by "klesh (via GitHub)" <gi...@apache.org>.
klesh commented on issue #5535:
URL: https://github.com/apache/incubator-devlake/issues/5535#issuecomment-1599940651

   @keon94 we should use exact match "=" for now
   If the `plugin` field is to be added, I would prefer to add it as a new column. 
   I'm thinking maybe we can add a new field `_plugin`, and fill it  with the `_raw_data_table` field
   ![image](https://github.com/apache/incubator-devlake/assets/61080/60dd530b-0b02-421f-b124-6d58bb9bbfb3)
   
   But, it is a big migration, we can discuss it later.
   Can we utilize the `_raw_data_table` to determine which `plugin` it belongs to ? for now


-- 
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: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] keon94 commented on issue #5535: [Bug][pluginhelper] Data Deletion may cause collateral damage

Posted by "keon94 (via GitHub)" <gi...@apache.org>.
keon94 commented on issue #5535:
URL: https://github.com/apache/incubator-devlake/issues/5535#issuecomment-1599146819

   (1) is a problem, agreed. For (2), LIKE would be needed if we ever have to match on a subset of the JSON, or for backward compatibility purposes if we ever add fields to it in the future. Nevertheless, I can change it to match on exact `=` for now.


-- 
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: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] keon94 commented on issue #5535: [Bug][pluginhelper] Data Deletion may cause collateral damage

Posted by "keon94 (via GitHub)" <gi...@apache.org>.
keon94 commented on issue #5535:
URL: https://github.com/apache/incubator-devlake/issues/5535#issuecomment-1599967689

   @klesh Well, The way I did it was to add it as a field in _raw_data_params


-- 
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: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org