X-lab2017 / grimoirelab-elk

GNU General Public License v3.0
0 stars 1 forks source link

Abstract the gitee backend to another repository as a plugin. #3

Open heming6666 opened 4 years ago

heming6666 commented 4 years ago

Maybe we can abstract the gitee backend in raw and enriched to another repository as a plugin just like what perceval backend for Gitee did.

heming6666 commented 4 years ago

One problem is that ELK used get_connectors() in util.py to get the connectors of backend. And it was used in many places( e.g. grimoirelab-sirmordred/task.py and grimoirelab-elk/elk.py ).

So it maybe be difficult to build a seperate package(e.g. grimoirelab-elk-gitee) for gitee without making any modification to grimoirelab-elk.

@WillemJiang is there any suggestion about this? :)

WillemJiang commented 4 years ago

I just had a quick look at the util.py, the get_connectors() just load some meta data of the connector. If util.py can load the connector meta data from the extension directory, grimoirelab-elk can support loading connector without knowing the Class in advance.

Now it's time to do some research on how to do it in python. https://packaging.python.org/guides/creating-and-discovering-plugins/

heming6666 commented 4 years ago

Yes, if util.py can load all the connector meta data, it would be convenient to build seperate packages for any other backends.

Now it's time to do some research on how to do it in python. https://packaging.python.org/guides/creating-and-discovering-plugins/

Thank you @WillemJiang very much. I will look at this and update the progress here.

WillemJiang commented 4 years ago

I think we could use the metadata approach
to store the module and class information, then import the module and assemble the classes dynamically.

heming6666 commented 4 years ago

I have implemented the POC in this repository : heming6666/python-plugins-test and write some describtion in README. Could you @WillemJiang help to review the code and give some suggestiones whenever you have time? Then I can actually get started working on grimoirelab-elk-gitee .

WillemJiang commented 4 years ago

Yeah, it looks good. Now I'm thinking maybe we can put the gitee dashboard json part into the same repo. As we need to modify the code grimoirelab-elk core code to enable the plugin loading mechanism, it's better we send a proposal to grimoirelab-elk first to get some feed back from the community.