You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by kl...@apache.org on 2023/10/25 05:44:36 UTC

[incubator-devlake] branch kw-fix-plugin-not-inited updated (4231899f6 -> dc099e9d7)

This is an automated email from the ASF dual-hosted git repository.

klesh pushed a change to branch kw-fix-plugin-not-inited
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


    omit 4231899f6 fix: PluginInit should be implemented on struct
     new dc099e9d7 fix: PluginInit should be implemented on struct

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (4231899f6)
            \
             N -- N -- N   refs/heads/kw-fix-plugin-not-inited (dc099e9d7)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 backend/plugins/customize/impl/impl.go | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)


[incubator-devlake] 01/01: fix: PluginInit should be implemented on struct

Posted by kl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

klesh pushed a commit to branch kw-fix-plugin-not-inited
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git

commit dc099e9d7b760bdb3dce549642b37231b868a7f2
Author: Klesh Wong <zh...@merico.dev>
AuthorDate: Wed Oct 25 13:29:15 2023 +0800

    fix: PluginInit should be implemented on struct
---
 backend/plugins/customize/impl/impl.go | 21 +++++++++++----------
 backend/plugins/jira/impl/impl.go      |  2 +-
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/backend/plugins/customize/impl/impl.go b/backend/plugins/customize/impl/impl.go
index b75fed4e1..facb0515d 100644
--- a/backend/plugins/customize/impl/impl.go
+++ b/backend/plugins/customize/impl/impl.go
@@ -37,12 +37,13 @@ var _ interface {
 	plugin.PluginMigration
 } = (*Customize)(nil)
 
+var handlers *api.Handlers
+
 type Customize struct {
-	handlers *api.Handlers
 }
 
-func (p *Customize) Init(basicRes context.BasicRes) errors.Error {
-	p.handlers = api.NewHandlers(basicRes.GetDal())
+func (p Customize) Init(basicRes context.BasicRes) errors.Error {
+	handlers = api.NewHandlers(basicRes.GetDal())
 	return nil
 }
 
@@ -89,23 +90,23 @@ func (p Customize) RootPkgPath() string {
 	return "github.com/apache/incubator-devlake/plugins/customize"
 }
 
-func (p *Customize) ApiResources() map[string]map[string]plugin.ApiResourceHandler {
+func (p Customize) ApiResources() map[string]map[string]plugin.ApiResourceHandler {
 	return map[string]map[string]plugin.ApiResourceHandler{
 		":table/fields": {
-			"GET":  p.handlers.ListFields,
-			"POST": p.handlers.CreateFields,
+			"GET":  handlers.ListFields,
+			"POST": handlers.CreateFields,
 		},
 		":table/fields/:field": {
-			"DELETE": p.handlers.DeleteField,
+			"DELETE": handlers.DeleteField,
 		},
 		"csvfiles/issues.csv": {
-			"POST": p.handlers.ImportIssue,
+			"POST": handlers.ImportIssue,
 		},
 		"csvfiles/issue_commits.csv": {
-			"POST": p.handlers.ImportIssueCommit,
+			"POST": handlers.ImportIssueCommit,
 		},
 		"csvfiles/issue_repo_commits.csv": {
-			"POST": p.handlers.ImportIssueRepoCommit,
+			"POST": handlers.ImportIssueRepoCommit,
 		},
 	}
 }
diff --git a/backend/plugins/jira/impl/impl.go b/backend/plugins/jira/impl/impl.go
index 62c8f5cc7..d95587c3f 100644
--- a/backend/plugins/jira/impl/impl.go
+++ b/backend/plugins/jira/impl/impl.go
@@ -60,7 +60,7 @@ func (p Jira) ScopeConfig() dal.Tabler {
 	return &models.JiraScopeConfig{}
 }
 
-func (p *Jira) Init(basicRes context.BasicRes) errors.Error {
+func (p Jira) Init(basicRes context.BasicRes) errors.Error {
 	api.Init(basicRes, p)
 
 	return nil