Independent Study Spring 2019/GitHub Enterprise: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
(Created page with "Adds GitHub Enterprise integration to E1858.")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
Adds GitHub Enterprise integration to E1858.
Adds GitHub Enterprise integration to E1858.
== Abstract ==
By attaching names and email addresses to each change, git version management can operationalize individual contributions to code projects. In combination with surveys, visualizing this git history can allow instructors to better understand group dynamics by showing work history and individual contributions.
== Problem Statement ==
The Expertiza peer-assessment system uses CATME-like surveys.  It also interfaces to Github, using the GraphQL API to retrieve data on the contributions of each team member, such as the lines of code added, number of commits, and number of days active. While the integration with GitHub exists, it has limitations when it comes to mapping git identities with Expertiza identities and the visualization page is rather limited.
== Short Literature Summary ==
While group projects benefit students, they are often challenged by the issue of free riders. This problem is often addressed through separate grades for group work and individual contributions via a rating system. Hybrid machine and peer assessment systems have been shown to increase accuracy and reduce student grading time.
== Process ==
=== Installing with Docker ===
I used docker-compose on my system. To replicate this setup, navigate the the main Expertiza directory. Then go to “devops/docker” and run the script to set things up.
Change the image line for Expertiza to the following:
    build:
        context: .
        dockerfile: ./devops/docker/Dockerfile
Following these instructions, download the scrubbed database and copy it to the scrubbed_db directory. Speaking of the database, set of the config by copying “config/database.yml.example” to “config/database.yml”. Add the password you used inside your “docker-compose.yml” file. Set the hostname to “scrubbed_db”.
Add instructions to the top of “scrubbed_db” so it knows which database to run inside:
    CREATE DATABASE expertiza_development;
    USE expertiza_development;
Next, build the docker containers and then launch them:
    docker-compose up
    docker-compose run expertiza bin/rake db:migrate RAILS_ENV=development
This will take several minutes to run the first time as Docker must first populate the database with the test data. It may also take several minutes to download and install your Ruby gems.
If you get an error about static assets, set up bower and then run “bower install”.
=== GitHub Integration ===
To add GitHub integration to Expertiza, first copy the example authentication file:
    cp config/github_auth.yml.example config/github_auth.yml
Create apps on GitHub for Expertiza. First, go to “Settings” on GitHub, then navigate to “Developer Settings” and then “OAuth Apps”. Copy the Client ID and the Client Secret to the appropriate locations in the YAML. If needed, repeat the process for a GitHub Enterprise instance.
== Contribution ==
My contribution comes in three main parts. First, I built on top of previous student work to extend Expertiza’s GitHub support to include GitHub Enterprise (GHE). This is helpful because the university often uses its own instance of GHE (github.ncsu.edu) for assignments. Second, I extended the “GitHub Metrics” front-end page to support live updates in JavaScript for different kinds of visualizations. This means that the page does not need to refresh each time the visualization is changed. My contributions here built on top of the work of another student team. Thirdy, I added a form which allows a user to map git email addresses to students on the team. This means that if a student were to use two different computers or two different accounts while working on the submission, those contributions can still be aggregated and displayed appropriately.
In addition to this work, I also added documentation for how to run Expertiza with Docker. This feature has existed for a couple of years, but the current documentation is a little out of date for where the code is right now. For example, the Docker image on DockerHub does not work with the current Gemfile. My instructions listed above get the project working in its current state in containers.
== Reflection ==
I came into this project with no experience with Ruby on Rails, but soon found its MVC architecture very intuitive. Unfortunately, I did spend a lot of my time learning how the current system works and figuring out how to get my changes to fit in with the current engineering. Reading the code on previous pull requests on the Expertiza repository aided me immensely in this endeavour. I also spent time exploring libraries such as Octokit and libgit2.rb, which I did not end up using.
I think future work can take a number of useful directions from here. Not every git commit represents a single person’s work. In pair programming, for instance, both driver and navigator should receive credit for their contributions. GitHub support tagging this kind of collaboration with co-authors. Integrating this feature could better capture group dynamics.
[[File:http://wiki.expertiza.ncsu.edu/images/5/5a/Screenshot_2019-12-11_github_metrics_view_github_metrics.png]]
[[File:http://wiki.expertiza.ncsu.edu/images/a/a5/Inidivdual_commits.png]]

Latest revision as of 20:16, 20 December 2019

Adds GitHub Enterprise integration to E1858.


Abstract

By attaching names and email addresses to each change, git version management can operationalize individual contributions to code projects. In combination with surveys, visualizing this git history can allow instructors to better understand group dynamics by showing work history and individual contributions.

Problem Statement

The Expertiza peer-assessment system uses CATME-like surveys. It also interfaces to Github, using the GraphQL API to retrieve data on the contributions of each team member, such as the lines of code added, number of commits, and number of days active. While the integration with GitHub exists, it has limitations when it comes to mapping git identities with Expertiza identities and the visualization page is rather limited.

Short Literature Summary

While group projects benefit students, they are often challenged by the issue of free riders. This problem is often addressed through separate grades for group work and individual contributions via a rating system. Hybrid machine and peer assessment systems have been shown to increase accuracy and reduce student grading time.

Process

Installing with Docker

I used docker-compose on my system. To replicate this setup, navigate the the main Expertiza directory. Then go to “devops/docker” and run the script to set things up.

Change the image line for Expertiza to the following:

   build:
       context: .
       dockerfile: ./devops/docker/Dockerfile

Following these instructions, download the scrubbed database and copy it to the scrubbed_db directory. Speaking of the database, set of the config by copying “config/database.yml.example” to “config/database.yml”. Add the password you used inside your “docker-compose.yml” file. Set the hostname to “scrubbed_db”.

Add instructions to the top of “scrubbed_db” so it knows which database to run inside:

   CREATE DATABASE expertiza_development;
   USE expertiza_development;

Next, build the docker containers and then launch them:

   docker-compose up
   docker-compose run expertiza bin/rake db:migrate RAILS_ENV=development

This will take several minutes to run the first time as Docker must first populate the database with the test data. It may also take several minutes to download and install your Ruby gems.

If you get an error about static assets, set up bower and then run “bower install”.

GitHub Integration

To add GitHub integration to Expertiza, first copy the example authentication file:

   cp config/github_auth.yml.example config/github_auth.yml

Create apps on GitHub for Expertiza. First, go to “Settings” on GitHub, then navigate to “Developer Settings” and then “OAuth Apps”. Copy the Client ID and the Client Secret to the appropriate locations in the YAML. If needed, repeat the process for a GitHub Enterprise instance.

Contribution

My contribution comes in three main parts. First, I built on top of previous student work to extend Expertiza’s GitHub support to include GitHub Enterprise (GHE). This is helpful because the university often uses its own instance of GHE (github.ncsu.edu) for assignments. Second, I extended the “GitHub Metrics” front-end page to support live updates in JavaScript for different kinds of visualizations. This means that the page does not need to refresh each time the visualization is changed. My contributions here built on top of the work of another student team. Thirdy, I added a form which allows a user to map git email addresses to students on the team. This means that if a student were to use two different computers or two different accounts while working on the submission, those contributions can still be aggregated and displayed appropriately.

In addition to this work, I also added documentation for how to run Expertiza with Docker. This feature has existed for a couple of years, but the current documentation is a little out of date for where the code is right now. For example, the Docker image on DockerHub does not work with the current Gemfile. My instructions listed above get the project working in its current state in containers.

Reflection

I came into this project with no experience with Ruby on Rails, but soon found its MVC architecture very intuitive. Unfortunately, I did spend a lot of my time learning how the current system works and figuring out how to get my changes to fit in with the current engineering. Reading the code on previous pull requests on the Expertiza repository aided me immensely in this endeavour. I also spent time exploring libraries such as Octokit and libgit2.rb, which I did not end up using.

I think future work can take a number of useful directions from here. Not every git commit represents a single person’s work. In pair programming, for instance, both driver and navigator should receive credit for their contributions. GitHub support tagging this kind of collaboration with co-authors. Integrating this feature could better capture group dynamics.


File:Http://wiki.expertiza.ncsu.edu/images/5/5a/Screenshot 2019-12-11 github metrics view github metrics.png


File:Http://wiki.expertiza.ncsu.edu/images/a/a5/Inidivdual commits.png