[groups] Group page should list common skills among group members.

VERIFIED FIXED

Status

VERIFIED FIXED
4 years ago
4 years ago

People

(Reporter: giorgos, Assigned: yogesh.kamble)

Tracking

2014-09.1

Details

(Whiteboard: [kb=1491744] )

(Reporter)

Description

4 years ago
Actual:
A group page lists skills of the group members, ordered by the _overall_ popularity of the skill.

E.g.
Member 1, Skill: javascript
Member 2, Skill: foo
Member 3, Skill: foo

- foo has in total 50 members and 2 members in this group
- javascript has in total 500 members and 1 members in this group.

Javascript is listed first and foo second.

Expected:

foo should be listed first and javascript second. 

Because we list at most 15 skills, this can result in common skills, popular among group members to be overiden by skills that are popular in the website but not popular in the group.
(Assignee)

Comment 1

4 years ago
Can I work on this bug?
(Reporter)

Comment 2

4 years ago
Hi Yogest,

Thanks for offering to contribute! Yes this bug is open for you to take over. Some django / orm / database skills are required to fix this. 

Please go ahead and setup your environment following the instructions here http://mozillians.rtfd.org/ and when you're ready comment here so I can assign the bug to you.

Thanks!
Assignee: nobody → yogesh.kamble
(Assignee)

Comment 3

4 years ago
I set up local environment.
You are saying,skills which are listed in "Skills members have in common:" on group page should list common skills among group.

For Example:
Member1: python, jquery, mongodb
Member2: python, Mysql, Java
Member3: C, Jquery
Member4: Python, Mysql, Django
Member5: C#, jquery, C++

In this case what should be the excepted result in "Skills members have in common:"?
Flags: needinfo?(giorgos)
(Reporter)

Comment 4

4 years ago
Result should be:

jquery
python
mysql
c
c# 
c++ 
django
java
mongo

Please note that skills are all lowercase.
Flags: needinfo?(giorgos)
(Assignee)

Comment 5

4 years ago
In terms of mysql I need to run following query
"""
select gr.name, skill.name, count(skill.name) from groups_group as gr inner join groups_groupmembership as member on member.group_id = gr.id inner join profile_skills as pro_sk on pro_sk.userprofile_id = member.userprofile_id inner join profile as pro on pro.id = member.userprofile_id inner join auth_user as user on user.id = pro.user_id inner join groups_skill as skill on skill.id = pro_sk.skill_id where gr.url="python-group" group by skill.name order by count(skill.name) desc,skill.name;
"""

I will create ORM query for above one and will add in "show" method in groups/views.py.

please correct me if I am wrong. 
this is my first bug.
(Assignee)

Comment 6

4 years ago
Sample result of query in above comment is
"""
+--------------+---------+-------------------+
| name         | name    | count(skill.name) |
+--------------+---------+-------------------+
| python group | jquery  |                 2 |
| python group | python  |                 2 |
| python group | c       |                 1 |
| python group | java    |                 1 |
| python group | mongodb |                 1 |
| python group | mysql   |                 1 |
+--------------+---------+-------------------+
6 rows in set (0.00 sec)

"""
(Assignee)

Comment 7

4 years ago
ORM query 
"""
skills = (Skill.objects
                  .filter(members__in=group.members.all())
                  .annotate(skill_count=Count('name'))
                  .order_by('-skill_count',  'name'))
"""
(Reporter)

Comment 8

4 years ago
Yogesh thanks for working on this. Can you please submit a pull request with your changes, so we can review?

Thanks!
Status: NEW → ASSIGNED
(Reporter)

Updated

4 years ago
Flags: needinfo?(yogesh.kamble)
(Assignee)

Comment 9

4 years ago
pull request sent
https://github.com/mozilla/mozillians/pull/1043
please take a look at it.
Flags: needinfo?(yogesh.kamble)
(Assignee)

Comment 10

4 years ago
What info I have to provide ?
(Reporter)

Comment 11

4 years ago
Yogesh you don't have to provide any more info. We'll review your pull request as soon as possible, but please give us a few days because things are pretty busy atm.
(Reporter)

Comment 12

4 years ago
I reviewed the pull request and added comments. We're getting there but it's not ready yet.
(Assignee)

Comment 13

4 years ago
I will debug the code again and make necessary changes and will send pull request.
(Assignee)

Comment 14

4 years ago
I updated the code. please have a look at the pull request
https://github.com/mozilla/mozillians/pull/1043/files
(Reporter)

Comment 15

4 years ago
Thanks for update yogesh. I don't believe that the new changes answer the comments in https://github.com/mozilla/mozillians/pull/1043#issuecomment-50768715 as I still get the same errors.
Whiteboard: [kb=1491744]

Comment 16

4 years ago
Commits pushed to master at https://github.com/mozilla/mozillians

https://github.com/mozilla/mozillians/commit/13b49b624aea2f1bb6c056e37d76a4eeaf91dff7
[fix bug 1030673] List common skills among group members.

https://github.com/mozilla/mozillians/commit/535675eee3812b15133af5cd956d4c6d2376fb47
Merge pull request #1088 from akatsoulas/1030673

[fix bug 1030673] List common skills among group members.

Updated

4 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED

Updated

4 years ago
Version: other → next
Cannot verify that on stage:

For this [1] group "django" skill should be listed after "html5" since "django" skill has more members among the "a miserable little pile of secrets" compared to eg. homebrewing (django 2 members, homebrewing 1 member).


[1] https://mozillians.allizom.org/en-US/group/a-misrable-little-pile-of-secrets/
Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Comment 18

4 years ago
Commits pushed to master at https://github.com/mozilla/mozillians

https://github.com/mozilla/mozillians/commit/ecac07c57ec5fe58c14a56c5850392a0ead2e74e
[fix bug 1030673] Fix common skills calculation for each group.

https://github.com/mozilla/mozillians/commit/eb3593059a204a507b56ab26fdac2b171984a512
Merge pull request #1093 from akatsoulas/1030673

[fix bug 1030673] Fix common skills calculation for each group.

Updated

4 years ago
Status: REOPENED → RESOLVED
Last Resolved: 4 years ago4 years ago
Resolution: --- → FIXED
Verified on stage.

The PR has been updated to list only skills that members of a group have in common.
In the example group of comment 17, the following skills are listed:

* python: 4 members
* javascript: 4 members
* django: 2 members
* html5: 2 members
Status: RESOLVED → VERIFIED
Version: next → 2014-09.1
You need to log in before you can comment on or make changes to this bug.