:bomb: `Bug`: Execute Command `dtm develop validate-plugin --name=xxx` Got Unexpected Logs
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
Any new contributor interested in taking this one?
Any new contributor interested in taking this one?
I'm no longer a new contributor, but you can assign it to me.
@algobot76 any update on this issue? If you are busy, we can reassign this one to another community member :)
@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.
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.
DirExists method from spf13/afero/util can be used to check the existence of the plugin directory.
Any new first-time contributor likes to give this issue a try?
Can i work on this issue? @IronCore864
@daniel-hutao
Can i work on this issue? @IronCore864