grimoirelab-elk
grimoirelab-elk copied to clipboard
[ELK] Refactor `class Enrich` to improve cohesion
This PR moves item identities related methods from class Enrich
to class Identities
from improving cohesion and reducing lines of code for class Enrich
.
Closes https://github.com/chaoss/grimoirelab-elk/issues/877
Hi @valeriocos, I am sorry for all the delay, I have been a bit busy with college work.
So I was having a look at this issue. based on the changes you proposed I was facing a problem.
Can I get some help here?
Suppose we migrate the code from https://github.com/chaoss/grimoirelab-elk/blob/master/grimoire_elk/enriched/enrich.py#L120-L129 to Identities.__init__
then we will have to obviously inherit 2 classes in the backend enrichers,
Eg - class GithubEnrich(Enrich, Identities):
, hence calling __init__()
of 2 super classes with similar arguments.
We can also add a new attribute like GitHubIdentities
to https://github.com/chaoss/grimoirelab-elk/blob/048b727ec804bb9c61bdf84dd76ea9524593a466/grimoire_elk/utils.py#L236 and proceed doing identity related work there?
@valeriocos, ping
@imnitishng pong :) I hope to catch up with this PR and the other ones next week.
Would make it sense if the Enrich
class contains a reference to the Identities
class?
class Enrich(ElasticItems):
...
def __init__(self, db_sortinghat=None, db_projects_map=None, json_projects_map=None,
db_user='', db_password='', db_host='', insecure=True):
perceval_backend = None
super().__init__(perceval_backend, insecure=insecure)
identities = Identities(db_user, db_password, db_sortinghat, db_host, ...)
...
Thanks @valeriocos, sorry for the disturbance. Take your time.
Would make it sense if the Enrich class contains a reference to the Identities class?
Okay sure I'll try to do as you said and update the PR. :smile:
Closing this due to inactivity.