devstream icon indicating copy to clipboard operation
devstream copied to clipboard

:bomb: `Bug`: Execute Command `dtm develop validate-plugin --name=xxx` Got Unexpected Logs

Open daniel-hutao opened this issue 3 years ago • 2 comments

What Happened?

Execute Command dtm develop validate-plugin --name=xxx got unexpected logs.

$ dtm develop validate-plugin --name=xxx      
2022-09-29 20:06:29 !! [ERROR]  Failed to validate: internal/pkg/plugin/xxx/xxx.go.
2022-09-29 20:06:29 !! [ERROR]  Failed to validate: internal/pkg/plugin/xxx/create.go.
2022-09-29 20:06:29 !! [ERROR]  Failed to validate: internal/pkg/plugin/xxx/delete.go.
2022-09-29 20:06:29 !! [ERROR]  Failed to validate: cmd/plugin/xxx/main.go.
2022-09-29 20:06:29 !! [ERROR]  stat internal/pkg/plugin/xxx/: no such file or directory
stat internal/pkg/plugin/xxx/: no such file or directory
stat internal/pkg/plugin/xxx/: no such file or directory
stat cmd/plugin/xxx/: no such file or directory
2022-09-29 20:06:29 !! [ERROR]  Plugin <xxx> does NOT passed validation.

Yeah, the plugin xxx doesn't exist, so dtm should tell me "The plugin xxx doesn't exist instead of so many error logs".

How to Reproduce?

Execute dtm develop validate-plugin --name=xxx

Anything else

A hint for how to get a plugin list:

  • dtm list plugins

DevStream Version

latest

daniel-hutao avatar Sep 29 '22 12:09 daniel-hutao

Any new contributor interested in taking this one?

IronCore864 avatar Oct 09 '22 01:10 IronCore864

Any new contributor interested in taking this one?

I'm no longer a new contributor, but you can assign it to me.

algobot76 avatar Oct 12 '22 14:10 algobot76

@algobot76 any update on this issue? If you are busy, we can reassign this one to another community member :)

IronCore864 avatar Oct 27 '22 02:10 IronCore864

@algobot76 any update on this issue? If you are busy, we can reassign this one to another community member :)

Sorry, I'm quite busy these days and don't have enough time to implement it. But I do have some implementation ideas and will post these ideas later tonight.

algobot76 avatar Oct 27 '22 02:10 algobot76

The main idea is to check if the directory cmd/plugin/{plugin_name} exists before plugin validation. The mainGoDirTpl template string in internal/pkg/develop/plugin/template/main.go can be used to get the directory path.

algobot76 avatar Oct 27 '22 12:10 algobot76

DirExists method from spf13/afero/util can be used to check the existence of the plugin directory.

algobot76 avatar Oct 27 '22 12:10 algobot76

Any new first-time contributor likes to give this issue a try?

IronCore864 avatar Nov 03 '22 02:11 IronCore864

Can i work on this issue? @IronCore864

izayadr avatar Dec 07 '22 13:12 izayadr

@daniel-hutao

Can i work on this issue? @IronCore864

izayadr avatar Dec 11 '22 07:12 izayadr