-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rocketchat] Add support for RocketChat #882
Conversation
This commit adds support for Pagure to elk. Raw and enriched indexes have been added. Signed-off-by: Animesh Kumar <[email protected]>
Hi, @valeriocos I sincerely apologize for the delay with this work. I was really occupied for the past few weeks. I tried to include all the important field coming from the backend, let me know if anything is missed. I will include the remaining files and tests once we finalize on the enricher. Again, I apologize and thank you for your patience. \cc @vchrombie EDIT: The format to pass to Mordred is same as mentioned here: chaoss/grimoirelab-perceval#661 (review) and the testing can be done on these channels,https://open.rocket.chat/channel/sandbox and https://open.rocket.chat/channel/general or a custom channel(suggested) |
Pull Request Test Coverage Report for Build 2210
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @animeshk08 , sorry for the late reply! Lately I don't have too much time to dedicate to community issues/pull requests, so I do it when I get some time.
The PR looks great, I tested it on the whole "https://open.rocket.chat general"
and the execution was successful. I left some comments.
Based on the implementation you proposed, can you list some metrics you would like to show in the dashboard? Do you think we can be close to the metrics for other messaging systems (e.g., slack, mattermost)?
eitem['file_name'] = message['file'].get('name', None) | ||
eitem['file_type'] = message['file'].get('type', None) | ||
|
||
if 'replies' in message and message['replies']: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This field seems to be always empty. Do you have an example?
Does it make sense to store only the number of replies?
self.add_metadata_filter_raw(eitem) | ||
return eitem | ||
|
||
def __get_reactions(self, item): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current implementation generates a mapping for any reaction type (https://gist.github.com/valeriocos/9b103650bc24df8185aecb8f5df3a43f#file-rocketchat-mapping-L156), this may be a problem when trying to summing up reactions of different types.
I would suggest to:
- add a metric that shows the total number of reactions for a given message
- modify the code to have a single mapping for reactions, which contains a list of names, usernames, the type of the reaction and the count of reactions for that type (basically the lenght of the list of names/usernames)
"reaction" : {
"properties" : {
"names" : {
"type" : "keyword"
},
"usernames" : {
"type" : "keyword"
},
"count" : {
"type" : "long"
},
"type" : {
"type" : "keyword"
}
}
},
WDYT?
return reactions | ||
|
||
def __get_mentions(self, mentioned): | ||
"""Enrich users mentioned in the message""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would complete this method with the total number of mentions, it may be useful to calculate some global metrics (e.g., number of mentions in different channels), wdyt?
'channel_name': channel['name'], | ||
'channel_num_users': channel['usersCount'], | ||
} | ||
if 'lastMessage' in channel and channel['lastMessage']: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we store the lastMessage info?
rich_urls = [] | ||
for url in urls: | ||
rich_url = {} | ||
if 'meta' in url: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we want to store also the meta info? Is the URL not enough?
eitem['user_name'] = author.get('name', None) | ||
eitem['user_username'] = author.get('username', None) | ||
|
||
if 'editedBy' in message and message['editedBy']: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be useful to add an attribute that says whether the message has been edited or not (e.g., is_edited = 0/1). This can be useful to count the number of edited messages
if self.prjs_map: | ||
eitem.update(self.get_item_project(eitem)) | ||
|
||
self.add_repository_labels(eitem) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The grimoire_creation_date isn't present in the enriched_items, you should add a statement similar to: https://github.com/chaoss/grimoirelab-elk/blob/master/grimoire_elk/enriched/mattermost.py#L193
This PR is not working yet, see
This fixes the problem
|
@animeshk08 do you have time to finish this PR or @obaroikoh can take over? |
Hi @valeriocos I am a bit occupied for the coming weeks. Thank you for the patch @obaroikoh you can take over this PR. |
Thank you for the quick reply @animeshk08 |
Signed-off-by: Obaro Ikoh <[email protected]>
Signed-off-by: Obaro Ikoh <[email protected]>
Signed-off-by: Obaro Ikoh <[email protected]>
Signed-off-by: Obaro Ikoh <[email protected]>
Signed-off-by: Obaro Ikoh <[email protected]>
Signed-off-by: Obaro Ikoh <[email protected]>
Signed-off-by: Obaro Ikoh <[email protected]>
Signed-off-by: Obaro Ikoh <[email protected]>
Signed-off-by: Obaro Ikoh <[email protected]>
Signed-off-by: Obaro Ikoh <[email protected]>
Signed-off-by: Obaro Ikoh <[email protected]>
This commit adds support for Pagure
to elk. Raw and enriched indexes have
been added.
Fixes: #876
Signed-off-by: Animesh Kumar [email protected]