-
Notifications
You must be signed in to change notification settings - Fork 122
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] Rocketchat patch for PR #882 #890
Conversation
Pull Request Test Coverage Report for Build 2289
💛 - 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 @obaroikoh ,
Please check the comments, and add the schema and tests. You can have a look the PR #881 as a reference.
Let me know if you need any help.
Thank you
4106d06
to
2db3af2
Compare
Hi @valeriocos, I have added some tests, the schema and sample raw data. I also looked at the comments in the other other PR and made some of the changes you recommended. However, I didn't handle the concern you raised wrt storing lastMessage and url meta info because I wasn't sure why we are doing it. Perheps @animeshk08 can help give more context. |
Hi @obaroikoh Thank you for the updates! Great work! I had added those two fields as I found it to be unique for this backend. However, they do not provide any necessary insights hence you may skip them for the first version of this backend.Thanks! |
@animeshk08 Thanks for the quick response. I will skip them as you've suggested. |
96ded00
to
af2ea67
Compare
Hi @obaroikoh , can I review the PR? |
af2ea67
to
8452e88
Compare
Sure you can. I was comparing the enriched data with slack and noticed some fields were missing, avatar and channel_topic and had to update the PR |
48c080a
to
1b728d4
Compare
Hi @obaroikoh , I'm starting reviewing the PR (checking the code and running the code on some rocketchat channels) EDIT: I'm performing a long run, tomorrow morning it should be over. |
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 @obaroikoh, sorry for the delay. Overall the PR looks fine, I left some comments (and suggestions), please check them when you have time.
I have tested the code on a channel with more than 150.000 messages, the collection and enrichment worked fine. The method __get_reactions
should be modified to remove the attribute "properties" from the dictionaries generated.
Please run the test coverage (ref here) to make sure that all code is covered (if possible).
Thank you for working on this PR.
grimoire_elk/enriched/rocketchat.py
Outdated
mapping = """ | ||
{ | ||
"properties": { | ||
"text_analyzed": { |
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.
please rename test_analyzed
with msg_analyzed
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 @obaroikoh, sorry for the delay. Overall the PR looks fine, I left some comments (and suggestions), please check them when you have time.
I have tested the code on a channel with more than 150.000 messages, the collection and enrichment worked fine. The method
__get_reactions
should be modified to remove the attribute "properties" from the dictionaries generated.Please run the test coverage (ref here) to make sure that all code is covered (if possible).
Thank you for working on this PR.
Thanks for the review. I will make all necessary changes, hopefully before the end of the weekend.
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.
You're welcome! take your time :)
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 have made the changes but while testing enrichment against my dev environment, I got this error
File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 584, in _build_master
ws.require(__requires__)
File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 901, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 792, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (grimoire-elk 0.63.0 (/usr/local/lib/python3.5/dist-packages), Requirement.parse('grimoire-elk==0.72.0'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/p2o.py", line 4, in <module>
__import__('pkg_resources').require('grimoire-elk==0.72.0')
File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 3261, in <module>
@_call_aside
File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 3245, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 3274, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 586, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 599, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 792, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (numpy 1.18.5 (/usr/local/lib/python3.5/dist-packages), Requirement.parse('numpy<=1.18.3'), {'cereslib'})
command:
p2o.py --enrich --index testing-rc-raw --index-enrich testing-rc -e ES-URL --bulk-size 500 --scroll-size 500 --db-host REDACTED --db-sortinghat REDACTED --db-user REDACTED --db-password REDACTED rocketchat -t REDACTED -u REDACTED --from-date '2020-06-10' https://chat.hyperledger.org general
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.
can you try to constrain the dep of numpy (#891) and test it again?
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.
okay. let me try that
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 worked. Thanks
grimoire_elk/enriched/rocketchat.py
Outdated
|
||
for usr in mentioned: | ||
if '_id' in usr.keys() and 'name' in usr.keys(): | ||
rich_mentions.append({'username': usr['username'], |
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 if condition can be replaced by accessing the dict's attributes with get
, please save the dict in a variable (this will ease future debugging operations).
for usr in mentioned:
- if '_id' in usr.keys() and 'name' in usr.keys():
- rich_mentions.append({'username': usr['username'],
- 'id': usr['_id'],
- 'name': usr['name']})
+ rich_mention = {
+ 'username': usr.get('username', None),
+ 'id': usr.get('_id', None),
+ 'name': usr.get('name', None)
+ }
+ rich_mentions.append(rich_mention)
@@ -0,0 +1,50 @@ | |||
name,type,aggregatable,description |
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.
Please update the CSV by adding the new attributes and removing the old ones, thanks
1b728d4
to
63274d1
Compare
Hi @obaroikoh , can I review the PR? |
Sure you can. Thank you. |
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 @obaroikoh , thank you for addressing my previous comments!
I have tested the PR and works fine. I left some comments concerning the CSV, which doesn't include some attributes. After addressing this last round of comments, I think the PR can merged.
Thank you for your work and time :)
This commit adds support for Pagure to elk. Raw and enriched indexes have been added. Signed-off-by: Animesh Kumar <[email protected]>
63274d1
to
4b2b76c
Compare
Hi @valeriocos, once again thanks for the review. I have made the changes in the comments. You can review it when you have the time. Cheers. |
Hi @obaroikoh , thank you for your time and patience. I have just reviewed the PR, it looks great. I have submitted a PR to your fork obaroikoh#1 to increase the test coverage and complete the documentation. |
Hi @valeriocos, Thanks once again for the review. While doing further testing, we found that in rare cases where topic isn't set under channel_info, enrichment breaks. I have fixed that and will be updating my PR. |
Signed-off-by: Obaro Ikoh <[email protected]>
4b2b76c
to
b73582a
Compare
Ok, perfect @obaroikoh ! Can you review the PR obaroikoh#1 (or include the changes in this PR)? Once done, this PR is ready to merge. Please feel free to review also chaoss/grimoirelab-sirmordred#477, it adds the instructions to execute rocketchat from Mordred. Final question :) are you interested in creating a dashboard to visualize the data extracted from Rocketchat? If this is the case, a good start would be to mimic the dashboard for Slack (https://github.com/chaoss/grimoirelab-sigils/blob/master/json/slack.json). |
I have reviewed this. I saw a line where I was adding the avatar and noticed I wasn't using the python dict get method, on line 210. Everything else looks good.
I have created one already :)
Sure, I will do that. |
Ok, perfect! You should merge the PR obaroikoh#1 and then update this PR (to include the commit obaroikoh@2a1fdee). If for some reason this isn't possible, you can copy the content of the commit above to this PR and close obaroikoh#1 without merging.
That's great! Would you like to contribute to Sigils by submitting a PR with the dashboard you created?
Thanks |
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.
LGTM, thanks @obaroikoh
Hi @valeriocos, Apologies for the delay. I see that you have merged the PR. Thanks. Many thanks to @animeshk08.
Was this taken care of before the merge?
Sure. I'd submit one this weekend. |
No worries @obaroikoh ! Since we are preparing a new release I thought that it was good to include this contribution in it. |
Okay great. |
Great work! @obaroikoh |
Hi Team,
We needed to use this PR hence this patch.
It adds grimoire_creation_date and is_edited to the enriched date and this
Cheers
Sample output