You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by GitBox <gi...@apache.org> on 2022/08/09 15:15:42 UTC

[GitHub] [incubator-devlake] mappjzc opened a new pull request, #2720: Table info

mappjzc opened a new pull request, #2720:
URL: https://github.com/apache/incubator-devlake/pull/2720

   # Summary
   Add some struct for table info.
   Add RegisterTablesInfo for regist the table info.
   Add GetTotalInfo,TraversalTable,Traversal for get the table info.
   Add RegisterTablesInfo for gitlab.
   Add GetTableInfo api to get the table info for gitlab.
   <!--
   Thanks for submitting a pull request!
   
   We appreciate you spending the time to work on these changes.
   Please fill out as many sections below as possible.
   -->
   
   ### Does this close any open issues?
   #1875 
   
   ### Screenshots
   ![image](https://user-images.githubusercontent.com/2921251/183688285-7fd87f2b-ebdb-4d55-8918-70dabac72603.png)
   
   ### Other Information
   Any other information that is important to this PR.
   


-- 
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 a diff in pull request #2720: Table info

Posted by GitBox <gi...@apache.org>.
klesh commented on code in PR #2720:
URL: https://github.com/apache/incubator-devlake/pull/2720#discussion_r943065263


##########
plugins/gitlab/api/connection.go:
##########
@@ -161,3 +163,35 @@ func GetConnection(input *core.ApiResourceInput) (*core.ApiResourceOutput, error
 	err := connectionHelper.First(connection, input.Params)
 	return &core.ApiResourceOutput{Body: connection}, err
 }
+
+// @Summary get table info
+// @Description Get table info map
+// @Tags plugins/gitlab
+// @Success 200
+// @Router /plugins/gitlab/table [GET]
+func GetTableInfo(input *core.ApiResourceInput) (*core.ApiResourceOutput, error) {

Review Comment:
   What we need is to provide an API on Framework level to describe meta information for all plugin including `Subtasks/Models`.
   Not on Plugin API level, please remove it.
   



##########
plugins/core/plugin_info.go:
##########
@@ -0,0 +1,218 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package core
+
+import (
+	"fmt"
+	"reflect"
+	"sync"
+
+	"gorm.io/gorm/schema"
+)
+
+type TableInfo struct {

Review Comment:
   Lets call it `Model` instead of `Table`



##########
plugins/core/plugin_info.go:
##########
@@ -0,0 +1,218 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package core
+
+import (
+	"fmt"
+	"reflect"
+	"sync"
+
+	"gorm.io/gorm/schema"
+)
+
+type TableInfo struct {
+	name     string
+	describe string
+	table    schema.Tabler

Review Comment:
   Do NOT depends on `gorm` directly



-- 
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 merged pull request #2720: Table info

Posted by GitBox <gi...@apache.org>.
klesh merged PR #2720:
URL: https://github.com/apache/incubator-devlake/pull/2720


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