Extend data model and user interface to capture better information about contributors

GSoC @ CHAOSS

K A Rashmi
5 min readAug 22, 2021

This post is a final report on my two months of work during the Google Summer of Code for the CHAOSS organization.

Basic Information

Name: Rashmi K A

Project: Sorting Hat — Extend data model and user interface to capture better information about contributors

Mentors: Venu Vardhan Reddy (vchrombie), Santiago Dueñas (sduenas), Eva Millán (evamillan) and Miguel Ángel Fernández (mafesan).

Organization: CHAOSS

University: Carnegie Mellon University

GitHub: https://github.com/Rashmi-K-A

About the project

Over this summer, I got my first GSoC experience with the CHAOSS organization. The tool I worked on was Sorting Hat, a tool that manages the identities of people and related metadata. As part of the metadata collected around identities, Sorting Hat stores organizational information such as the name, and domains related to the organization. I worked on extending the existing information stored about organizations to include team related info as well.

CHAOSS focuses on creating analytics and metrics to define community health so an important metric is organizational diversity to understand how different organizations contribute to a project. By storing the internal structure of organizations, my project would enhance the measuring of this metric because data can be drilled down further to see diversity across different groups within organizations as well.

Completed work

  1. Created a new data model to store hierarchical Teams information.
  2. Extended the existing methods that interact with the database to include adding a team (optionally under a parent team), deleting a team and finding a team in the registry based on its organization and parent.
  3. Extended the GraphQL layer to have queries and mutations to manipulate Team information.
  4. Extending the existing SortingHat UI to display teams

Coding period 1

Over the first two weeks, we decided that users should be able to add teams that could or could not belong to organizations. We decided to have a model called Team whose objects would capture the name of the team and optionally, the organization it belongs to. Team objects also needed to store information about their subgroups in the table. To implement storing a hierarchy into MySQL, we discussed using a library called django-treebeard. This library provides three different ways of storing hierarchies — materialized paths, adjacency lists, and nested sets. We picked materialized paths as it provided optimal reads/writes.

Once we had a model to handle all the team information and the basic methods that interface with the database, I extended the GraphQL layer of Sorting Hat to have methods that can query and mutate this information. In the last week of Coding period 1, I raised the PR for the GraphQL API for Teams.

Adding a team
Deleting a team

Coding period 2

The organizational hierarchy information needs to be visible to the end users using the UI. This was the final and the most critical component of the project. I drew up wireframes to decide on how to best expose teams information to users.

To view the wireframes, take a look at https://github.com/chaoss/grimoirelab-sortinghat/issues/567.

Right after we finalized the wireframes, we realized that a change had to be made to how we expose the teams info in the graphQL layer. We decided to expose a field called subteams that could be called recursively within the query to get the subteams of a team. We also separated out the query for teams into two — one for teams that belong to organizations and one for teams that don’t.

Recursive subteams

Once the GraphQL layer was fixed, I went back to the UI. I built a view for Teams within the expanded view of each organization. When the user clicks on the organization, it shows the top level teams of the organization. There is a ‘View All’ button as well, that lets you view all the subteams, create new subteams/teams and delete existing ones.

Here is a short demo:

Future Work

  1. We need to create a view for the unaffiliated groups that would mimic how the organizations table looks like.
  2. Hide implementation details of the Teams model that show up as part of the graphQL query.

3. Add the ability to link individuals to teams.

Conclusion

I have enjoyed working on this project, I had the chance to work on a wide range of things- from MySQL to Django models to GraphQL to the UI. I am extremely thankful to my mentors Venu Vardhan Reddy (vchrombie), Santiago Dueñas (sduenas), Eva Millán (evamillan) and Miguel Ángel Fernández (mafesan)!

Footnotes

I created a project tracker for storing the information about the project. We had a meeting every Monday on slack. You can find the meeting logs in the meetings directory.

--

--