-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from jakeharding/dev
Milestone2
- Loading branch information
Showing
111 changed files
with
2,928 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
*.sqlite* | ||
*.db | ||
*.pyc | ||
*.log | ||
*~ | ||
.DS_Store | ||
local_settings.py | ||
node_modules | ||
dist | ||
.vscode | ||
.idea | ||
__pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM python:3.6 | ||
ENV PYTHONUNBUFFERED 1 | ||
LABEL Description="This image supplies the server needed for repo-health." | ||
|
||
# installing dependencies such as curl, node, and netcat | ||
RUN apt-get update && apt-get install -y curl netcat | ||
RUN curl -sL https://deb.nodesource.com/setup_7.x | bash - | ||
RUN apt-get install -y nodejs | ||
RUN mkdir /www | ||
WORKDIR /www | ||
|
||
COPY requirements.txt /www/ | ||
RUN pip install -r requirements.txt | ||
COPY . /www | ||
|
||
# Building the UI | ||
WORKDIR repo_health/index/static | ||
RUN npm install && npm run dist | ||
WORKDIR /www | ||
|
||
EXPOSE 8000 | ||
|
||
# Adding start script | ||
COPY docker/runserver.sh /runserver.sh | ||
CMD ["/runserver.sh"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
version: '2' | ||
services: | ||
database: | ||
build: ./docker/database | ||
restart: always | ||
command: mysqld --user=root --verbose | ||
volumes: | ||
- /var/lib/mysql | ||
ports: | ||
- "3306:3306" | ||
environment: | ||
MYSQL_BASE: "msr14" | ||
MYSQL_USER: "msr14" | ||
MYSQL_PASSWORD: "msr14" | ||
MYSQL_ROOT_PASSWORD: "password" | ||
MYSQL_ALLOW_EMPTY_PASSWORD: "yes" | ||
|
||
web: | ||
build: . | ||
volumes: | ||
- .:/www | ||
ports: | ||
- "8000:8000" | ||
links: | ||
- database | ||
depends_on: | ||
- database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
# Stops and removes all docker containers and images | ||
|
||
docker stop $(docker ps -a -q) | ||
sleep 1 | ||
docker rm $(docker ps -a -q) | ||
sleep 1 | ||
docker rmi $(docker images -a -q) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM mysql:5.5 | ||
|
||
RUN mkdir /data | ||
WORKDIR /data | ||
|
||
# Install MSR14 database and add a custom sql file to be ran on initialization. | ||
RUN apt-get update && apt-get install -y curl sed | ||
RUN curl -O https://ghtstorage.blob.core.windows.net/downloads/msr14-mysql.gz | ||
RUN gzip -d msr14-mysql.gz | ||
RUN echo 'USE msr14;' | cat - msr14-mysql > temp && mv temp msr14-mysql | ||
RUN mv msr14-mysql /docker-entrypoint-initdb.d/msr-mysql.sql | ||
COPY create_db.sql /docker-entrypoint-initdb.d/ | ||
|
||
CMD ["/usr/bin/mysqld"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
create database msr14; | ||
|
||
GRANT SELECT, INSERT, DELETE, UPDATE ON msr14.* TO 'msr14'@'%'; | ||
GRANT SELECT, INSERT, DELETE, UPDATE ON msr14.* TO 'msr14'@'localhost'; | ||
|
||
GRANT ALL ON *.* to msr14@localhost IDENTIFIED BY 'msr14'; | ||
GRANT ALL ON *.* to msr14@'%' IDENTIFIED BY 'msr14'; | ||
|
||
FLUSH PRIVILEGES; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
# Create the local_settings.py to connect to the docker mysql | ||
echo "DATABASES = { | ||
'default': { | ||
'ENGINE': 'django.db.backends.mysql', | ||
'NAME': 'msr14', | ||
'USER': 'msr14', | ||
'PASSWORD': 'msr14', | ||
'HOST': 'database', | ||
'PORT': '3306'}}" > repo_health/local_settings.py | ||
|
||
# Check if the database is done running its init scripts | ||
until nc -z -v -w30 'database' 3306 | ||
do | ||
echo "Waiting for connection to database..." | ||
# wait for 7 seconds before checking if DB is up | ||
sleep 7 | ||
done | ||
|
||
# Migrate and start the server | ||
python manage.py migrate | ||
python manage.py runserver 0.0.0.0:8000 |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Milestone 1 | ||
|
||
## System Description | ||
The information system being built provides an unbiased evaluation of a GitHub repository using data collected by the GHTorrent project. The system is a web based interface and retrieves data about a GitHub repository using a URL specified by the user. The source code for the system is hosted on GitHub at: https://github.com/jakeharding/repo-health. | ||
|
||
The intent is to provide the user with usable information about a GitHub repository so the user can make an informed decision about the health and sustainability of the repository and the community supporting it. The system is not meant to provide any value to the statistics. | ||
|
||
The system has many parts. The backend provides a connection to the database, serialization of the data, and serving the data to the client in JSON format. The web client uses the JSON data to render the visualization of the data. Both parts are included in the source code repository for convenience, but the system is built so the separation of the frontend and backend can be easily achieved. | ||
|
||
The current state of the system is in a proof of concept and is not ready for a production environment. The proof of concept supplies basic statistics about a repository and leaves out complex data manipulation. | ||
|
||
## Development Environment | ||
Our development environment consists of several different tools. Our development operating system is a Linux/Unix (Mac) environment. Our database management system is MySQL. Our server is running on Python 3.5+ and is using the Django web framework and dev server. Python’s `virtualenv` is used to keep every developers python environment the same. Our front end is using the node package manager (npm) to manage and keep our dependencies in sync. | ||
|
||
|
||
## Data Flow Diagram | ||
Our Data Flow Diagram can be found [here](https://github.com/jakeharding/repo-health/blob/master/docs/Data%20Flow%20Diagram.pdf). | ||
|
||
## Database Schema | ||
We are using ghtorrent's schema. It can be found [here](http://ghtorrent.org/files/schema.pdf). | ||
|
||
## Copyright and License | ||
Licenses used for this project cover two areas: documentation and software. The software is covered under the MIT license and the documentation is covered under CC BY. | ||
|
||
Each file has the following documentation: | ||
|
||
``` | ||
fileName.ext - (C) Copyright - 2017 | ||
This software is copyrighted to contributors listed in CONTRIBUTIONS.md. | ||
SPDX-License-Identifier: MIT | ||
Author(s) of this file: | ||
Your name or github username | ||
Brief description of the file. | ||
``` | ||
|
||
## Contributions | ||
##### Jake: | ||
Jake is responsible for implementation of connecting to the database, the web server for the REST API, and all related documentation. | ||
|
||
##### Benji: | ||
Benji is responsible for the frontend implementation. This includes UI/UX Design and the display of information from the server on the UI. All documentation for the frontend will be written by Benji. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Milestone 2 | ||
|
||
## System Description | ||
|
||
The system is a web based user interface and retrieves data about a GitHub repository using a URL specified by the user. The source code for the system is hosted on GitHub at: https://github.com/jakeharding/repo-health. | ||
|
||
The intent is to provide the user with usable information about a GitHub repository so the user can make an informed decision about the health and sustainability of the repository and the community supporting it. | ||
|
||
The system has many parts. The backend provides a connection to the database, serialization of the data, and serving the data to the client in JSON format. The web client uses the JSON data to render the visualization of the data. Both parts are included in the source code repository for convenience, but the system is built so the separation of the frontend and backend can be easily achieved. | ||
|
||
The current state of the system is in a proof of concept and is not ready for a production environment. The proof of concept supplies basic statistics about a repository and leaves out complex data manipulation. | ||
|
||
Rendering of charts has been left out in this milestone but the data is still present in the user interface as a list of numbers. | ||
|
||
## Development Environment | ||
Our development operating system is a Linux/Unix (Mac) environment and our database management system is MySQL. | ||
|
||
Our server is running on Python 3.5+ and is using the Django web framework and dev server. Python’s `virtualenv` is used to keep every developers python environment the same. | ||
|
||
Our front end is using the node package manager (npm) to manage and keep our dependencies in sync. | ||
|
||
Docker is used to create an instance of the system as fast as possible. | ||
|
||
## Data Flow Diagram | ||
Our Data Flow Diagram can be found [here](https://github.com/jakeharding/repo-health/blob/master/docs/Data%20Flow%20Diagram.pdf). | ||
|
||
## Database Schema | ||
We are using ghtorrent's schema. It can be found [here](http://ghtorrent.org/files/schema.pdf). | ||
|
||
## Copyright and License | ||
Licenses used for this project cover two areas: documentation and software. The software is covered under the MIT license and the documentation is covered under CC BY. | ||
|
||
Each file has the following documentation: | ||
|
||
``` | ||
fileName.ext - (C) Copyright - 2017 | ||
This software is copyrighted to contributors listed in CONTRIBUTIONS.md. | ||
SPDX-License-Identifier: MIT | ||
Author(s) of this file: | ||
Your name or github username | ||
Brief description of the file. | ||
``` | ||
|
||
## Contributions | ||
##### Jake: | ||
Jake is responsible for implementation of connecting to the database, the web server for the REST API, and all related documentation. | ||
|
||
##### Benji: | ||
Benji is responsible for the frontend implementation. This includes UI/UX Design and the display of information from the server on the UI. All documentation for the frontend will be written by Benji. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Use Case | ||
|
||
**Title:** Determining the health of a Github repository | ||
|
||
**Primary Actor:** Project Leader | ||
|
||
**Goal in Context:** The project lead is able to assess if an open source project is healthly enough for its company's standards to incorporate into their product | ||
|
||
**Stakeholders:** | ||
* Project Lead: To understand if software is appropriate to incorporate into their own product | ||
* Developer: To clearly gauge if a piece of software will need to be maintained by them or if it's reliable | ||
* Manager: To access the longevity of this project with regards to dependencies | ||
|
||
**Preconditions:** | ||
* Metrics for a healthy repository are already defined | ||
* The repositories to be compared are already picked out | ||
|
||
**Main Success Scenario:** Project lead understands the metrics presented and makes an accurate decision if the software should be incoporated | ||
|
||
**Failed End Conditions:** Project lead receives little to no information on the health of the chosen repository | ||
|
||
**Trigger:** Project lead is assigned to a brand new project and needs to assess what libraries and dependencies should be used |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#Metrics for Issues of Repo | ||
|
||
###Issue ideas | ||
- Number of Issues vs last completed issue | ||
- Number of Issues closed over a period of time | ||
- Average of how often an issue is created | ||
- Age of Issues | ||
- How often a contributor comments on an issue | ||
- Average of how often issues get commented on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.