CSC517 Fall 2017 OSS M1705

From Expertiza_Wiki
Jump to navigation Jump to search

CSC/ECE 517 Fall 2017/OSS M1705

M1705 - Automatically report new contributors to all git repositories

Introduction

Servo<ref>https://en.wikipedia.org/wiki/Servo_(layout_engine)</ref> is a browser layout engine developed by Mozilla. It is at its early stage but can easily supply i.e. contribute to Wikipedia and Github successfully passes the Acid2 test. It aims to create the parallel environment with different components which can be handled by small separate tasks.

Scope

The scope of the project was to complete the following steps:

- create a GitHub organization with several repositories that can be used for manual tests
- create a tool that initializes a JSON file with the known authors for a local git repository
- create a tool that clones every git repository in a given GitHub organization (use the GitHub API to retrieve this information)

Project Description

The project requirement states the initial state to be able to track information across all repositories in the servo organization. The goal of this work is to build a system that uses the Github API to determine this information on a regular basis.We have done this in the following ways:

Tool # 1: JSON author file

  • create a tool that initializes a JSON file with the known authors for a local git repository
  • First, it fetches the author name from all the commits in a repository
  • Then, adds it to set. Here we use set to avoid the duplication of authors if he/she have done more than 1 commits.
  • Saves the set in a JSON file.

Tool # 2: Clone repositories Tool

  • create a tool that clones every git repository in a given GitHub organization (use the GitHub API to retrieve this information)
  • `package.json` has the dependencies needed to run both the tools.
  • `gitApi.js` - clones the all the repositories in the given organization inside `./tmp` folder
 * On line # 12 - define the GITAPI token as environment variable `GITHUB_KEY` **check references below for token**
 * On line # 13 - define the username of the git account user
 * On line # 18 - define the organization of interest from where repositories need to be cloned

git clone https://github.com/OODD-Mozilla/ToolRepository.git
cd ToolRepository
npm install

Design Patterns

Design patterns are not applicable as our task involved is just implementing a way to get all the contributors in a git repository. However, the [Project Description](https://github.com/OODD-Mozilla/ToolRepository/blob/master/Wiki.md#project-description) section below provides details of the steps as the way it was implemented.

Conclusion

After understanding the GitHub API and the way JSON object can be used to access and post the data of the new contributors in the repository we have observed it can be automated and the steps to understand it are as shown in the article.

References

<references/>