Dependency management for new plugins #7570
Unanswered
bobharwood
asked this question in
Q&A
Replies: 1 comment
-
Hi @bobharwood . Thanks for contributing. Check this doc if you want to implement a new plugin: https://devlake.apache.org/docs/DeveloperManuals/PluginImplementation If you have more questions, the lead developer @klesh could help you out. Cheers. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Cool project and it got me motivated to write a plugin for Rally. I'm pretty new at Go, however. What's below might be a pretty basic question.
I cloned version 1 (beta) and coded the skeleton for a Rally plugin. (https://github.com/bobharwood/incubator-devlake) I'm reviewing the Apache DevLake codebase and noticed the go.mod file located in the backend directory. While this suggests implicit modules might be used, I haven't found clear documentation on the recommended approach for plugin development, particularly regarding dependency management.
My (current!) challenge is getting Go to find my models in my plugin. Go mod tidy is complaining:
go: found github.com/bobharwood/incubator-devlake/backend/plugins/rally/models in github.com/bobharwood/incubator-devlake/backend v0.0.0-20240604030612-2152d08f8f53
go: github.com/apache/incubator-devlake/plugins/rally/tasks imports
github.com/bobharwood/incubator-devlake/backend/plugins/rally/models: github.com/bobharwood/incubator-devlake/backend@v0.0.0-20240604030612-2152d08f8f53: parsing go.mod:
module declares its path as: github.com/apache/incubator-devlake
but was required as: github.com/bobharwood/incubator-devlake/backend
Should I:
Create a separate go.mod file for the plugin? That is change the first line in my copy of backend's go.mod file from module github.com/apache/incubator-devlake to module github.com/bobharwood/incubator-devlake/backend ? This, i think, will mean changing many import statements. There's no clue from other plugins that this was done, so it doesn't "feel" right.
Follow a different approach for managing dependencies within the plugin code?
Any guidance on best practices for plugin development and dependency management would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions