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/25 04:18:17 UTC

[GitHub] [incubator-devlake] klesh commented on a diff in pull request #5558: [feat-5517]: Add Delete API for Scope configs

klesh commented on code in PR #5558:
URL: https://github.com/apache/incubator-devlake/pull/5558#discussion_r1241024710


##########
backend/helpers/pluginhelper/api/connection_helper.go:
##########
@@ -117,13 +117,23 @@ func (c *ConnectionApiHelper) Delete(connection interface{}) (*services.Blueprin
 	if len(referencingBps) > 0 {
 		return services.NewBlueprintProjectPairs(referencingBps), errors.Conflict.New("Found one or more blueprint/project references to this connection")
 	}
-	scopeModel := c.getScopeModel()
-	count, err := c.db.Count(dal.From(scopeModel.TableName()), dal.Where("connection_id = ?", connectionId))
+	src, err := c.getPluginSource()
 	if err != nil {
-		return nil, errors.Default.Wrap(err, fmt.Sprintf("error deleting scopes for plugin %s using connection %d", c.pluginName, connectionId))
+		return nil, err
+	}
+	if scopeModel := src.Scope(); scopeModel != nil {

Review Comment:
   No, we agreed that connection with any scopes shall NOT be deleted



-- 
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