Skip to content

Instantly share code, notes, and snippets.

@itaditya
Last active February 5, 2019 17:49
Show Gist options
  • Save itaditya/2869b07698d8e1e4413e76bf633a4ae2 to your computer and use it in GitHub Desktop.
Save itaditya/2869b07698d8e1e4413e76bf633a4ae2 to your computer and use it in GitHub Desktop.
GSOC 2018 Work Submission Final Report

GSOC 2018 Final Report

During GSOC, I worked under Probot org to create a github app that performs a "background check" to identify users who have been toxic in the past, and shares their toxic activity in the maintainer’s repo.

Challenges

  • Collect public comments of user.
  • Figure out a solution for analysing toxic comments.
  • Avoid using a database.
  • Write modular code which is easy to test.

Solution to the Challenges

Collect public comments of user.

Used Github Search API to find issues on which a person commented and then for each issue, sent requests to get comments and then filtered them to get only person's comment.

Figure out a solution for analysing toxic comments.

Used Google Perspective API to run sentiment analysis on user public comments.

Avoid using a database.

Used Github as a databaseTM. To keep a record of which github user's analysis has already been done, an issue was created for the user in a special github repo. By using Github Search API, it was found, if issue for a user exists and if it does then it means that the analysis for the github user has been done.

Write modular code which is easy to test.

Followed Single Responsibility Principle and grouped code in appropriate folders. Implemented dependency injection to avoid having to interfere with requiring dependencies.

Things I Learned

  1. Writing Unit Tests with Jest.
  2. Mocking dependencies in Jest.
  3. Making extensive use of Github APIs.
  4. Writing Inline Code Documentation.
  5. Design an Event Driven Application run via webhooks.

What is done

  1. Github app successfully identifies users who have been hostile in the past.
  2. Github app successfully sets up a discussion board for maintainers.

What more can be done

  1. Make the github app configurable via config.yml files. Read more about it here.
  2. Improve performance by increasing concurrency. Async library can help in this.

Important Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment