<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Xfang22</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Xfang22"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Xfang22"/>
	<updated>2026-05-16T22:29:04Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=142569</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=142569"/>
		<updated>2021-11-30T22:55:57Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* OminiAuth Github API update */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The functionality of the showing GitHub metrics cannot be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment. The project doesn't report lines added and deleted because of the lack of support from the current API. It adds quite a lot of lines of code for a single project and some codes could be refactored. The test plans of the current project are not described thoroughly enough. We will modify the existing RSpec test code and add some new tests.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have found numerous action items so far. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves&amp;quot; or features that are either left out of the original project or will make the integration display more integrated.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Turn on.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the GitHub report of the assignment is turned on or turned off, we need to create a new table named &amp;quot;use_github_metric&amp;quot; to save the id of the assignment whose GitHub metric is turned on. We also have an alternative solution to add a boolean field in the assignment table, but due to security concerns, we give it up. We think we should not change the data of the assignment.&lt;br /&gt;
&lt;br /&gt;
'''Table: use_github_metric'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|- style=&amp;quot;font-weight:bold;&amp;quot;&lt;br /&gt;
! id(PK)&lt;br /&gt;
! Assignment_id(FK)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 15&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Simplify the Codes ====&lt;br /&gt;
Extract the repeating part of codes and then construct an independent method based on them. Finally, we could use this method. &lt;br /&gt;
&lt;br /&gt;
The last edition uses the lots of Google API to help generate the chart, we can use the method from helper to generate charts instead.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chooses not to include the GitHub metric in the assignment (the functionality is turned off), the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed on the frontend page.&lt;br /&gt;
&lt;br /&gt;
1. We edited expertiza\app\views\assignments\edit\_general.html.erb and added a checkbox. The codes are as follow.&lt;br /&gt;
If the id of the assignment exists, there will be a checkbox for the user to use github metrics. The UseGithubMetricsController.exist use the self function in the controller. &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--Github--&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_use_github' colspan=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;checkbox&amp;quot; name = &amp;quot;use_github&amp;quot; id=&amp;quot;use_github&amp;quot; &amp;lt;%= &amp;quot;checked&amp;quot; &lt;br /&gt;
             if UseGithubMetricsController.exist(@assignment_form.assignment.id) %&amp;gt;&amp;gt;&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('use_github', 'Use github metrics?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The expertiza\app\views\assignments\list_submissions.html.erb is edited too. &lt;br /&gt;
If the id of the assignment exists and github_access_token is null (it means that the user hasn't logged in), then the page will show 'Login to Query Github data' button. If github_access_token is not null, it would show 'Refresh Github data' button because the user has logged in.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%if UseGithubMetricsController.exist(@assignment.id) %&amp;gt;&lt;br /&gt;
 &amp;lt;% if session[&amp;quot;github_access_token&amp;quot;].nil? %&amp;gt;&lt;br /&gt;
   &amp;lt;% topic_identifier, topic_name, users_for_curr_team, participants = get_data_for_list_submissions(@teams.first) %&amp;gt;&lt;br /&gt;
   &amp;lt;%= link_to 'Login to Query Github data', { controller: 'metrics', action: 'show', id: participants.first.id } %&amp;gt;&lt;br /&gt;
   &amp;lt;% else %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Refresh Github data', { controller: 'metrics', action: 'query_assignment_statistics', id: @assignment.id}, &lt;br /&gt;
                                                                                                       :onclick =&amp;gt; &amp;quot;showLoadIcon()&amp;quot;%&amp;gt;&lt;br /&gt;
   &amp;lt;img id=&amp;quot;load_icon&amp;quot; src=&amp;quot;&amp;lt;%= image_url('ajax-loader.gif') %&amp;gt;&amp;quot; style=&amp;quot;display:none&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Post the assignment id if the user selects the 'check' button and delete the data if the user cancels it by url. The function uses not self functions in controller. &lt;br /&gt;
&lt;br /&gt;
 jQuery(document).ready(function () {&lt;br /&gt;
        // This function determines whether the 'Topics' tab must be displayed when the page is re-loaded&lt;br /&gt;
        var checkbox = jQuery('#assignment_has_topics');&lt;br /&gt;
        if (checkbox.is(':checked')) {&lt;br /&gt;
            // If this checkbox is checked, show the 'Topics' tab&lt;br /&gt;
            jQuery(&amp;quot;#topics_tab_header&amp;quot;).show();&lt;br /&gt;
        } else {&lt;br /&gt;
            // Otherwise, hide topics tab&lt;br /&gt;
            jQuery(&amp;quot;#topics_tab_header&amp;quot;).hide();&lt;br /&gt;
        }&lt;br /&gt;
        $('#use_github').change(function () {&lt;br /&gt;
            if (jQuery('#use_github').is(':checked')) {&lt;br /&gt;
                jQuery.ajax({&lt;br /&gt;
                    url: '/use_github_metrics/' + &amp;lt;%= @assignment.id %&amp;gt;,&lt;br /&gt;
                    method: 'POST',&lt;br /&gt;
                    xhrFields: {&lt;br /&gt;
                        withCredentials: true&lt;br /&gt;
                    },&lt;br /&gt;
                    dataType: 'json'&lt;br /&gt;
                })&lt;br /&gt;
            } else{&lt;br /&gt;
                jQuery.ajax({&lt;br /&gt;
                    url: '/use_github_metrics/' + &amp;lt;%= @assignment.id %&amp;gt;,&lt;br /&gt;
                    method: 'DELETE',&lt;br /&gt;
                    xhrFields: {&lt;br /&gt;
                        withCredentials: true&lt;br /&gt;
                    },&lt;br /&gt;
                    dataType: 'json'&lt;br /&gt;
                })&lt;br /&gt;
            }&lt;br /&gt;
        })&lt;br /&gt;
    });&lt;br /&gt;
&lt;br /&gt;
==== Controller Modification ====&lt;br /&gt;
We added a function in expertiza\app\controllers\use_github_metrics_controller.rb as follwowing.&lt;br /&gt;
&lt;br /&gt;
===== Self Functions =====&lt;br /&gt;
&lt;br /&gt;
1. Check if assignment_id exists in the table use_github_metrics. If so, return TRUE.&lt;br /&gt;
 #check if assignment_id exists in the table use_github_metrics&lt;br /&gt;
  def self.exist(assignment_id)&lt;br /&gt;
    use_github = UseGithubMetric.find_by(assignment_id: assignment_id)&lt;br /&gt;
    !use_github.nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. If assignment_id does not exist in the table use_github_metrics, save it.&lt;br /&gt;
  #if assignment_id does not exist in the table use_github_metrics, save it&lt;br /&gt;
  def self.save(assignment_id)&lt;br /&gt;
    unless exist(assignment_id)&lt;br /&gt;
      use_github = UseGithubMetric.new(assignment_id)&lt;br /&gt;
      use_github.assignment_id = assignment_id&lt;br /&gt;
      use_github.save&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3. If assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  #if assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  def self.delete(assignment_id)&lt;br /&gt;
    if exist(assignment_id)&lt;br /&gt;
      use_github = UseGithubMetric.find_by(assignment_id: assignment_id)&lt;br /&gt;
      use_github.destroy&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
===== Not Self Functions =====&lt;br /&gt;
URL in frontend uses such functions.&lt;br /&gt;
&lt;br /&gt;
1. Return TRUE if the assignment id exists. &lt;br /&gt;
  #check if assignment_id exists in the table use_github_metrics&lt;br /&gt;
  def exist&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.exist(assignment_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. Save assignment is if it doesn't exist. This function is for the frontend page to select the checkbox.&lt;br /&gt;
  #if assignment_id does not exist in the table use_github_metrics, save it&lt;br /&gt;
  def save&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.save(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3. Delete assignment id if it exists. This function is for the frontend page to cancel the checkbox.&lt;br /&gt;
  #if assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  def delete&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.delete(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
An instructor can customize an assignment in this view. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:Before liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they choose Github metrics in the previous assignment edit page and is not authenticated to Github yet. The Login link redirects to an omniauth login page, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors if they don't choose the &amp;quot;use GitHub metric&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
This UML shows the new classes and models we created and implemented in our final project. Besides these, we also modified some of the existing classes and methods, we will give more detailed information later.&lt;br /&gt;
&lt;br /&gt;
[[File:E2149_Uml_1.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==OminiAuth Github API update==&lt;br /&gt;
The Github API requires users to be authenticated to query the API. Since GitHub no longer supports authentication through query parameters, we move the authentication to the header. From September 8, 2021, using access_token as a query parameter to access the API (as a user or as a GitHub App) and communication between the Expertiza server and Github, and using client_id/client_secret to make OAuth app unauthenticated are disabled.&lt;br /&gt;
&lt;br /&gt;
The callback URL (the URL of the Expertiza server) is set within Github.com, where the OAuth app is configured (and Client Keys/Secrets are generated). The code from the previous project uses Client Key/Secret pairs that are tied to a Github OAuth app that is configured to callback to http://localhost:3000/auth/github/callback. Naturally, when Expertiza is running in a production environment, or a deployment on a remote server where the client is not on the localhost, this callback will fail to redirect.&lt;br /&gt;
&lt;br /&gt;
Therefore, we create a new OAuth app using a Github.com account that configures a callback URL to http://server_ip_or_url:port/auth/github2021/callback/. The production callback URL is: https://expertiza.ncsu.edu/auth/github2021/callback. The reason &amp;quot;github2021&amp;quot; is used for this project is due to Github's 2021 updates to their security infrastructure -- our code handles &amp;quot;github&amp;quot; and &amp;quot;github2021&amp;quot; callbacks differently to match these security updates. Legacy OAuth apps (like the one used in the Repository code that routes to localhost) are still permitted to use the old omniauth.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
GitHub's OAuth implementation &lt;br /&gt;
&lt;br /&gt;
[[File:github-oauth.png|750px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  #Use Oauth protocols to attempt to authorize user for either google or github&lt;br /&gt;
  def oauth_login&lt;br /&gt;
    case params[:provider]&lt;br /&gt;
    when &amp;quot;github&amp;quot;&lt;br /&gt;
      github_login&lt;br /&gt;
    when &amp;quot;google_oauth2&amp;quot;&lt;br /&gt;
      google_login&lt;br /&gt;
    when &amp;quot;github2021&amp;quot; # due to github 0&lt;br /&gt;
      custom_github_login&lt;br /&gt;
    else&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, user.name, &amp;quot;Invalid OAuth Provider&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After requesting the user's GitHub identity,  the user will be redirected back to Expertiza by GitHub. If the user accepts the request, GitHub redirects back to expertiza with a temporary code in a code parameter and the state provided in the previous step in a state parameter. The client_id and client_secret are required as they received from GitHub for Expertiza. The code is also required as it would be a response to the request. Then the access token allows Expertiza to make requests to the API on a behalf of a user.&lt;br /&gt;
&lt;br /&gt;
  #Login functionality for Github to get access_token&lt;br /&gt;
  def custom_github_login&lt;br /&gt;
    session_code = request.env['rack.request.query_hash']['code']&lt;br /&gt;
    result = RestClient.post('https://github.com/login/oauth/access_token',&lt;br /&gt;
                               {:client_id =&amp;gt; GITHUB_CONFIG['client_key'],&lt;br /&gt;
                                :client_secret =&amp;gt; GITHUB_CONFIG['client_secret'],&lt;br /&gt;
                                :code =&amp;gt; session_code},&lt;br /&gt;
                                :accept =&amp;gt; :json)&lt;br /&gt;
    access_token = JSON.parse(result)['access_token']&lt;br /&gt;
    session[&amp;quot;github_access_token&amp;quot;] = access_token&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'list_submissions', id: session[&amp;quot;assignment_id&amp;quot;]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down option for Github metric on the page&lt;br /&gt;
:4. Process the page without choosing Github metrics report  for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
Detailed of Github Testing&lt;br /&gt;
&lt;br /&gt;
After changing the way of calling the GitHub API, we need to test whether we can get the data from the GitHub API correctly.&lt;br /&gt;
&lt;br /&gt;
 describe '#gets data from GitHub api v4(graphql)' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_github_repository_details' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_statuses_for_pull_request' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
=====Previous Project References=====&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=142568</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=142568"/>
		<updated>2021-11-30T22:54:55Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* OminiAuth Github API update */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The functionality of the showing GitHub metrics cannot be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment. The project doesn't report lines added and deleted because of the lack of support from the current API. It adds quite a lot of lines of code for a single project and some codes could be refactored. The test plans of the current project are not described thoroughly enough. We will modify the existing RSpec test code and add some new tests.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have found numerous action items so far. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves&amp;quot; or features that are either left out of the original project or will make the integration display more integrated.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Turn on.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the GitHub report of the assignment is turned on or turned off, we need to create a new table named &amp;quot;use_github_metric&amp;quot; to save the id of the assignment whose GitHub metric is turned on. We also have an alternative solution to add a boolean field in the assignment table, but due to security concerns, we give it up. We think we should not change the data of the assignment.&lt;br /&gt;
&lt;br /&gt;
'''Table: use_github_metric'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|- style=&amp;quot;font-weight:bold;&amp;quot;&lt;br /&gt;
! id(PK)&lt;br /&gt;
! Assignment_id(FK)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 15&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Simplify the Codes ====&lt;br /&gt;
Extract the repeating part of codes and then construct an independent method based on them. Finally, we could use this method. &lt;br /&gt;
&lt;br /&gt;
The last edition uses the lots of Google API to help generate the chart, we can use the method from helper to generate charts instead.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chooses not to include the GitHub metric in the assignment (the functionality is turned off), the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed on the frontend page.&lt;br /&gt;
&lt;br /&gt;
1. We edited expertiza\app\views\assignments\edit\_general.html.erb and added a checkbox. The codes are as follow.&lt;br /&gt;
If the id of the assignment exists, there will be a checkbox for the user to use github metrics. The UseGithubMetricsController.exist use the self function in the controller. &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--Github--&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_use_github' colspan=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;checkbox&amp;quot; name = &amp;quot;use_github&amp;quot; id=&amp;quot;use_github&amp;quot; &amp;lt;%= &amp;quot;checked&amp;quot; &lt;br /&gt;
             if UseGithubMetricsController.exist(@assignment_form.assignment.id) %&amp;gt;&amp;gt;&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('use_github', 'Use github metrics?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The expertiza\app\views\assignments\list_submissions.html.erb is edited too. &lt;br /&gt;
If the id of the assignment exists and github_access_token is null (it means that the user hasn't logged in), then the page will show 'Login to Query Github data' button. If github_access_token is not null, it would show 'Refresh Github data' button because the user has logged in.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%if UseGithubMetricsController.exist(@assignment.id) %&amp;gt;&lt;br /&gt;
 &amp;lt;% if session[&amp;quot;github_access_token&amp;quot;].nil? %&amp;gt;&lt;br /&gt;
   &amp;lt;% topic_identifier, topic_name, users_for_curr_team, participants = get_data_for_list_submissions(@teams.first) %&amp;gt;&lt;br /&gt;
   &amp;lt;%= link_to 'Login to Query Github data', { controller: 'metrics', action: 'show', id: participants.first.id } %&amp;gt;&lt;br /&gt;
   &amp;lt;% else %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Refresh Github data', { controller: 'metrics', action: 'query_assignment_statistics', id: @assignment.id}, &lt;br /&gt;
                                                                                                       :onclick =&amp;gt; &amp;quot;showLoadIcon()&amp;quot;%&amp;gt;&lt;br /&gt;
   &amp;lt;img id=&amp;quot;load_icon&amp;quot; src=&amp;quot;&amp;lt;%= image_url('ajax-loader.gif') %&amp;gt;&amp;quot; style=&amp;quot;display:none&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Post the assignment id if the user selects the 'check' button and delete the data if the user cancels it by url. The function uses not self functions in controller. &lt;br /&gt;
&lt;br /&gt;
 jQuery(document).ready(function () {&lt;br /&gt;
        // This function determines whether the 'Topics' tab must be displayed when the page is re-loaded&lt;br /&gt;
        var checkbox = jQuery('#assignment_has_topics');&lt;br /&gt;
        if (checkbox.is(':checked')) {&lt;br /&gt;
            // If this checkbox is checked, show the 'Topics' tab&lt;br /&gt;
            jQuery(&amp;quot;#topics_tab_header&amp;quot;).show();&lt;br /&gt;
        } else {&lt;br /&gt;
            // Otherwise, hide topics tab&lt;br /&gt;
            jQuery(&amp;quot;#topics_tab_header&amp;quot;).hide();&lt;br /&gt;
        }&lt;br /&gt;
        $('#use_github').change(function () {&lt;br /&gt;
            if (jQuery('#use_github').is(':checked')) {&lt;br /&gt;
                jQuery.ajax({&lt;br /&gt;
                    url: '/use_github_metrics/' + &amp;lt;%= @assignment.id %&amp;gt;,&lt;br /&gt;
                    method: 'POST',&lt;br /&gt;
                    xhrFields: {&lt;br /&gt;
                        withCredentials: true&lt;br /&gt;
                    },&lt;br /&gt;
                    dataType: 'json'&lt;br /&gt;
                })&lt;br /&gt;
            } else{&lt;br /&gt;
                jQuery.ajax({&lt;br /&gt;
                    url: '/use_github_metrics/' + &amp;lt;%= @assignment.id %&amp;gt;,&lt;br /&gt;
                    method: 'DELETE',&lt;br /&gt;
                    xhrFields: {&lt;br /&gt;
                        withCredentials: true&lt;br /&gt;
                    },&lt;br /&gt;
                    dataType: 'json'&lt;br /&gt;
                })&lt;br /&gt;
            }&lt;br /&gt;
        })&lt;br /&gt;
    });&lt;br /&gt;
&lt;br /&gt;
==== Controller Modification ====&lt;br /&gt;
We added a function in expertiza\app\controllers\use_github_metrics_controller.rb as follwowing.&lt;br /&gt;
&lt;br /&gt;
===== Self Functions =====&lt;br /&gt;
&lt;br /&gt;
1. Check if assignment_id exists in the table use_github_metrics. If so, return TRUE.&lt;br /&gt;
 #check if assignment_id exists in the table use_github_metrics&lt;br /&gt;
  def self.exist(assignment_id)&lt;br /&gt;
    use_github = UseGithubMetric.find_by(assignment_id: assignment_id)&lt;br /&gt;
    !use_github.nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. If assignment_id does not exist in the table use_github_metrics, save it.&lt;br /&gt;
  #if assignment_id does not exist in the table use_github_metrics, save it&lt;br /&gt;
  def self.save(assignment_id)&lt;br /&gt;
    unless exist(assignment_id)&lt;br /&gt;
      use_github = UseGithubMetric.new(assignment_id)&lt;br /&gt;
      use_github.assignment_id = assignment_id&lt;br /&gt;
      use_github.save&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3. If assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  #if assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  def self.delete(assignment_id)&lt;br /&gt;
    if exist(assignment_id)&lt;br /&gt;
      use_github = UseGithubMetric.find_by(assignment_id: assignment_id)&lt;br /&gt;
      use_github.destroy&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
===== Not Self Functions =====&lt;br /&gt;
URL in frontend uses such functions.&lt;br /&gt;
&lt;br /&gt;
1. Return TRUE if the assignment id exists. &lt;br /&gt;
  #check if assignment_id exists in the table use_github_metrics&lt;br /&gt;
  def exist&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.exist(assignment_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. Save assignment is if it doesn't exist. This function is for the frontend page to select the checkbox.&lt;br /&gt;
  #if assignment_id does not exist in the table use_github_metrics, save it&lt;br /&gt;
  def save&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.save(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3. Delete assignment id if it exists. This function is for the frontend page to cancel the checkbox.&lt;br /&gt;
  #if assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  def delete&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.delete(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
An instructor can customize an assignment in this view. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:Before liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they choose Github metrics in the previous assignment edit page and is not authenticated to Github yet. The Login link redirects to an omniauth login page, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors if they don't choose the &amp;quot;use GitHub metric&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
This UML shows the new classes and models we created and implemented in our final project. Besides these, we also modified some of the existing classes and methods, we will give more detailed information later.&lt;br /&gt;
&lt;br /&gt;
[[File:E2149_Uml_1.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==OminiAuth Github API update==&lt;br /&gt;
The Github API requires users to be authenticated to query the API. Since GitHub no longer supports authentication through query parameters, we move the authentication to the header. From September 8, 2021, using access_token as a query parameter to access the API (as a user or as a GitHub App) and communication between the Expertiza server and Github, and using client_id/client_secret to make OAuth app unauthenticated are disabled.&lt;br /&gt;
&lt;br /&gt;
The callback URL (the URL of the Expertiza server) is set within Github.com, where the OAuth app is configured (and Client Keys/Secrets are generated). The code from the previous project uses Client Key/Secret pairs that are tied to a Github OAuth app that is configured to callback to http://localhost:3000/auth/github/callback. Naturally, when Expertiza is running in a production environment, or a deployment on a remote server where the client is not on the localhost, this callback will fail to redirect.&lt;br /&gt;
&lt;br /&gt;
Therefore, we create a new OAuth app using a Github.com account that configures a callback URL to http://server_ip_or_url:port/auth/github2021/callback/. T production callback URL is: https://expertiza.ncsu.edu/auth/github2021/callback. The reason &amp;quot;github2021&amp;quot; is used for this project is due to Github's 2021 updates to their security infrastructure -- our code handles &amp;quot;github&amp;quot; and &amp;quot;github2021&amp;quot; callbacks differently to match these security updates. Legacy OAuth apps (like the one used in the Repository code that routes to localhost) are still permitted to use the old omniauth.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
GitHub's OAuth implementation &lt;br /&gt;
&lt;br /&gt;
[[File:github-oauth.png|750px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  #Use Oauth protocols to attempt to authorize user for either google or github&lt;br /&gt;
  def oauth_login&lt;br /&gt;
    case params[:provider]&lt;br /&gt;
    when &amp;quot;github&amp;quot;&lt;br /&gt;
      github_login&lt;br /&gt;
    when &amp;quot;google_oauth2&amp;quot;&lt;br /&gt;
      google_login&lt;br /&gt;
    when &amp;quot;github2021&amp;quot; # due to github 0&lt;br /&gt;
      custom_github_login&lt;br /&gt;
    else&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, user.name, &amp;quot;Invalid OAuth Provider&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After requesting the user's GitHub identity,  the user will be redirected back to Expertiza by GitHub. If the user accepts the request, GitHub redirects back to expertiza with a temporary code in a code parameter and the state provided in the previous step in a state parameter. The client_id and client_secret are required as they received from GitHub for Expertiza. The code is also required as it would be a response to the request. Then the access token allows Expertiza to make requests to the API on a behalf of a user.&lt;br /&gt;
&lt;br /&gt;
  #Login functionality for Github to get access_token&lt;br /&gt;
  def custom_github_login&lt;br /&gt;
    session_code = request.env['rack.request.query_hash']['code']&lt;br /&gt;
    result = RestClient.post('https://github.com/login/oauth/access_token',&lt;br /&gt;
                               {:client_id =&amp;gt; GITHUB_CONFIG['client_key'],&lt;br /&gt;
                                :client_secret =&amp;gt; GITHUB_CONFIG['client_secret'],&lt;br /&gt;
                                :code =&amp;gt; session_code},&lt;br /&gt;
                                :accept =&amp;gt; :json)&lt;br /&gt;
    access_token = JSON.parse(result)['access_token']&lt;br /&gt;
    session[&amp;quot;github_access_token&amp;quot;] = access_token&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'list_submissions', id: session[&amp;quot;assignment_id&amp;quot;]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down option for Github metric on the page&lt;br /&gt;
:4. Process the page without choosing Github metrics report  for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
Detailed of Github Testing&lt;br /&gt;
&lt;br /&gt;
After changing the way of calling the GitHub API, we need to test whether we can get the data from the GitHub API correctly.&lt;br /&gt;
&lt;br /&gt;
 describe '#gets data from GitHub api v4(graphql)' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_github_repository_details' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_statuses_for_pull_request' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
=====Previous Project References=====&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=142563</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=142563"/>
		<updated>2021-11-30T22:39:17Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* OminiAuth Github API update */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The functionality of the showing GitHub metrics cannot be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment. The project doesn't report lines added and deleted because of the lack of support from the current API. It adds quite a lot of lines of code for a single project and some codes could be refactored. The test plans of the current project are not described thoroughly enough. We will modify the existing RSpec test code and add some new tests.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have found numerous action items so far. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves&amp;quot; or features that are either left out of the original project or will make the integration display more integrated.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Turn on.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the GitHub report of the assignment is turned on or turned off, we need to create a new table named &amp;quot;use_github_metric&amp;quot; to save the id of the assignment whose GitHub metric is turned on. We also have an alternative solution to add a boolean field in the assignment table, but due to security concerns, we give it up. We think we should not change the data of the assignment.&lt;br /&gt;
&lt;br /&gt;
'''Table: use_github_metric'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|- style=&amp;quot;font-weight:bold;&amp;quot;&lt;br /&gt;
! id(PK)&lt;br /&gt;
! Assignment_id(FK)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 15&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Simplify the Codes ====&lt;br /&gt;
Extract the repeating part of codes and then construct an independent method based on them. Finally, we could use this method. &lt;br /&gt;
&lt;br /&gt;
The last edition uses the lots of Google API to help generate the chart, we can use the method from helper to generate charts instead.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chooses not to include the GitHub metric in the assignment (the functionality is turned off), the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed on the frontend page.&lt;br /&gt;
&lt;br /&gt;
1. We edited expertiza\app\views\assignments\edit\_general.html.erb and added a checkbox. The codes are as follow.&lt;br /&gt;
If the id of the assignment exists, there will be a checkbox for the user to use github metrics.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--Github--&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_use_github' colspan=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;checkbox&amp;quot; name = &amp;quot;use_github&amp;quot; id=&amp;quot;use_github&amp;quot; &amp;lt;%= &amp;quot;checked&amp;quot; &lt;br /&gt;
             if UseGithubMetricsController.exist(@assignment_form.assignment.id) %&amp;gt;&amp;gt;&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('use_github', 'Use github metrics?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The expertiza\app\views\assignments\list_submissions.html.erb is edited too. &lt;br /&gt;
If the id of the assignment exists and github_access_token is null (it means that the user hasn't logged in), then the page will show 'Login to Query Github data' button. If github_access_token is not null, it would show 'Refresh Github data' button because the user has logged in.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%if UseGithubMetricsController.exist(@assignment.id) %&amp;gt;&lt;br /&gt;
 &amp;lt;% if session[&amp;quot;github_access_token&amp;quot;].nil? %&amp;gt;&lt;br /&gt;
   &amp;lt;% topic_identifier, topic_name, users_for_curr_team, participants = get_data_for_list_submissions(@teams.first) %&amp;gt;&lt;br /&gt;
   &amp;lt;%= link_to 'Login to Query Github data', { controller: 'metrics', action: 'show', id: participants.first.id } %&amp;gt;&lt;br /&gt;
   &amp;lt;% else %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Refresh Github data', { controller: 'metrics', action: 'query_assignment_statistics', id: @assignment.id}, &lt;br /&gt;
                                                                                                       :onclick =&amp;gt; &amp;quot;showLoadIcon()&amp;quot;%&amp;gt;&lt;br /&gt;
   &amp;lt;img id=&amp;quot;load_icon&amp;quot; src=&amp;quot;&amp;lt;%= image_url('ajax-loader.gif') %&amp;gt;&amp;quot; style=&amp;quot;display:none&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controller Modification ====&lt;br /&gt;
We added a function in expertiza\app\controllers\use_github_metrics_controller.rb as follwowing.&lt;br /&gt;
&lt;br /&gt;
===== Self Functions =====&lt;br /&gt;
&lt;br /&gt;
1. Check if assignment_id exists in the table use_github_metrics. If so, return TRUE.&lt;br /&gt;
 #check if assignment_id exists in the table use_github_metrics&lt;br /&gt;
  def self.exist(assignment_id)&lt;br /&gt;
    use_github = UseGithubMetric.find_by(assignment_id: assignment_id)&lt;br /&gt;
    !use_github.nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. If assignment_id does not exist in the table use_github_metrics, save it.&lt;br /&gt;
  #if assignment_id does not exist in the table use_github_metrics, save it&lt;br /&gt;
  def self.save(assignment_id)&lt;br /&gt;
    unless exist(assignment_id)&lt;br /&gt;
      use_github = UseGithubMetric.new(assignment_id)&lt;br /&gt;
      use_github.assignment_id = assignment_id&lt;br /&gt;
      use_github.save&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3. If assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  #if assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  def self.delete(assignment_id)&lt;br /&gt;
    if exist(assignment_id)&lt;br /&gt;
      use_github = UseGithubMetric.find_by(assignment_id: assignment_id)&lt;br /&gt;
      use_github.destroy&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
===== Not Self Functions =====&lt;br /&gt;
&lt;br /&gt;
1. Return TRUE if the assignment id exists. &lt;br /&gt;
  #check if assignment_id exists in the table use_github_metrics&lt;br /&gt;
  def exist&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.exist(assignment_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. Save assignment is if it doesn't exist. This function is for the frontend page to select the checkbox.&lt;br /&gt;
  #if assignment_id does not exist in the table use_github_metrics, save it&lt;br /&gt;
  def save&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.save(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3. Delete assignment id if it exists. This function is for the frontend page to cancel the checkbox.&lt;br /&gt;
  #if assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  def delete&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.delete(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
An instructor can customize an assignment in this view. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:Before liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they choose Github metrics in the previous assignment edit page and is not authenticated to Github yet. The Login link redirects to an omniauth login page, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors if they don't choose the &amp;quot;use GitHub metric&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
This UML shows the new classes and models we created and implemented in our final project. Besides these, we also modified some of the existing classes and methods, we will give more detailed information later.&lt;br /&gt;
&lt;br /&gt;
[[File:E2149_Uml_1.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==OminiAuth Github API update==&lt;br /&gt;
GitHub no longer supports authentication through query parameters. Thus, we move the authentication to the header.&lt;br /&gt;
From September 8, 2021, using access_token as a query parameter to access the API (as a user or as a GitHub App) and using client_id/client_secret to make OAuth app unauthenticated are disabled. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
GitHub's OAuth implementation &lt;br /&gt;
&lt;br /&gt;
[[File:github-oauth.png|750px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  #Use Oauth protocols to attempt to authorize user for either google or github&lt;br /&gt;
  def oauth_login&lt;br /&gt;
    case params[:provider]&lt;br /&gt;
    when &amp;quot;github&amp;quot;&lt;br /&gt;
      github_login&lt;br /&gt;
    when &amp;quot;google_oauth2&amp;quot;&lt;br /&gt;
      google_login&lt;br /&gt;
    when &amp;quot;github2021&amp;quot; # due to github 0&lt;br /&gt;
      custom_github_login&lt;br /&gt;
    else&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, user.name, &amp;quot;Invalid OAuth Provider&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After requesting the user's GitHub identity,  the user will be redirected back to Expertiza by GitHub. If the user accepts the request, GitHub redirects back to expertiza with a temporary code in a code parameter and the state provided in the previous step in a state parameter. The client_id and client_secret are required as they received from GitHub for Expertiza. The code is also required as it would be a response to the request. Then the access token allows Expertiza to make requests to the API on a behalf of a user.&lt;br /&gt;
&lt;br /&gt;
  #Login functionality for Github to get access_token&lt;br /&gt;
  def custom_github_login&lt;br /&gt;
    session_code = request.env['rack.request.query_hash']['code']&lt;br /&gt;
    result = RestClient.post('https://github.com/login/oauth/access_token',&lt;br /&gt;
                               {:client_id =&amp;gt; GITHUB_CONFIG['client_key'],&lt;br /&gt;
                                :client_secret =&amp;gt; GITHUB_CONFIG['client_secret'],&lt;br /&gt;
                                :code =&amp;gt; session_code},&lt;br /&gt;
                                :accept =&amp;gt; :json)&lt;br /&gt;
    access_token = JSON.parse(result)['access_token']&lt;br /&gt;
    session[&amp;quot;github_access_token&amp;quot;] = access_token&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'list_submissions', id: session[&amp;quot;assignment_id&amp;quot;]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down option for Github metric on the page&lt;br /&gt;
:4. Process the page without choosing Github metrics report  for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
Detailed of Github Testing&lt;br /&gt;
&lt;br /&gt;
After changing the way of calling the GitHub API, we need to test whether we can get the data from the GitHub API correctly.&lt;br /&gt;
&lt;br /&gt;
 describe '#gets data from GitHub api v4(graphql)' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_github_repository_details' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_statuses_for_pull_request' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
=====Previous Project References=====&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=142562</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=142562"/>
		<updated>2021-11-30T22:32:57Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* OminiAuth Github API update */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The functionality of the showing GitHub metrics cannot be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment. The project doesn't report lines added and deleted because of the lack of support from the current API. It adds quite a lot of lines of code for a single project and some codes could be refactored. The test plans of the current project are not described thoroughly enough. We will modify the existing RSpec test code and add some new tests.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have found numerous action items so far. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves&amp;quot; or features that are either left out of the original project or will make the integration display more integrated.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Turn on.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the GitHub report of the assignment is turned on or turned off, we need to create a new table named &amp;quot;use_github_metric&amp;quot; to save the id of the assignment whose GitHub metric is turned on. We also have an alternative solution to add a boolean field in the assignment table, but due to security concerns, we give it up. We think we should not change the data of the assignment.&lt;br /&gt;
&lt;br /&gt;
'''Table: use_github_metric'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|- style=&amp;quot;font-weight:bold;&amp;quot;&lt;br /&gt;
! id(PK)&lt;br /&gt;
! Assignment_id(FK)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 15&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Simplify the Codes ====&lt;br /&gt;
Extract the repeating part of codes and then construct an independent method based on them. Finally, we could use this method. &lt;br /&gt;
&lt;br /&gt;
The last edition uses the lots of Google API to help generate the chart, we can use the method from helper to generate charts instead.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chooses not to include the GitHub metric in the assignment (the functionality is turned off), the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed on the frontend page.&lt;br /&gt;
&lt;br /&gt;
1. We edited expertiza\app\views\assignments\edit\_general.html.erb and added a checkbox. The codes are as follow.&lt;br /&gt;
If the id of the assignment exists, there will be a checkbox for the user to use github metrics.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--Github--&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_use_github' colspan=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;checkbox&amp;quot; name = &amp;quot;use_github&amp;quot; id=&amp;quot;use_github&amp;quot; &amp;lt;%= &amp;quot;checked&amp;quot; &lt;br /&gt;
             if UseGithubMetricsController.exist(@assignment_form.assignment.id) %&amp;gt;&amp;gt;&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('use_github', 'Use github metrics?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The expertiza\app\views\assignments\list_submissions.html.erb is edited too. &lt;br /&gt;
If the id of the assignment exists and github_access_token is null (it means that the user hasn't logged in), then the page will show 'Login to Query Github data' button. If github_access_token is not null, it would show 'Refresh Github data' button because the user has logged in.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%if UseGithubMetricsController.exist(@assignment.id) %&amp;gt;&lt;br /&gt;
 &amp;lt;% if session[&amp;quot;github_access_token&amp;quot;].nil? %&amp;gt;&lt;br /&gt;
   &amp;lt;% topic_identifier, topic_name, users_for_curr_team, participants = get_data_for_list_submissions(@teams.first) %&amp;gt;&lt;br /&gt;
   &amp;lt;%= link_to 'Login to Query Github data', { controller: 'metrics', action: 'show', id: participants.first.id } %&amp;gt;&lt;br /&gt;
   &amp;lt;% else %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Refresh Github data', { controller: 'metrics', action: 'query_assignment_statistics', id: @assignment.id}, &lt;br /&gt;
                                                                                                       :onclick =&amp;gt; &amp;quot;showLoadIcon()&amp;quot;%&amp;gt;&lt;br /&gt;
   &amp;lt;img id=&amp;quot;load_icon&amp;quot; src=&amp;quot;&amp;lt;%= image_url('ajax-loader.gif') %&amp;gt;&amp;quot; style=&amp;quot;display:none&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controller Modification ====&lt;br /&gt;
We added a function in expertiza\app\controllers\use_github_metrics_controller.rb as follwowing.&lt;br /&gt;
&lt;br /&gt;
===== Self Functions =====&lt;br /&gt;
&lt;br /&gt;
1. Check if assignment_id exists in the table use_github_metrics. If so, return TRUE.&lt;br /&gt;
 #check if assignment_id exists in the table use_github_metrics&lt;br /&gt;
  def self.exist(assignment_id)&lt;br /&gt;
    use_github = UseGithubMetric.find_by(assignment_id: assignment_id)&lt;br /&gt;
    !use_github.nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. If assignment_id does not exist in the table use_github_metrics, save it.&lt;br /&gt;
  #if assignment_id does not exist in the table use_github_metrics, save it&lt;br /&gt;
  def self.save(assignment_id)&lt;br /&gt;
    unless exist(assignment_id)&lt;br /&gt;
      use_github = UseGithubMetric.new(assignment_id)&lt;br /&gt;
      use_github.assignment_id = assignment_id&lt;br /&gt;
      use_github.save&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3. If assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  #if assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  def self.delete(assignment_id)&lt;br /&gt;
    if exist(assignment_id)&lt;br /&gt;
      use_github = UseGithubMetric.find_by(assignment_id: assignment_id)&lt;br /&gt;
      use_github.destroy&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
===== Not Self Functions =====&lt;br /&gt;
&lt;br /&gt;
1. Return TRUE if the assignment id exists. &lt;br /&gt;
  #check if assignment_id exists in the table use_github_metrics&lt;br /&gt;
  def exist&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.exist(assignment_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. Save assignment is if it doesn't exist. This function is for the frontend page to select the checkbox.&lt;br /&gt;
  #if assignment_id does not exist in the table use_github_metrics, save it&lt;br /&gt;
  def save&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.save(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3. Delete assignment id if it exists. This function is for the frontend page to cancel the checkbox.&lt;br /&gt;
  #if assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  def delete&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.delete(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
An instructor can customize an assignment in this view. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:Before liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they choose Github metrics in the previous assignment edit page and is not authenticated to Github yet. The Login link redirects to an omniauth login page, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors if they don't choose the &amp;quot;use GitHub metric&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
This UML shows the new classes and models we created and implemented in our final project. Besides these, we also modified some of the existing classes and methods, we will give more detailed information later.&lt;br /&gt;
&lt;br /&gt;
[[File:E2149_Uml_1.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==OminiAuth Github API update==&lt;br /&gt;
GitHub no longer supports authentication through query parameters. Thus, we move the authentication to the header.&lt;br /&gt;
From September 8, 2021, using access_token as a query parameter to access the API (as a user or as a GitHub App) and using client_id/client_secret to make OAuth app unauthenticated are disabled. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
GitHub's OAuth implementation &lt;br /&gt;
&lt;br /&gt;
[[File:github-oauth.png|750px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  def oauth_login&lt;br /&gt;
    case params[:provider]&lt;br /&gt;
    when &amp;quot;github&amp;quot;&lt;br /&gt;
      github_login&lt;br /&gt;
    when &amp;quot;google_oauth2&amp;quot;&lt;br /&gt;
      google_login&lt;br /&gt;
    when &amp;quot;github2021&amp;quot; # due to github 0&lt;br /&gt;
      custom_github_login&lt;br /&gt;
    else&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, user.name, &amp;quot;Invalid OAuth Provider&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After requesting the user's GitHub identity,  the user will be redirected back to Expertiza by GitHub. If the user accepts the request, GitHub redirects back to expertiza with a temporary code in a code parameter and the state provided in the previous step in a state parameter. The client_id and client_secret are required as they received from GitHub for Expertiza. The code is also required as it would be a response to the request. Then the access token allows Expertiza to make requests to the API on a behalf of a user.&lt;br /&gt;
&lt;br /&gt;
  def custom_github_login&lt;br /&gt;
    session_code = request.env['rack.request.query_hash']['code']&lt;br /&gt;
    result = RestClient.post('https://github.com/login/oauth/access_token',&lt;br /&gt;
                               {:client_id =&amp;gt; GITHUB_CONFIG['client_key'],&lt;br /&gt;
                                :client_secret =&amp;gt; GITHUB_CONFIG['client_secret'],&lt;br /&gt;
                                :code =&amp;gt; session_code},&lt;br /&gt;
                                :accept =&amp;gt; :json)&lt;br /&gt;
    access_token = JSON.parse(result)['access_token']&lt;br /&gt;
    session[&amp;quot;github_access_token&amp;quot;] = access_token&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'list_submissions', id: session[&amp;quot;assignment_id&amp;quot;]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down option for Github metric on the page&lt;br /&gt;
:4. Process the page without choosing Github metrics report  for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
Detailed of Github Testing&lt;br /&gt;
&lt;br /&gt;
After changing the way of calling the GitHub API, we need to test whether we can get the data from the GitHub API correctly.&lt;br /&gt;
&lt;br /&gt;
 describe '#gets data from GitHub api v4(graphql)' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_github_repository_details' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_statuses_for_pull_request' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
=====Previous Project References=====&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=142561</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=142561"/>
		<updated>2021-11-30T22:31:24Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* OminiAuth Github API update */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The functionality of the showing GitHub metrics cannot be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment. The project doesn't report lines added and deleted because of the lack of support from the current API. It adds quite a lot of lines of code for a single project and some codes could be refactored. The test plans of the current project are not described thoroughly enough. We will modify the existing RSpec test code and add some new tests.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have found numerous action items so far. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves&amp;quot; or features that are either left out of the original project or will make the integration display more integrated.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Turn on.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the GitHub report of the assignment is turned on or turned off, we need to create a new table named &amp;quot;use_github_metric&amp;quot; to save the id of the assignment whose GitHub metric is turned on. We also have an alternative solution to add a boolean field in the assignment table, but due to security concerns, we give it up. We think we should not change the data of the assignment.&lt;br /&gt;
&lt;br /&gt;
'''Table: use_github_metric'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|- style=&amp;quot;font-weight:bold;&amp;quot;&lt;br /&gt;
! id(PK)&lt;br /&gt;
! Assignment_id(FK)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 15&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Simplify the Codes ====&lt;br /&gt;
Extract the repeating part of codes and then construct an independent method based on them. Finally, we could use this method. &lt;br /&gt;
&lt;br /&gt;
The last edition uses the lots of Google API to help generate the chart, we can use the method from helper to generate charts instead.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chooses not to include the GitHub metric in the assignment (the functionality is turned off), the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed on the frontend page.&lt;br /&gt;
&lt;br /&gt;
1. We edited expertiza\app\views\assignments\edit\_general.html.erb and added a checkbox. The codes are as follow.&lt;br /&gt;
If the id of the assignment exists, there will be a checkbox for the user to use github metrics.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--Github--&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_use_github' colspan=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;checkbox&amp;quot; name = &amp;quot;use_github&amp;quot; id=&amp;quot;use_github&amp;quot; &amp;lt;%= &amp;quot;checked&amp;quot; &lt;br /&gt;
             if UseGithubMetricsController.exist(@assignment_form.assignment.id) %&amp;gt;&amp;gt;&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('use_github', 'Use github metrics?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The expertiza\app\views\assignments\list_submissions.html.erb is edited too. &lt;br /&gt;
If the id of the assignment exists and github_access_token is null (it means that the user hasn't logged in), then the page will show 'Login to Query Github data' button. If github_access_token is not null, it would show 'Refresh Github data' button because the user has logged in.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%if UseGithubMetricsController.exist(@assignment.id) %&amp;gt;&lt;br /&gt;
 &amp;lt;% if session[&amp;quot;github_access_token&amp;quot;].nil? %&amp;gt;&lt;br /&gt;
   &amp;lt;% topic_identifier, topic_name, users_for_curr_team, participants = get_data_for_list_submissions(@teams.first) %&amp;gt;&lt;br /&gt;
   &amp;lt;%= link_to 'Login to Query Github data', { controller: 'metrics', action: 'show', id: participants.first.id } %&amp;gt;&lt;br /&gt;
   &amp;lt;% else %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Refresh Github data', { controller: 'metrics', action: 'query_assignment_statistics', id: @assignment.id}, &lt;br /&gt;
                                                                                                       :onclick =&amp;gt; &amp;quot;showLoadIcon()&amp;quot;%&amp;gt;&lt;br /&gt;
   &amp;lt;img id=&amp;quot;load_icon&amp;quot; src=&amp;quot;&amp;lt;%= image_url('ajax-loader.gif') %&amp;gt;&amp;quot; style=&amp;quot;display:none&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controller Modification ====&lt;br /&gt;
We added a function in expertiza\app\controllers\use_github_metrics_controller.rb as follwowing.&lt;br /&gt;
&lt;br /&gt;
===== Self Functions =====&lt;br /&gt;
&lt;br /&gt;
1. Check if assignment_id exists in the table use_github_metrics. If so, return TRUE.&lt;br /&gt;
 #check if assignment_id exists in the table use_github_metrics&lt;br /&gt;
  def self.exist(assignment_id)&lt;br /&gt;
    use_github = UseGithubMetric.find_by(assignment_id: assignment_id)&lt;br /&gt;
    !use_github.nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. If assignment_id does not exist in the table use_github_metrics, save it.&lt;br /&gt;
  #if assignment_id does not exist in the table use_github_metrics, save it&lt;br /&gt;
  def self.save(assignment_id)&lt;br /&gt;
    unless exist(assignment_id)&lt;br /&gt;
      use_github = UseGithubMetric.new(assignment_id)&lt;br /&gt;
      use_github.assignment_id = assignment_id&lt;br /&gt;
      use_github.save&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3. If assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  #if assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  def self.delete(assignment_id)&lt;br /&gt;
    if exist(assignment_id)&lt;br /&gt;
      use_github = UseGithubMetric.find_by(assignment_id: assignment_id)&lt;br /&gt;
      use_github.destroy&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
===== Not Self Functions =====&lt;br /&gt;
&lt;br /&gt;
1. Return TRUE if the assignment id exists. &lt;br /&gt;
  #check if assignment_id exists in the table use_github_metrics&lt;br /&gt;
  def exist&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.exist(assignment_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. Save assignment is if it doesn't exist. This function is for the frontend page to select the checkbox.&lt;br /&gt;
  #if assignment_id does not exist in the table use_github_metrics, save it&lt;br /&gt;
  def save&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.save(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3. Delete assignment id if it exists. This function is for the frontend page to cancel the checkbox.&lt;br /&gt;
  #if assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  def delete&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.delete(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
An instructor can customize an assignment in this view. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:Before liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they choose Github metrics in the previous assignment edit page and is not authenticated to Github yet. The Login link redirects to an omniauth login page, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors if they don't choose the &amp;quot;use GitHub metric&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
This UML shows the new classes and models we created and implemented in our final project. Besides these, we also modified some of the existing classes and methods, we will give more detailed information later.&lt;br /&gt;
&lt;br /&gt;
[[File:E2149_Uml_1.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==OminiAuth Github API update==&lt;br /&gt;
GitHub no longer supports authentication through query parameters. Thus, we move the authentication to the header.&lt;br /&gt;
From September 8, 2021, using access_token as a query parameter to access the API (as a user or as a GitHub App) and using client_id/client_secret to make OAuth app unauthenticated are disabled. &lt;br /&gt;
&lt;br /&gt;
===Using access_token as a query param===&lt;br /&gt;
Originally, the code uses the API with parameters。&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?access_token=my_access_token&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now, we send the token in the header:&lt;br /&gt;
 curl -H 'Authorization: token my_access_token' https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
===Using client_id/client_secret as a query param===&lt;br /&gt;
Originally, the code uses an OAuth app's client_id and client_secret to make unauthenticated calls with a higher rate limit similar to&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?client_id=my_client_id&amp;amp;client_secret=my_secret_id&amp;quot;&lt;br /&gt;
Instead, we use the following format:&lt;br /&gt;
 curl -u my_client_id:my_client_secret https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Oauth Configuration&lt;br /&gt;
&lt;br /&gt;
[[File:github-oauth.png|750px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  def oauth_login&lt;br /&gt;
    case params[:provider]&lt;br /&gt;
    when &amp;quot;github&amp;quot;&lt;br /&gt;
      github_login&lt;br /&gt;
    when &amp;quot;google_oauth2&amp;quot;&lt;br /&gt;
      google_login&lt;br /&gt;
    when &amp;quot;github2021&amp;quot; # due to github 0&lt;br /&gt;
      custom_github_login&lt;br /&gt;
    else&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, user.name, &amp;quot;Invalid OAuth Provider&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After requesting the user's GitHub identity,  the user will be redirected back to Expertiza by GitHub. If the user accepts the request, GitHub redirects back to expertiza with a temporary code in a code parameter and the state provided in the previous step in a state parameter. The client_id and client_secret are required as they received from GitHub for Expertiza. The code is also required as it would be a response to the request. Then the access token allows Expertiza to make requests to the API on a behalf of a user.&lt;br /&gt;
&lt;br /&gt;
  def custom_github_login&lt;br /&gt;
    session_code = request.env['rack.request.query_hash']['code']&lt;br /&gt;
    result = RestClient.post('https://github.com/login/oauth/access_token',&lt;br /&gt;
                               {:client_id =&amp;gt; GITHUB_CONFIG['client_key'],&lt;br /&gt;
                                :client_secret =&amp;gt; GITHUB_CONFIG['client_secret'],&lt;br /&gt;
                                :code =&amp;gt; session_code},&lt;br /&gt;
                                :accept =&amp;gt; :json)&lt;br /&gt;
    access_token = JSON.parse(result)['access_token']&lt;br /&gt;
    session[&amp;quot;github_access_token&amp;quot;] = access_token&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'list_submissions', id: session[&amp;quot;assignment_id&amp;quot;]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down option for Github metric on the page&lt;br /&gt;
:4. Process the page without choosing Github metrics report  for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
Detailed of Github Testing&lt;br /&gt;
&lt;br /&gt;
After changing the way of calling the GitHub API, we need to test whether we can get the data from the GitHub API correctly.&lt;br /&gt;
&lt;br /&gt;
 describe '#gets data from GitHub api v4(graphql)' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_github_repository_details' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_statuses_for_pull_request' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
=====Previous Project References=====&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=142560</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=142560"/>
		<updated>2021-11-30T22:29:53Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* OminiAuth Github API update */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The functionality of the showing GitHub metrics cannot be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment. The project doesn't report lines added and deleted because of the lack of support from the current API. It adds quite a lot of lines of code for a single project and some codes could be refactored. The test plans of the current project are not described thoroughly enough. We will modify the existing RSpec test code and add some new tests.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have found numerous action items so far. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves&amp;quot; or features that are either left out of the original project or will make the integration display more integrated.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Turn on.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the GitHub report of the assignment is turned on or turned off, we need to create a new table named &amp;quot;use_github_metric&amp;quot; to save the id of the assignment whose GitHub metric is turned on. We also have an alternative solution to add a boolean field in the assignment table, but due to security concerns, we give it up. We think we should not change the data of the assignment.&lt;br /&gt;
&lt;br /&gt;
'''Table: use_github_metric'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|- style=&amp;quot;font-weight:bold;&amp;quot;&lt;br /&gt;
! id(PK)&lt;br /&gt;
! Assignment_id(FK)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 15&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Simplify the Codes ====&lt;br /&gt;
Extract the repeating part of codes and then construct an independent method based on them. Finally, we could use this method. &lt;br /&gt;
&lt;br /&gt;
The last edition uses the lots of Google API to help generate the chart, we can use the method from helper to generate charts instead.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chooses not to include the GitHub metric in the assignment (the functionality is turned off), the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed on the frontend page.&lt;br /&gt;
&lt;br /&gt;
1. We edited expertiza\app\views\assignments\edit\_general.html.erb and added a checkbox. The codes are as follow.&lt;br /&gt;
If the id of the assignment exists, there will be a checkbox for the user to use github metrics.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--Github--&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_use_github' colspan=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;checkbox&amp;quot; name = &amp;quot;use_github&amp;quot; id=&amp;quot;use_github&amp;quot; &amp;lt;%= &amp;quot;checked&amp;quot; &lt;br /&gt;
             if UseGithubMetricsController.exist(@assignment_form.assignment.id) %&amp;gt;&amp;gt;&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('use_github', 'Use github metrics?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The expertiza\app\views\assignments\list_submissions.html.erb is edited too. &lt;br /&gt;
If the id of the assignment exists and github_access_token is null (it means that the user hasn't logged in), then the page will show 'Login to Query Github data' button. If github_access_token is not null, it would show 'Refresh Github data' button because the user has logged in.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%if UseGithubMetricsController.exist(@assignment.id) %&amp;gt;&lt;br /&gt;
 &amp;lt;% if session[&amp;quot;github_access_token&amp;quot;].nil? %&amp;gt;&lt;br /&gt;
   &amp;lt;% topic_identifier, topic_name, users_for_curr_team, participants = get_data_for_list_submissions(@teams.first) %&amp;gt;&lt;br /&gt;
   &amp;lt;%= link_to 'Login to Query Github data', { controller: 'metrics', action: 'show', id: participants.first.id } %&amp;gt;&lt;br /&gt;
   &amp;lt;% else %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Refresh Github data', { controller: 'metrics', action: 'query_assignment_statistics', id: @assignment.id}, &lt;br /&gt;
                                                                                                       :onclick =&amp;gt; &amp;quot;showLoadIcon()&amp;quot;%&amp;gt;&lt;br /&gt;
   &amp;lt;img id=&amp;quot;load_icon&amp;quot; src=&amp;quot;&amp;lt;%= image_url('ajax-loader.gif') %&amp;gt;&amp;quot; style=&amp;quot;display:none&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controller Modification ====&lt;br /&gt;
We added a function in expertiza\app\controllers\use_github_metrics_controller.rb as follwowing.&lt;br /&gt;
&lt;br /&gt;
===== Self Functions =====&lt;br /&gt;
&lt;br /&gt;
1. Check if assignment_id exists in the table use_github_metrics. If so, return TRUE.&lt;br /&gt;
 #check if assignment_id exists in the table use_github_metrics&lt;br /&gt;
  def self.exist(assignment_id)&lt;br /&gt;
    use_github = UseGithubMetric.find_by(assignment_id: assignment_id)&lt;br /&gt;
    !use_github.nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. If assignment_id does not exist in the table use_github_metrics, save it.&lt;br /&gt;
  #if assignment_id does not exist in the table use_github_metrics, save it&lt;br /&gt;
  def self.save(assignment_id)&lt;br /&gt;
    unless exist(assignment_id)&lt;br /&gt;
      use_github = UseGithubMetric.new(assignment_id)&lt;br /&gt;
      use_github.assignment_id = assignment_id&lt;br /&gt;
      use_github.save&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3. If assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  #if assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  def self.delete(assignment_id)&lt;br /&gt;
    if exist(assignment_id)&lt;br /&gt;
      use_github = UseGithubMetric.find_by(assignment_id: assignment_id)&lt;br /&gt;
      use_github.destroy&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
===== Not Self Functions =====&lt;br /&gt;
&lt;br /&gt;
1. Return TRUE if the assignment id exists. &lt;br /&gt;
  #check if assignment_id exists in the table use_github_metrics&lt;br /&gt;
  def exist&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.exist(assignment_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. Save assignment is if it doesn't exist. This function is for the frontend page to select the checkbox.&lt;br /&gt;
  #if assignment_id does not exist in the table use_github_metrics, save it&lt;br /&gt;
  def save&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.save(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3. Delete assignment id if it exists. This function is for the frontend page to cancel the checkbox.&lt;br /&gt;
  #if assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  def delete&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.delete(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
An instructor can customize an assignment in this view. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:Before liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they choose Github metrics in the previous assignment edit page and is not authenticated to Github yet. The Login link redirects to an omniauth login page, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors if they don't choose the &amp;quot;use GitHub metric&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
This UML shows the new classes and models we created and implemented in our final project. Besides these, we also modified some of the existing classes and methods, we will give more detailed information later.&lt;br /&gt;
&lt;br /&gt;
[[File:E2149_Uml_1.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==OminiAuth Github API update==&lt;br /&gt;
GitHub no longer supports authentication through query parameters. Thus, we move the authentication to the header.&lt;br /&gt;
From September 8, 2021, using access_token as a query parameter to access the API (as a user or as a GitHub App) and using client_id/client_secret to make OAuth app unauthenticated are disabled. &lt;br /&gt;
&lt;br /&gt;
===Using access_token as a query param===&lt;br /&gt;
Originally, the code uses the API with parameters。&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?access_token=my_access_token&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now, we send the token in the header:&lt;br /&gt;
 curl -H 'Authorization: token my_access_token' https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
===Using client_id/client_secret as a query param===&lt;br /&gt;
Originally, the code uses an OAuth app's client_id and client_secret to make unauthenticated calls with a higher rate limit similar to&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?client_id=my_client_id&amp;amp;client_secret=my_secret_id&amp;quot;&lt;br /&gt;
Instead, we use the following format:&lt;br /&gt;
 curl -u my_client_id:my_client_secret https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Oauth Configuration&lt;br /&gt;
&lt;br /&gt;
[[File:github-oauth.png|750px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  def oauth_login&lt;br /&gt;
    case params[:provider]&lt;br /&gt;
    when &amp;quot;github&amp;quot;&lt;br /&gt;
      github_login&lt;br /&gt;
    when &amp;quot;google_oauth2&amp;quot;&lt;br /&gt;
      google_login&lt;br /&gt;
    when &amp;quot;github2021&amp;quot; # due to github 0&lt;br /&gt;
      custom_github_login&lt;br /&gt;
    else&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, user.name, &amp;quot;Invalid OAuth Provider&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After requesting the user's GitHub identity,  the user will be redirected back to Expertiza by GitHub. If the user accepts the request, GitHub redirects back to expertiza with a temporary code in a code parameter and the state provided in the previous step in a state parameter. The client_id and client_secret are required as they received from GitHub for Expertiza. The code is also required as it would be a response to the request.&lt;br /&gt;
&lt;br /&gt;
  def custom_github_login&lt;br /&gt;
    session_code = request.env['rack.request.query_hash']['code']&lt;br /&gt;
    result = RestClient.post('https://github.com/login/oauth/access_token',&lt;br /&gt;
                               {:client_id =&amp;gt; GITHUB_CONFIG['client_key'],&lt;br /&gt;
                                :client_secret =&amp;gt; GITHUB_CONFIG['client_secret'],&lt;br /&gt;
                                :code =&amp;gt; session_code},&lt;br /&gt;
                                :accept =&amp;gt; :json)&lt;br /&gt;
    access_token = JSON.parse(result)['access_token']&lt;br /&gt;
    session[&amp;quot;github_access_token&amp;quot;] = access_token&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'list_submissions', id: session[&amp;quot;assignment_id&amp;quot;]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down option for Github metric on the page&lt;br /&gt;
:4. Process the page without choosing Github metrics report  for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
Detailed of Github Testing&lt;br /&gt;
&lt;br /&gt;
After changing the way of calling the GitHub API, we need to test whether we can get the data from the GitHub API correctly.&lt;br /&gt;
&lt;br /&gt;
 describe '#gets data from GitHub api v4(graphql)' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_github_repository_details' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_statuses_for_pull_request' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
=====Previous Project References=====&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=142553</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=142553"/>
		<updated>2021-11-30T22:25:34Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* OminiAuth Github API update */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The functionality of the showing GitHub metrics cannot be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment. The project doesn't report lines added and deleted because of the lack of support from the current API. It adds quite a lot of lines of code for a single project and some codes could be refactored. The test plans of the current project are not described thoroughly enough. We will modify the existing RSpec test code and add some new tests.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have found numerous action items so far. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves&amp;quot; or features that are either left out of the original project or will make the integration display more integrated.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Turn on.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the GitHub report of the assignment is turned on or turned off, we need to create a new table named &amp;quot;use_github_metric&amp;quot; to save the id of the assignment whose GitHub metric is turned on. We also have an alternative solution to add a boolean field in the assignment table, but due to security concerns, we give it up. We think we should not change the data of the assignment.&lt;br /&gt;
&lt;br /&gt;
'''Table: use_github_metric'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|- style=&amp;quot;font-weight:bold;&amp;quot;&lt;br /&gt;
! id(PK)&lt;br /&gt;
! Assignment_id(FK)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 15&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Simplify the Codes ====&lt;br /&gt;
Extract the repeating part of codes and then construct an independent method based on them. Finally, we could use this method. &lt;br /&gt;
&lt;br /&gt;
The last edition uses the lots of Google API to help generate the chart, we can use the method from helper to generate charts instead.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chooses not to include the GitHub metric in the assignment (the functionality is turned off), the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed on the frontend page.&lt;br /&gt;
&lt;br /&gt;
1. We edited expertiza\app\views\assignments\edit\_general.html.erb and added a checkbox. The codes are as follow.&lt;br /&gt;
If the id of the assignment exists, there will be a checkbox for the user to use github metrics.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--Github--&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_use_github' colspan=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;checkbox&amp;quot; name = &amp;quot;use_github&amp;quot; id=&amp;quot;use_github&amp;quot; &amp;lt;%= &amp;quot;checked&amp;quot; &lt;br /&gt;
             if UseGithubMetricsController.exist(@assignment_form.assignment.id) %&amp;gt;&amp;gt;&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('use_github', 'Use github metrics?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The expertiza\app\views\assignments\list_submissions.html.erb is edited too. &lt;br /&gt;
If the id of the assignment exists and github_access_token is null (it means that the user hasn't logged in), then the page will show 'Login to Query Github data' button. If github_access_token is not null, it would show 'Refresh Github data' button because the user has logged in.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%if UseGithubMetricsController.exist(@assignment.id) %&amp;gt;&lt;br /&gt;
 &amp;lt;% if session[&amp;quot;github_access_token&amp;quot;].nil? %&amp;gt;&lt;br /&gt;
   &amp;lt;% topic_identifier, topic_name, users_for_curr_team, participants = get_data_for_list_submissions(@teams.first) %&amp;gt;&lt;br /&gt;
   &amp;lt;%= link_to 'Login to Query Github data', { controller: 'metrics', action: 'show', id: participants.first.id } %&amp;gt;&lt;br /&gt;
   &amp;lt;% else %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Refresh Github data', { controller: 'metrics', action: 'query_assignment_statistics', id: @assignment.id}, &lt;br /&gt;
                                                                                                       :onclick =&amp;gt; &amp;quot;showLoadIcon()&amp;quot;%&amp;gt;&lt;br /&gt;
   &amp;lt;img id=&amp;quot;load_icon&amp;quot; src=&amp;quot;&amp;lt;%= image_url('ajax-loader.gif') %&amp;gt;&amp;quot; style=&amp;quot;display:none&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controller Modification ====&lt;br /&gt;
We added a function in expertiza\app\controllers\use_github_metrics_controller.rb as follwowing.&lt;br /&gt;
&lt;br /&gt;
===== Self Functions =====&lt;br /&gt;
&lt;br /&gt;
1. Check if assignment_id exists in the table use_github_metrics. If so, return TRUE.&lt;br /&gt;
 #check if assignment_id exists in the table use_github_metrics&lt;br /&gt;
  def self.exist(assignment_id)&lt;br /&gt;
    use_github = UseGithubMetric.find_by(assignment_id: assignment_id)&lt;br /&gt;
    !use_github.nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. If assignment_id does not exist in the table use_github_metrics, save it.&lt;br /&gt;
  #if assignment_id does not exist in the table use_github_metrics, save it&lt;br /&gt;
  def self.save(assignment_id)&lt;br /&gt;
    unless exist(assignment_id)&lt;br /&gt;
      use_github = UseGithubMetric.new(assignment_id)&lt;br /&gt;
      use_github.assignment_id = assignment_id&lt;br /&gt;
      use_github.save&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3. If assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  #if assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  def self.delete(assignment_id)&lt;br /&gt;
    if exist(assignment_id)&lt;br /&gt;
      use_github = UseGithubMetric.find_by(assignment_id: assignment_id)&lt;br /&gt;
      use_github.destroy&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
===== Not Self Functions =====&lt;br /&gt;
&lt;br /&gt;
1. Return TRUE if the assignment id exists. &lt;br /&gt;
  #check if assignment_id exists in the table use_github_metrics&lt;br /&gt;
  def exist&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.exist(assignment_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. Save assignment is if it doesn't exist. This function is for the frontend page to select the checkbox.&lt;br /&gt;
  #if assignment_id does not exist in the table use_github_metrics, save it&lt;br /&gt;
  def save&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.save(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3. Delete assignment id if it exists. This function is for the frontend page to cancel the checkbox.&lt;br /&gt;
  #if assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  def delete&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.delete(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
An instructor can customize an assignment in this view. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:Before liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they choose Github metrics in the previous assignment edit page and is not authenticated to Github yet. The Login link redirects to an omniauth login page, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors if they don't choose the &amp;quot;use GitHub metric&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
This UML shows the new classes and models we created and implemented in our final project. Besides these, we also modified some of the existing classes and methods, we will give more detailed information later.&lt;br /&gt;
&lt;br /&gt;
[[File:E2149_Uml_1.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==OminiAuth Github API update==&lt;br /&gt;
GitHub no longer supports authentication through query parameters. Thus, we move the authentication to the header.&lt;br /&gt;
From September 8, 2021, using access_token as a query parameter to access the API (as a user or as a GitHub App) and using client_id/client_secret to make OAuth app unauthenticated are disabled. &lt;br /&gt;
&lt;br /&gt;
===Using access_token as a query param===&lt;br /&gt;
Originally, the code uses the API with parameters。&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?access_token=my_access_token&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now, we send the token in the header:&lt;br /&gt;
 curl -H 'Authorization: token my_access_token' https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
===Using client_id/client_secret as a query param===&lt;br /&gt;
Originally, the code uses an OAuth app's client_id and client_secret to make unauthenticated calls with a higher rate limit similar to&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?client_id=my_client_id&amp;amp;client_secret=my_secret_id&amp;quot;&lt;br /&gt;
Instead, we use the following format:&lt;br /&gt;
 curl -u my_client_id:my_client_secret https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
After requesting the user's GitHub identity,  the user will be redirected back to Expertiza by GitHub. If the user accepts the request, GitHub redirects back to expertiza with a temporary code in a code parameter and the state provided in the previous step in a state parameter. &lt;br /&gt;
&lt;br /&gt;
Oauth Configuration&lt;br /&gt;
&lt;br /&gt;
[[File:github-oauth.png|750px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  def oauth_login&lt;br /&gt;
    case params[:provider]&lt;br /&gt;
    when &amp;quot;github&amp;quot;&lt;br /&gt;
      github_login&lt;br /&gt;
    when &amp;quot;google_oauth2&amp;quot;&lt;br /&gt;
      google_login&lt;br /&gt;
    when &amp;quot;github2021&amp;quot; # due to github 0&lt;br /&gt;
      custom_github_login&lt;br /&gt;
    else&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, user.name, &amp;quot;Invalid OAuth Provider&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  def custom_github_login&lt;br /&gt;
    session_code = request.env['rack.request.query_hash']['code']&lt;br /&gt;
    result = RestClient.post('https://github.com/login/oauth/access_token',&lt;br /&gt;
                               {:client_id =&amp;gt; GITHUB_CONFIG['client_key'],&lt;br /&gt;
                                :client_secret =&amp;gt; GITHUB_CONFIG['client_secret'],&lt;br /&gt;
                                :code =&amp;gt; session_code},&lt;br /&gt;
                                :accept =&amp;gt; :json)&lt;br /&gt;
    access_token = JSON.parse(result)['access_token']&lt;br /&gt;
    session[&amp;quot;github_access_token&amp;quot;] = access_token&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'list_submissions', id: session[&amp;quot;assignment_id&amp;quot;]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down option for Github metric on the page&lt;br /&gt;
:4. Process the page without choosing Github metrics report  for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
Detailed of Github Testing&lt;br /&gt;
&lt;br /&gt;
After changing the way of calling the GitHub API, we need to test whether we can get the data from the GitHub API correctly.&lt;br /&gt;
&lt;br /&gt;
 describe '#gets data from GitHub api v4(graphql)' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_github_repository_details' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_statuses_for_pull_request' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
=====Previous Project References=====&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=142550</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=142550"/>
		<updated>2021-11-30T22:19:18Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* OminiAuth Github API update */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The functionality of the showing GitHub metrics cannot be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment. The project doesn't report lines added and deleted because of the lack of support from the current API. It adds quite a lot of lines of code for a single project and some codes could be refactored. The test plans of the current project are not described thoroughly enough. We will modify the existing RSpec test code and add some new tests.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have found numerous action items so far. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves&amp;quot; or features that are either left out of the original project or will make the integration display more integrated.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Turn on.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the GitHub report of the assignment is turned on or turned off, we need to create a new table named &amp;quot;use_github_metric&amp;quot; to save the id of the assignment whose GitHub metric is turned on. We also have an alternative solution to add a boolean field in the assignment table, but due to security concerns, we give it up. We think we should not change the data of the assignment.&lt;br /&gt;
&lt;br /&gt;
'''Table: use_github_metric'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|- style=&amp;quot;font-weight:bold;&amp;quot;&lt;br /&gt;
! id(PK)&lt;br /&gt;
! Assignment_id(FK)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 15&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Simplify the Codes ====&lt;br /&gt;
Extract the repeating part of codes and then construct an independent method based on them. Finally, we could use this method. &lt;br /&gt;
&lt;br /&gt;
The last edition uses the lots of Google API to help generate the chart, we can use the method from helper to generate charts instead.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chooses not to include the GitHub metric in the assignment (the functionality is turned off), the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed on the frontend page.&lt;br /&gt;
&lt;br /&gt;
1. We edited expertiza\app\views\assignments\edit\_general.html.erb and added a checkbox. The codes are as follow.&lt;br /&gt;
If the id of the assignment exists, there will be a checkbox for the user to use github metrics.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--Github--&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_use_github' colspan=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;checkbox&amp;quot; name = &amp;quot;use_github&amp;quot; id=&amp;quot;use_github&amp;quot; &amp;lt;%= &amp;quot;checked&amp;quot; &lt;br /&gt;
             if UseGithubMetricsController.exist(@assignment_form.assignment.id) %&amp;gt;&amp;gt;&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('use_github', 'Use github metrics?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The expertiza\app\views\assignments\list_submissions.html.erb is edited too. &lt;br /&gt;
If the id of the assignment exists and github_access_token is null (it means that the user hasn't logged in), then the page will show 'Login to Query Github data' button. If github_access_token is not null, it would show 'Refresh Github data' button because the user has logged in.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%if UseGithubMetricsController.exist(@assignment.id) %&amp;gt;&lt;br /&gt;
 &amp;lt;% if session[&amp;quot;github_access_token&amp;quot;].nil? %&amp;gt;&lt;br /&gt;
   &amp;lt;% topic_identifier, topic_name, users_for_curr_team, participants = get_data_for_list_submissions(@teams.first) %&amp;gt;&lt;br /&gt;
   &amp;lt;%= link_to 'Login to Query Github data', { controller: 'metrics', action: 'show', id: participants.first.id } %&amp;gt;&lt;br /&gt;
   &amp;lt;% else %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Refresh Github data', { controller: 'metrics', action: 'query_assignment_statistics', id: @assignment.id}, &lt;br /&gt;
                                                                                                       :onclick =&amp;gt; &amp;quot;showLoadIcon()&amp;quot;%&amp;gt;&lt;br /&gt;
   &amp;lt;img id=&amp;quot;load_icon&amp;quot; src=&amp;quot;&amp;lt;%= image_url('ajax-loader.gif') %&amp;gt;&amp;quot; style=&amp;quot;display:none&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controller Modification ====&lt;br /&gt;
We added a function in expertiza\app\controllers\use_github_metrics_controller.rb as follwowing.&lt;br /&gt;
&lt;br /&gt;
===== Self Functions =====&lt;br /&gt;
&lt;br /&gt;
1. Check if assignment_id exists in the table use_github_metrics. If so, return TRUE.&lt;br /&gt;
 #check if assignment_id exists in the table use_github_metrics&lt;br /&gt;
  def self.exist(assignment_id)&lt;br /&gt;
    use_github = UseGithubMetric.find_by(assignment_id: assignment_id)&lt;br /&gt;
    !use_github.nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. If assignment_id does not exist in the table use_github_metrics, save it.&lt;br /&gt;
  #if assignment_id does not exist in the table use_github_metrics, save it&lt;br /&gt;
  def self.save(assignment_id)&lt;br /&gt;
    unless exist(assignment_id)&lt;br /&gt;
      use_github = UseGithubMetric.new(assignment_id)&lt;br /&gt;
      use_github.assignment_id = assignment_id&lt;br /&gt;
      use_github.save&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3. If assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  #if assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  def self.delete(assignment_id)&lt;br /&gt;
    if exist(assignment_id)&lt;br /&gt;
      use_github = UseGithubMetric.find_by(assignment_id: assignment_id)&lt;br /&gt;
      use_github.destroy&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
===== Not Self Functions =====&lt;br /&gt;
&lt;br /&gt;
1. Return TRUE if the assignment id exists. &lt;br /&gt;
  #check if assignment_id exists in the table use_github_metrics&lt;br /&gt;
  def exist&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.exist(assignment_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. Save assignment is if it doesn't exist. This function is for the frontend page to select the checkbox.&lt;br /&gt;
  #if assignment_id does not exist in the table use_github_metrics, save it&lt;br /&gt;
  def save&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.save(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3. Delete assignment id if it exists. This function is for the frontend page to cancel the checkbox.&lt;br /&gt;
  #if assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  def delete&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.delete(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
An instructor can customize an assignment in this view. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:Before liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they choose Github metrics in the previous assignment edit page and is not authenticated to Github yet. The Login link redirects to an omniauth login page, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors if they don't choose the &amp;quot;use GitHub metric&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
This UML shows the new classes and models we created and implemented in our final project. Besides these, we also modified some of the existing classes and methods, we will give more detailed information later.&lt;br /&gt;
&lt;br /&gt;
[[File:E2149_Uml_1.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==OminiAuth Github API update==&lt;br /&gt;
GitHub no longer supports authentication through query parameters. Thus, we move the authentication to the header.&lt;br /&gt;
From September 8, 2021, using access_token as a query parameter to access the API (as a user or as a GitHub App) and using client_id/client_secret to make OAuth app unauthenticated are disabled. &lt;br /&gt;
&lt;br /&gt;
===Using access_token as a query param===&lt;br /&gt;
Originally, the code uses the API with parameters。&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?access_token=my_access_token&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now, we send the token in the header:&lt;br /&gt;
 curl -H 'Authorization: token my_access_token' https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
===Using client_id/client_secret as a query param===&lt;br /&gt;
Originally, the code uses an OAuth app's client_id and client_secret to make unauthenticated calls with a higher rate limit similar to&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?client_id=my_client_id&amp;amp;client_secret=my_secret_id&amp;quot;&lt;br /&gt;
Instead, we use the following format:&lt;br /&gt;
 curl -u my_client_id:my_client_secret https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
Oauth Configuration&lt;br /&gt;
&lt;br /&gt;
[[File:github-oauth.png|750px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  def oauth_login&lt;br /&gt;
    case params[:provider]&lt;br /&gt;
    when &amp;quot;github&amp;quot;&lt;br /&gt;
      github_login&lt;br /&gt;
    when &amp;quot;google_oauth2&amp;quot;&lt;br /&gt;
      google_login&lt;br /&gt;
    when &amp;quot;github2021&amp;quot; # due to github 0&lt;br /&gt;
      custom_github_login&lt;br /&gt;
    else&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, user.name, &amp;quot;Invalid OAuth Provider&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  def custom_github_login&lt;br /&gt;
    session_code = request.env['rack.request.query_hash']['code']&lt;br /&gt;
    result = RestClient.post('https://github.com/login/oauth/access_token',&lt;br /&gt;
                               {:client_id =&amp;gt; GITHUB_CONFIG['client_key'],&lt;br /&gt;
                                :client_secret =&amp;gt; GITHUB_CONFIG['client_secret'],&lt;br /&gt;
                                :code =&amp;gt; session_code},&lt;br /&gt;
                                :accept =&amp;gt; :json)&lt;br /&gt;
    access_token = JSON.parse(result)['access_token']&lt;br /&gt;
    session[&amp;quot;github_access_token&amp;quot;] = access_token&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'list_submissions', id: session[&amp;quot;assignment_id&amp;quot;]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down option for Github metric on the page&lt;br /&gt;
:4. Process the page without choosing Github metrics report  for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
Detailed of Github Testing&lt;br /&gt;
&lt;br /&gt;
After changing the way of calling the GitHub API, we need to test whether we can get the data from the GitHub API correctly.&lt;br /&gt;
&lt;br /&gt;
 describe '#gets data from GitHub api v4(graphql)' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_github_repository_details' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_statuses_for_pull_request' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
=====Previous Project References=====&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=142549</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=142549"/>
		<updated>2021-11-30T22:19:05Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* Using client_id/client_secret as a query param */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The functionality of the showing GitHub metrics cannot be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment. The project doesn't report lines added and deleted because of the lack of support from the current API. It adds quite a lot of lines of code for a single project and some codes could be refactored. The test plans of the current project are not described thoroughly enough. We will modify the existing RSpec test code and add some new tests.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have found numerous action items so far. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves&amp;quot; or features that are either left out of the original project or will make the integration display more integrated.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Turn on.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the GitHub report of the assignment is turned on or turned off, we need to create a new table named &amp;quot;use_github_metric&amp;quot; to save the id of the assignment whose GitHub metric is turned on. We also have an alternative solution to add a boolean field in the assignment table, but due to security concerns, we give it up. We think we should not change the data of the assignment.&lt;br /&gt;
&lt;br /&gt;
'''Table: use_github_metric'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|- style=&amp;quot;font-weight:bold;&amp;quot;&lt;br /&gt;
! id(PK)&lt;br /&gt;
! Assignment_id(FK)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 15&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Simplify the Codes ====&lt;br /&gt;
Extract the repeating part of codes and then construct an independent method based on them. Finally, we could use this method. &lt;br /&gt;
&lt;br /&gt;
The last edition uses the lots of Google API to help generate the chart, we can use the method from helper to generate charts instead.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chooses not to include the GitHub metric in the assignment (the functionality is turned off), the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed on the frontend page.&lt;br /&gt;
&lt;br /&gt;
1. We edited expertiza\app\views\assignments\edit\_general.html.erb and added a checkbox. The codes are as follow.&lt;br /&gt;
If the id of the assignment exists, there will be a checkbox for the user to use github metrics.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--Github--&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_use_github' colspan=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;checkbox&amp;quot; name = &amp;quot;use_github&amp;quot; id=&amp;quot;use_github&amp;quot; &amp;lt;%= &amp;quot;checked&amp;quot; &lt;br /&gt;
             if UseGithubMetricsController.exist(@assignment_form.assignment.id) %&amp;gt;&amp;gt;&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('use_github', 'Use github metrics?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The expertiza\app\views\assignments\list_submissions.html.erb is edited too. &lt;br /&gt;
If the id of the assignment exists and github_access_token is null (it means that the user hasn't logged in), then the page will show 'Login to Query Github data' button. If github_access_token is not null, it would show 'Refresh Github data' button because the user has logged in.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%if UseGithubMetricsController.exist(@assignment.id) %&amp;gt;&lt;br /&gt;
 &amp;lt;% if session[&amp;quot;github_access_token&amp;quot;].nil? %&amp;gt;&lt;br /&gt;
   &amp;lt;% topic_identifier, topic_name, users_for_curr_team, participants = get_data_for_list_submissions(@teams.first) %&amp;gt;&lt;br /&gt;
   &amp;lt;%= link_to 'Login to Query Github data', { controller: 'metrics', action: 'show', id: participants.first.id } %&amp;gt;&lt;br /&gt;
   &amp;lt;% else %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Refresh Github data', { controller: 'metrics', action: 'query_assignment_statistics', id: @assignment.id}, &lt;br /&gt;
                                                                                                       :onclick =&amp;gt; &amp;quot;showLoadIcon()&amp;quot;%&amp;gt;&lt;br /&gt;
   &amp;lt;img id=&amp;quot;load_icon&amp;quot; src=&amp;quot;&amp;lt;%= image_url('ajax-loader.gif') %&amp;gt;&amp;quot; style=&amp;quot;display:none&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controller Modification ====&lt;br /&gt;
We added a function in expertiza\app\controllers\use_github_metrics_controller.rb as follwowing.&lt;br /&gt;
&lt;br /&gt;
===== Self Functions =====&lt;br /&gt;
&lt;br /&gt;
1. Check if assignment_id exists in the table use_github_metrics. If so, return TRUE.&lt;br /&gt;
 #check if assignment_id exists in the table use_github_metrics&lt;br /&gt;
  def self.exist(assignment_id)&lt;br /&gt;
    use_github = UseGithubMetric.find_by(assignment_id: assignment_id)&lt;br /&gt;
    !use_github.nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. If assignment_id does not exist in the table use_github_metrics, save it.&lt;br /&gt;
  #if assignment_id does not exist in the table use_github_metrics, save it&lt;br /&gt;
  def self.save(assignment_id)&lt;br /&gt;
    unless exist(assignment_id)&lt;br /&gt;
      use_github = UseGithubMetric.new(assignment_id)&lt;br /&gt;
      use_github.assignment_id = assignment_id&lt;br /&gt;
      use_github.save&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3. If assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  #if assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  def self.delete(assignment_id)&lt;br /&gt;
    if exist(assignment_id)&lt;br /&gt;
      use_github = UseGithubMetric.find_by(assignment_id: assignment_id)&lt;br /&gt;
      use_github.destroy&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
===== Not Self Functions =====&lt;br /&gt;
&lt;br /&gt;
1. Return TRUE if the assignment id exists. &lt;br /&gt;
  #check if assignment_id exists in the table use_github_metrics&lt;br /&gt;
  def exist&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.exist(assignment_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. Save assignment is if it doesn't exist. This function is for the frontend page to select the checkbox.&lt;br /&gt;
  #if assignment_id does not exist in the table use_github_metrics, save it&lt;br /&gt;
  def save&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.save(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3. Delete assignment id if it exists. This function is for the frontend page to cancel the checkbox.&lt;br /&gt;
  #if assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  def delete&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.delete(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
An instructor can customize an assignment in this view. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:Before liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they choose Github metrics in the previous assignment edit page and is not authenticated to Github yet. The Login link redirects to an omniauth login page, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors if they don't choose the &amp;quot;use GitHub metric&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
This UML shows the new classes and models we created and implemented in our final project. Besides these, we also modified some of the existing classes and methods, we will give more detailed information later.&lt;br /&gt;
&lt;br /&gt;
[[File:E2149_Uml_1.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==OminiAuth Github API update==&lt;br /&gt;
GitHub no longer supports authentication through query parameters. Thus, we move the authentication to the header.&lt;br /&gt;
From September 8, 2021, using access_token as a query parameter to access the API (as a user or as a GitHub App) and using client_id/client_secret to make OAuth app unauthenticated are disabled. &lt;br /&gt;
&lt;br /&gt;
===Using access_token as a query param===&lt;br /&gt;
Originally, the code uses the API with parameters。&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?access_token=my_access_token&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now, we send the token in the header:&lt;br /&gt;
 curl -H 'Authorization: token my_access_token' https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
===Using client_id/client_secret as a query param===&lt;br /&gt;
Originally, the code uses an OAuth app's client_id and client_secret to make unauthenticated calls with a higher rate limit similar to&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?client_id=my_client_id&amp;amp;client_secret=my_secret_id&amp;quot;&lt;br /&gt;
Instead, we use the following format:&lt;br /&gt;
 curl -u my_client_id:my_client_secret https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
Oauth Configuration&lt;br /&gt;
&lt;br /&gt;
[[File:github-oauth.png|7500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  def oauth_login&lt;br /&gt;
    case params[:provider]&lt;br /&gt;
    when &amp;quot;github&amp;quot;&lt;br /&gt;
      github_login&lt;br /&gt;
    when &amp;quot;google_oauth2&amp;quot;&lt;br /&gt;
      google_login&lt;br /&gt;
    when &amp;quot;github2021&amp;quot; # due to github 0&lt;br /&gt;
      custom_github_login&lt;br /&gt;
    else&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, user.name, &amp;quot;Invalid OAuth Provider&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  def custom_github_login&lt;br /&gt;
    session_code = request.env['rack.request.query_hash']['code']&lt;br /&gt;
    result = RestClient.post('https://github.com/login/oauth/access_token',&lt;br /&gt;
                               {:client_id =&amp;gt; GITHUB_CONFIG['client_key'],&lt;br /&gt;
                                :client_secret =&amp;gt; GITHUB_CONFIG['client_secret'],&lt;br /&gt;
                                :code =&amp;gt; session_code},&lt;br /&gt;
                                :accept =&amp;gt; :json)&lt;br /&gt;
    access_token = JSON.parse(result)['access_token']&lt;br /&gt;
    session[&amp;quot;github_access_token&amp;quot;] = access_token&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'list_submissions', id: session[&amp;quot;assignment_id&amp;quot;]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down option for Github metric on the page&lt;br /&gt;
:4. Process the page without choosing Github metrics report  for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
Detailed of Github Testing&lt;br /&gt;
&lt;br /&gt;
After changing the way of calling the GitHub API, we need to test whether we can get the data from the GitHub API correctly.&lt;br /&gt;
&lt;br /&gt;
 describe '#gets data from GitHub api v4(graphql)' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_github_repository_details' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_statuses_for_pull_request' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
=====Previous Project References=====&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=142548</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=142548"/>
		<updated>2021-11-30T22:18:18Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* OminiAuth Github API update */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The functionality of the showing GitHub metrics cannot be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment. The project doesn't report lines added and deleted because of the lack of support from the current API. It adds quite a lot of lines of code for a single project and some codes could be refactored. The test plans of the current project are not described thoroughly enough. We will modify the existing RSpec test code and add some new tests.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have found numerous action items so far. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves&amp;quot; or features that are either left out of the original project or will make the integration display more integrated.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Turn on.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the GitHub report of the assignment is turned on or turned off, we need to create a new table named &amp;quot;use_github_metric&amp;quot; to save the id of the assignment whose GitHub metric is turned on. We also have an alternative solution to add a boolean field in the assignment table, but due to security concerns, we give it up. We think we should not change the data of the assignment.&lt;br /&gt;
&lt;br /&gt;
'''Table: use_github_metric'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|- style=&amp;quot;font-weight:bold;&amp;quot;&lt;br /&gt;
! id(PK)&lt;br /&gt;
! Assignment_id(FK)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 15&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Simplify the Codes ====&lt;br /&gt;
Extract the repeating part of codes and then construct an independent method based on them. Finally, we could use this method. &lt;br /&gt;
&lt;br /&gt;
The last edition uses the lots of Google API to help generate the chart, we can use the method from helper to generate charts instead.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chooses not to include the GitHub metric in the assignment (the functionality is turned off), the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed on the frontend page.&lt;br /&gt;
&lt;br /&gt;
1. We edited expertiza\app\views\assignments\edit\_general.html.erb and added a checkbox. The codes are as follow.&lt;br /&gt;
If the id of the assignment exists, there will be a checkbox for the user to use github metrics.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--Github--&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_use_github' colspan=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;checkbox&amp;quot; name = &amp;quot;use_github&amp;quot; id=&amp;quot;use_github&amp;quot; &amp;lt;%= &amp;quot;checked&amp;quot; &lt;br /&gt;
             if UseGithubMetricsController.exist(@assignment_form.assignment.id) %&amp;gt;&amp;gt;&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('use_github', 'Use github metrics?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The expertiza\app\views\assignments\list_submissions.html.erb is edited too. &lt;br /&gt;
If the id of the assignment exists and github_access_token is null (it means that the user hasn't logged in), then the page will show 'Login to Query Github data' button. If github_access_token is not null, it would show 'Refresh Github data' button because the user has logged in.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%if UseGithubMetricsController.exist(@assignment.id) %&amp;gt;&lt;br /&gt;
 &amp;lt;% if session[&amp;quot;github_access_token&amp;quot;].nil? %&amp;gt;&lt;br /&gt;
   &amp;lt;% topic_identifier, topic_name, users_for_curr_team, participants = get_data_for_list_submissions(@teams.first) %&amp;gt;&lt;br /&gt;
   &amp;lt;%= link_to 'Login to Query Github data', { controller: 'metrics', action: 'show', id: participants.first.id } %&amp;gt;&lt;br /&gt;
   &amp;lt;% else %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Refresh Github data', { controller: 'metrics', action: 'query_assignment_statistics', id: @assignment.id}, &lt;br /&gt;
                                                                                                       :onclick =&amp;gt; &amp;quot;showLoadIcon()&amp;quot;%&amp;gt;&lt;br /&gt;
   &amp;lt;img id=&amp;quot;load_icon&amp;quot; src=&amp;quot;&amp;lt;%= image_url('ajax-loader.gif') %&amp;gt;&amp;quot; style=&amp;quot;display:none&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controller Modification ====&lt;br /&gt;
We added a function in expertiza\app\controllers\use_github_metrics_controller.rb as follwowing.&lt;br /&gt;
&lt;br /&gt;
===== Self Functions =====&lt;br /&gt;
&lt;br /&gt;
1. Check if assignment_id exists in the table use_github_metrics. If so, return TRUE.&lt;br /&gt;
 #check if assignment_id exists in the table use_github_metrics&lt;br /&gt;
  def self.exist(assignment_id)&lt;br /&gt;
    use_github = UseGithubMetric.find_by(assignment_id: assignment_id)&lt;br /&gt;
    !use_github.nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. If assignment_id does not exist in the table use_github_metrics, save it.&lt;br /&gt;
  #if assignment_id does not exist in the table use_github_metrics, save it&lt;br /&gt;
  def self.save(assignment_id)&lt;br /&gt;
    unless exist(assignment_id)&lt;br /&gt;
      use_github = UseGithubMetric.new(assignment_id)&lt;br /&gt;
      use_github.assignment_id = assignment_id&lt;br /&gt;
      use_github.save&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3. If assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  #if assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  def self.delete(assignment_id)&lt;br /&gt;
    if exist(assignment_id)&lt;br /&gt;
      use_github = UseGithubMetric.find_by(assignment_id: assignment_id)&lt;br /&gt;
      use_github.destroy&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
===== Not Self Functions =====&lt;br /&gt;
&lt;br /&gt;
1. Return TRUE if the assignment id exists. &lt;br /&gt;
  #check if assignment_id exists in the table use_github_metrics&lt;br /&gt;
  def exist&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.exist(assignment_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. Save assignment is if it doesn't exist. This function is for the frontend page to select the checkbox.&lt;br /&gt;
  #if assignment_id does not exist in the table use_github_metrics, save it&lt;br /&gt;
  def save&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.save(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3. Delete assignment id if it exists. This function is for the frontend page to cancel the checkbox.&lt;br /&gt;
  #if assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  def delete&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.delete(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
An instructor can customize an assignment in this view. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:Before liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they choose Github metrics in the previous assignment edit page and is not authenticated to Github yet. The Login link redirects to an omniauth login page, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors if they don't choose the &amp;quot;use GitHub metric&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
This UML shows the new classes and models we created and implemented in our final project. Besides these, we also modified some of the existing classes and methods, we will give more detailed information later.&lt;br /&gt;
&lt;br /&gt;
[[File:E2149_Uml_1.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==OminiAuth Github API update==&lt;br /&gt;
GitHub no longer supports authentication through query parameters. Thus, we move the authentication to the header.&lt;br /&gt;
From September 8, 2021, using access_token as a query parameter to access the API (as a user or as a GitHub App) and using client_id/client_secret to make OAuth app unauthenticated are disabled. &lt;br /&gt;
&lt;br /&gt;
===Using access_token as a query param===&lt;br /&gt;
Originally, the code uses the API with parameters。&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?access_token=my_access_token&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now, we send the token in the header:&lt;br /&gt;
 curl -H 'Authorization: token my_access_token' https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
===Using client_id/client_secret as a query param===&lt;br /&gt;
Originally, the code uses an OAuth app's client_id and client_secret to make unauthenticated calls with a higher rate limit similar to&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?client_id=my_client_id&amp;amp;client_secret=my_secret_id&amp;quot;&lt;br /&gt;
Instead, we use the following format:&lt;br /&gt;
 curl -u my_client_id:my_client_secret https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
Oauth Configuration&lt;br /&gt;
[[File:github-oauth.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  def oauth_login&lt;br /&gt;
    case params[:provider]&lt;br /&gt;
    when &amp;quot;github&amp;quot;&lt;br /&gt;
      github_login&lt;br /&gt;
    when &amp;quot;google_oauth2&amp;quot;&lt;br /&gt;
      google_login&lt;br /&gt;
    when &amp;quot;github2021&amp;quot; # due to github 0&lt;br /&gt;
      custom_github_login&lt;br /&gt;
    else&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, user.name, &amp;quot;Invalid OAuth Provider&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  def custom_github_login&lt;br /&gt;
    session_code = request.env['rack.request.query_hash']['code']&lt;br /&gt;
    result = RestClient.post('https://github.com/login/oauth/access_token',&lt;br /&gt;
                               {:client_id =&amp;gt; GITHUB_CONFIG['client_key'],&lt;br /&gt;
                                :client_secret =&amp;gt; GITHUB_CONFIG['client_secret'],&lt;br /&gt;
                                :code =&amp;gt; session_code},&lt;br /&gt;
                                :accept =&amp;gt; :json)&lt;br /&gt;
    access_token = JSON.parse(result)['access_token']&lt;br /&gt;
    session[&amp;quot;github_access_token&amp;quot;] = access_token&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'list_submissions', id: session[&amp;quot;assignment_id&amp;quot;]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down option for Github metric on the page&lt;br /&gt;
:4. Process the page without choosing Github metrics report  for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
Detailed of Github Testing&lt;br /&gt;
&lt;br /&gt;
After changing the way of calling the GitHub API, we need to test whether we can get the data from the GitHub API correctly.&lt;br /&gt;
&lt;br /&gt;
 describe '#gets data from GitHub api v4(graphql)' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_github_repository_details' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_statuses_for_pull_request' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
=====Previous Project References=====&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=142544</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=142544"/>
		<updated>2021-11-30T22:15:57Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* OminiAuth Github API update */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The functionality of the showing GitHub metrics cannot be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment. The project doesn't report lines added and deleted because of the lack of support from the current API. It adds quite a lot of lines of code for a single project and some codes could be refactored. The test plans of the current project are not described thoroughly enough. We will modify the existing RSpec test code and add some new tests.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have found numerous action items so far. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves&amp;quot; or features that are either left out of the original project or will make the integration display more integrated.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Turn on.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the GitHub report of the assignment is turned on or turned off, we need to create a new table named &amp;quot;use_github_metric&amp;quot; to save the id of the assignment whose GitHub metric is turned on. We also have an alternative solution to add a boolean field in the assignment table, but due to security concerns, we give it up. We think we should not change the data of the assignment.&lt;br /&gt;
&lt;br /&gt;
'''Table: use_github_metric'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|- style=&amp;quot;font-weight:bold;&amp;quot;&lt;br /&gt;
! id(PK)&lt;br /&gt;
! Assignment_id(FK)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 15&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Simplify the Codes ====&lt;br /&gt;
Extract the repeating part of codes and then construct an independent method based on them. Finally, we could use this method. &lt;br /&gt;
&lt;br /&gt;
The last edition uses the lots of Google API to help generate the chart, we can use the method from helper to generate charts instead.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chooses not to include the GitHub metric in the assignment (the functionality is turned off), the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed on the frontend page.&lt;br /&gt;
&lt;br /&gt;
1. We edited expertiza\app\views\assignments\edit\_general.html.erb and added a checkbox. The codes are as follow.&lt;br /&gt;
If the id of the assignment exists, there will be a checkbox for the user to use github metrics.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--Github--&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_use_github' colspan=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;checkbox&amp;quot; name = &amp;quot;use_github&amp;quot; id=&amp;quot;use_github&amp;quot; &amp;lt;%= &amp;quot;checked&amp;quot; &lt;br /&gt;
             if UseGithubMetricsController.exist(@assignment_form.assignment.id) %&amp;gt;&amp;gt;&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('use_github', 'Use github metrics?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The expertiza\app\views\assignments\list_submissions.html.erb is edited too. &lt;br /&gt;
If the id of the assignment exists and github_access_token is null (it means that the user hasn't logged in), then the page will show 'Login to Query Github data' button. If github_access_token is not null, it would show 'Refresh Github data' button because the user has logged in.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%if UseGithubMetricsController.exist(@assignment.id) %&amp;gt;&lt;br /&gt;
 &amp;lt;% if session[&amp;quot;github_access_token&amp;quot;].nil? %&amp;gt;&lt;br /&gt;
   &amp;lt;% topic_identifier, topic_name, users_for_curr_team, participants = get_data_for_list_submissions(@teams.first) %&amp;gt;&lt;br /&gt;
   &amp;lt;%= link_to 'Login to Query Github data', { controller: 'metrics', action: 'show', id: participants.first.id } %&amp;gt;&lt;br /&gt;
   &amp;lt;% else %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Refresh Github data', { controller: 'metrics', action: 'query_assignment_statistics', id: @assignment.id}, &lt;br /&gt;
                                                                                                       :onclick =&amp;gt; &amp;quot;showLoadIcon()&amp;quot;%&amp;gt;&lt;br /&gt;
   &amp;lt;img id=&amp;quot;load_icon&amp;quot; src=&amp;quot;&amp;lt;%= image_url('ajax-loader.gif') %&amp;gt;&amp;quot; style=&amp;quot;display:none&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controller Modification ====&lt;br /&gt;
We added a function in expertiza\app\controllers\use_github_metrics_controller.rb as follwowing.&lt;br /&gt;
&lt;br /&gt;
===== Self Functions =====&lt;br /&gt;
&lt;br /&gt;
 #check if assignment_id exists in the table use_github_metrics&lt;br /&gt;
  def self.exist(assignment_id)&lt;br /&gt;
    use_github = UseGithubMetric.find_by(assignment_id: assignment_id)&lt;br /&gt;
    !use_github.nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  #if assignment_id does not exist in the table use_github_metrics, save it&lt;br /&gt;
  def self.save(assignment_id)&lt;br /&gt;
    unless exist(assignment_id)&lt;br /&gt;
      use_github = UseGithubMetric.new(assignment_id)&lt;br /&gt;
      use_github.assignment_id = assignment_id&lt;br /&gt;
      use_github.save&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  #if assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  def self.delete(assignment_id)&lt;br /&gt;
    if exist(assignment_id)&lt;br /&gt;
      use_github = UseGithubMetric.find_by(assignment_id: assignment_id)&lt;br /&gt;
      use_github.destroy&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
===== Not Self Functions =====&lt;br /&gt;
&lt;br /&gt;
1. Return TRUE if the assignment id exists. &lt;br /&gt;
  #check if assignment_id exists in the table use_github_metrics&lt;br /&gt;
  def exist&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.exist(assignment_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. Save assignment is if it doesn't exist. This function is for the frontend page to select the checkbox.&lt;br /&gt;
  #if assignment_id does not exist in the table use_github_metrics, save it&lt;br /&gt;
  def save&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.save(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3. Delete assignment id if it exists. This function is for the frontend page to cancel the checkbox.&lt;br /&gt;
  #if assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  def delete&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.delete(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
An instructor can customize an assignment in this view. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:Before liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they choose Github metrics in the previous assignment edit page and is not authenticated to Github yet. The Login link redirects to an omniauth login page, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors if they don't choose the &amp;quot;use GitHub metric&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
This UML shows the new classes and models we created and implemented in our final project. Besides these, we also modified some of the existing classes and methods, we will give more detailed information later.&lt;br /&gt;
&lt;br /&gt;
[[File:E2149_Uml_1.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==OminiAuth Github API update==&lt;br /&gt;
GitHub no longer supports authentication through query parameters. Thus, we move the authentication to the header.&lt;br /&gt;
From September 8, 2021, using access_token as a query parameter to access the API (as a user or as a GitHub App) and using client_id/client_secret to make OAuth app unauthenticated are disabled. &lt;br /&gt;
&lt;br /&gt;
===Using access_token as a query param===&lt;br /&gt;
Originally, the code uses the API with parameters。&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?access_token=my_access_token&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now, we send the token in the header:&lt;br /&gt;
 curl -H 'Authorization: token my_access_token' https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
===Using client_id/client_secret as a query param===&lt;br /&gt;
Originally, the code uses an OAuth app's client_id and client_secret to make unauthenticated calls with a higher rate limit similar to&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?client_id=my_client_id&amp;amp;client_secret=my_secret_id&amp;quot;&lt;br /&gt;
Instead, we use the following format:&lt;br /&gt;
 curl -u my_client_id:my_client_secret https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
[[File:github-oauth.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  def oauth_login&lt;br /&gt;
    case params[:provider]&lt;br /&gt;
    when &amp;quot;github&amp;quot;&lt;br /&gt;
      github_login&lt;br /&gt;
    when &amp;quot;google_oauth2&amp;quot;&lt;br /&gt;
      google_login&lt;br /&gt;
    when &amp;quot;github2021&amp;quot; # due to github 0&lt;br /&gt;
      custom_github_login&lt;br /&gt;
    else&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, user.name, &amp;quot;Invalid OAuth Provider&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  def custom_github_login&lt;br /&gt;
    session_code = request.env['rack.request.query_hash']['code']&lt;br /&gt;
    result = RestClient.post('https://github.com/login/oauth/access_token',&lt;br /&gt;
                               {:client_id =&amp;gt; GITHUB_CONFIG['client_key'],&lt;br /&gt;
                                :client_secret =&amp;gt; GITHUB_CONFIG['client_secret'],&lt;br /&gt;
                                :code =&amp;gt; session_code},&lt;br /&gt;
                                :accept =&amp;gt; :json)&lt;br /&gt;
    access_token = JSON.parse(result)['access_token']&lt;br /&gt;
    session[&amp;quot;github_access_token&amp;quot;] = access_token&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'list_submissions', id: session[&amp;quot;assignment_id&amp;quot;]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down option for Github metric on the page&lt;br /&gt;
:4. Process the page without choosing Github metrics report  for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
Detailed of Github Testing&lt;br /&gt;
&lt;br /&gt;
After changing the way of calling the GitHub API, we need to test whether we can get the data from the GitHub API correctly.&lt;br /&gt;
&lt;br /&gt;
 describe '#gets data from GitHub api v4(graphql)' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_github_repository_details' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_statuses_for_pull_request' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
=====Previous Project References=====&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=142543</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=142543"/>
		<updated>2021-11-30T22:15:44Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* OminiAuth Github API update */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The functionality of the showing GitHub metrics cannot be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment. The project doesn't report lines added and deleted because of the lack of support from the current API. It adds quite a lot of lines of code for a single project and some codes could be refactored. The test plans of the current project are not described thoroughly enough. We will modify the existing RSpec test code and add some new tests.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have found numerous action items so far. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves&amp;quot; or features that are either left out of the original project or will make the integration display more integrated.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Turn on.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the GitHub report of the assignment is turned on or turned off, we need to create a new table named &amp;quot;use_github_metric&amp;quot; to save the id of the assignment whose GitHub metric is turned on. We also have an alternative solution to add a boolean field in the assignment table, but due to security concerns, we give it up. We think we should not change the data of the assignment.&lt;br /&gt;
&lt;br /&gt;
'''Table: use_github_metric'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|- style=&amp;quot;font-weight:bold;&amp;quot;&lt;br /&gt;
! id(PK)&lt;br /&gt;
! Assignment_id(FK)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 15&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Simplify the Codes ====&lt;br /&gt;
Extract the repeating part of codes and then construct an independent method based on them. Finally, we could use this method. &lt;br /&gt;
&lt;br /&gt;
The last edition uses the lots of Google API to help generate the chart, we can use the method from helper to generate charts instead.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chooses not to include the GitHub metric in the assignment (the functionality is turned off), the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed on the frontend page.&lt;br /&gt;
&lt;br /&gt;
1. We edited expertiza\app\views\assignments\edit\_general.html.erb and added a checkbox. The codes are as follow.&lt;br /&gt;
If the id of the assignment exists, there will be a checkbox for the user to use github metrics.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--Github--&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_use_github' colspan=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;checkbox&amp;quot; name = &amp;quot;use_github&amp;quot; id=&amp;quot;use_github&amp;quot; &amp;lt;%= &amp;quot;checked&amp;quot; &lt;br /&gt;
             if UseGithubMetricsController.exist(@assignment_form.assignment.id) %&amp;gt;&amp;gt;&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('use_github', 'Use github metrics?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The expertiza\app\views\assignments\list_submissions.html.erb is edited too. &lt;br /&gt;
If the id of the assignment exists and github_access_token is null (it means that the user hasn't logged in), then the page will show 'Login to Query Github data' button. If github_access_token is not null, it would show 'Refresh Github data' button because the user has logged in.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%if UseGithubMetricsController.exist(@assignment.id) %&amp;gt;&lt;br /&gt;
 &amp;lt;% if session[&amp;quot;github_access_token&amp;quot;].nil? %&amp;gt;&lt;br /&gt;
   &amp;lt;% topic_identifier, topic_name, users_for_curr_team, participants = get_data_for_list_submissions(@teams.first) %&amp;gt;&lt;br /&gt;
   &amp;lt;%= link_to 'Login to Query Github data', { controller: 'metrics', action: 'show', id: participants.first.id } %&amp;gt;&lt;br /&gt;
   &amp;lt;% else %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Refresh Github data', { controller: 'metrics', action: 'query_assignment_statistics', id: @assignment.id}, &lt;br /&gt;
                                                                                                       :onclick =&amp;gt; &amp;quot;showLoadIcon()&amp;quot;%&amp;gt;&lt;br /&gt;
   &amp;lt;img id=&amp;quot;load_icon&amp;quot; src=&amp;quot;&amp;lt;%= image_url('ajax-loader.gif') %&amp;gt;&amp;quot; style=&amp;quot;display:none&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controller Modification ====&lt;br /&gt;
We added a function in expertiza\app\controllers\use_github_metrics_controller.rb as follwowing.&lt;br /&gt;
&lt;br /&gt;
===== Self Functions =====&lt;br /&gt;
&lt;br /&gt;
 #check if assignment_id exists in the table use_github_metrics&lt;br /&gt;
  def self.exist(assignment_id)&lt;br /&gt;
    use_github = UseGithubMetric.find_by(assignment_id: assignment_id)&lt;br /&gt;
    !use_github.nil?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  #if assignment_id does not exist in the table use_github_metrics, save it&lt;br /&gt;
  def self.save(assignment_id)&lt;br /&gt;
    unless exist(assignment_id)&lt;br /&gt;
      use_github = UseGithubMetric.new(assignment_id)&lt;br /&gt;
      use_github.assignment_id = assignment_id&lt;br /&gt;
      use_github.save&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  #if assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  def self.delete(assignment_id)&lt;br /&gt;
    if exist(assignment_id)&lt;br /&gt;
      use_github = UseGithubMetric.find_by(assignment_id: assignment_id)&lt;br /&gt;
      use_github.destroy&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
===== Not Self Functions =====&lt;br /&gt;
&lt;br /&gt;
1. Return TRUE if the assignment id exists. &lt;br /&gt;
  #check if assignment_id exists in the table use_github_metrics&lt;br /&gt;
  def exist&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.exist(assignment_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. Save assignment is if it doesn't exist. This function is for the frontend page to select the checkbox.&lt;br /&gt;
  #if assignment_id does not exist in the table use_github_metrics, save it&lt;br /&gt;
  def save&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.save(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3. Delete assignment id if it exists. This function is for the frontend page to cancel the checkbox.&lt;br /&gt;
  #if assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  def delete&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.delete(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
An instructor can customize an assignment in this view. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:Before liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they choose Github metrics in the previous assignment edit page and is not authenticated to Github yet. The Login link redirects to an omniauth login page, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors if they don't choose the &amp;quot;use GitHub metric&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
This UML shows the new classes and models we created and implemented in our final project. Besides these, we also modified some of the existing classes and methods, we will give more detailed information later.&lt;br /&gt;
&lt;br /&gt;
[[File:E2149_Uml_1.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==OminiAuth Github API update==&lt;br /&gt;
GitHub no longer supports authentication through query parameters. Thus, we move the authentication to the header.&lt;br /&gt;
From September 8, 2021, using access_token as a query parameter to access the API (as a user or as a GitHub App) and using client_id/client_secret to make OAuth app unauthenticated are disabled. &lt;br /&gt;
&lt;br /&gt;
===Using access_token as a query param===&lt;br /&gt;
Originally, the code uses the API with parameters。&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?access_token=my_access_token&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now, we send the token in the header:&lt;br /&gt;
 curl -H 'Authorization: token my_access_token' https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
===Using client_id/client_secret as a query param===&lt;br /&gt;
Originally, the code uses an OAuth app's client_id and client_secret to make unauthenticated calls with a higher rate limit similar to&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?client_id=my_client_id&amp;amp;client_secret=my_secret_id&amp;quot;&lt;br /&gt;
Instead, we use the following format:&lt;br /&gt;
 curl -u my_client_id:my_client_secret https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
[[File:github-oauth.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  def oauth_login&lt;br /&gt;
    case params[:provider]&lt;br /&gt;
    when &amp;quot;github&amp;quot;&lt;br /&gt;
      github_login&lt;br /&gt;
    when &amp;quot;google_oauth2&amp;quot;&lt;br /&gt;
      google_login&lt;br /&gt;
    when &amp;quot;github2021&amp;quot; # due to github 0&lt;br /&gt;
      custom_github_login&lt;br /&gt;
    else&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, user.name, &amp;quot;Invalid OAuth Provider&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  def custom_github_login&lt;br /&gt;
    session_code = request.env['rack.request.query_hash']['code']&lt;br /&gt;
    result = RestClient.post('https://github.com/login/oauth/access_token',&lt;br /&gt;
                               {:client_id =&amp;gt; GITHUB_CONFIG['client_key'],&lt;br /&gt;
                                :client_secret =&amp;gt; GITHUB_CONFIG['client_secret'],&lt;br /&gt;
                                :code =&amp;gt; session_code},&lt;br /&gt;
                                :accept =&amp;gt; :json)&lt;br /&gt;
    access_token = JSON.parse(result)['access_token']&lt;br /&gt;
    session[&amp;quot;github_access_token&amp;quot;] = access_token&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'list_submissions', id: session[&amp;quot;assignment_id&amp;quot;]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down option for Github metric on the page&lt;br /&gt;
:4. Process the page without choosing Github metrics report  for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
Detailed of Github Testing&lt;br /&gt;
&lt;br /&gt;
After changing the way of calling the GitHub API, we need to test whether we can get the data from the GitHub API correctly.&lt;br /&gt;
&lt;br /&gt;
 describe '#gets data from GitHub api v4(graphql)' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_github_repository_details' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_statuses_for_pull_request' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
=====Previous Project References=====&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Github-oauth.png&amp;diff=142539</id>
		<title>File:Github-oauth.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Github-oauth.png&amp;diff=142539"/>
		<updated>2021-11-30T22:14:49Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=142536</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=142536"/>
		<updated>2021-11-30T22:13:35Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* OminiAuth Github API update */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The functionality of the showing GitHub metrics cannot be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment. The project doesn't report lines added and deleted because of the lack of support from the current API. It adds quite a lot of lines of code for a single project and some codes could be refactored. The test plans of the current project are not described thoroughly enough. We will modify the existing RSpec test code and add some new tests.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have found numerous action items so far. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves&amp;quot; or features that are either left out of the original project or will make the integration display more integrated.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Turn on.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the GitHub report of the assignment is turned on or turned off, we need to create a new table named &amp;quot;use_github_metric&amp;quot; to save the id of the assignment whose GitHub metric is turned on. We also have an alternative solution to add a boolean field in the assignment table, but due to security concerns, we give it up. We think we should not change the data of the assignment.&lt;br /&gt;
&lt;br /&gt;
'''Table: use_github_metric'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|- style=&amp;quot;font-weight:bold;&amp;quot;&lt;br /&gt;
! id(PK)&lt;br /&gt;
! Assignment_id(FK)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 15&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Simplify the Codes ====&lt;br /&gt;
Extract the repeating part of codes and then construct an independent method based on them. Finally, we could use this method. &lt;br /&gt;
&lt;br /&gt;
The last edition uses the lots of Google API to help generate the chart, we can use the method from helper to generate charts instead.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chooses not to include the GitHub metric in the assignment (the functionality is turned off), the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed on the frontend page.&lt;br /&gt;
&lt;br /&gt;
1. We edited expertiza\app\views\assignments\edit\_general.html.erb and added a checkbox. The codes are as follow.&lt;br /&gt;
If the id of the assignment exists, there will be a checkbox for the user to use github metrics.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--Github--&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_use_github' colspan=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;checkbox&amp;quot; name = &amp;quot;use_github&amp;quot; id=&amp;quot;use_github&amp;quot; &amp;lt;%= &amp;quot;checked&amp;quot; &lt;br /&gt;
             if UseGithubMetricsController.exist(@assignment_form.assignment.id) %&amp;gt;&amp;gt;&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('use_github', 'Use github metrics?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The expertiza\app\views\assignments\list_submissions.html.erb is edited too. &lt;br /&gt;
If the id of the assignment exists and github_access_token is null (it means that the user hasn't logged in), then the page will show 'Login to Query Github data' button. If github_access_token is not null, it would show 'Refresh Github data' button because the user has logged in.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%if UseGithubMetricsController.exist(@assignment.id) %&amp;gt;&lt;br /&gt;
 &amp;lt;% if session[&amp;quot;github_access_token&amp;quot;].nil? %&amp;gt;&lt;br /&gt;
   &amp;lt;% topic_identifier, topic_name, users_for_curr_team, participants = get_data_for_list_submissions(@teams.first) %&amp;gt;&lt;br /&gt;
   &amp;lt;%= link_to 'Login to Query Github data', { controller: 'metrics', action: 'show', id: participants.first.id } %&amp;gt;&lt;br /&gt;
   &amp;lt;% else %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Refresh Github data', { controller: 'metrics', action: 'query_assignment_statistics', id: @assignment.id}, &lt;br /&gt;
                                                                                                       :onclick =&amp;gt; &amp;quot;showLoadIcon()&amp;quot;%&amp;gt;&lt;br /&gt;
   &amp;lt;img id=&amp;quot;load_icon&amp;quot; src=&amp;quot;&amp;lt;%= image_url('ajax-loader.gif') %&amp;gt;&amp;quot; style=&amp;quot;display:none&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controller Modification ====&lt;br /&gt;
We added a function in expertiza\app\controllers\use_github_metrics_controller.rb as follwowing.&lt;br /&gt;
&lt;br /&gt;
===== self functions =====&lt;br /&gt;
&lt;br /&gt;
===== not self functions =====&lt;br /&gt;
&lt;br /&gt;
1. Return TRUE if the assignment id exists. &lt;br /&gt;
  #check if assignment_id exists in the table use_github_metrics&lt;br /&gt;
  def exist&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.exist(assignment_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. Save assignment is if it doesn't exist. This function is for the frontend page to select the checkbox.&lt;br /&gt;
  #if assignment_id does not exist in the table use_github_metrics, save it&lt;br /&gt;
  def save&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.save(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3. Delete assignment id if it exists. This function is for the frontend page to cancel the checkbox.&lt;br /&gt;
  #if assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  def delete&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.delete(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
An instructor can customize an assignment in this view. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:Before liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they choose Github metrics in the previous assignment edit page and is not authenticated to Github yet. The Login link redirects to an omniauth login page, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors if they don't choose the &amp;quot;use GitHub metric&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
This UML shows the new classes and models we created and implemented in our final project. Besides these, we also modified some of the existing classes and methods, we will give more detailed information later.&lt;br /&gt;
&lt;br /&gt;
[[File:E2149_Uml_1.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==OminiAuth Github API update==&lt;br /&gt;
GitHub no longer supports authentication through query parameters. Thus, we move the authentication to the header.&lt;br /&gt;
From September 8, 2021, using access_token as a query parameter to access the API (as a user or as a GitHub App) and using client_id/client_secret to make OAuth app unauthenticated are disabled. &lt;br /&gt;
&lt;br /&gt;
===Using access_token as a query param===&lt;br /&gt;
Originally, the code uses the API with parameters。&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?access_token=my_access_token&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now, we send the token in the header:&lt;br /&gt;
 curl -H 'Authorization: token my_access_token' https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
===Using client_id/client_secret as a query param===&lt;br /&gt;
Originally, the code uses an OAuth app's client_id and client_secret to make unauthenticated calls with a higher rate limit similar to&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?client_id=my_client_id&amp;amp;client_secret=my_secret_id&amp;quot;&lt;br /&gt;
Instead, we use the following format:&lt;br /&gt;
 curl -u my_client_id:my_client_secret https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
  def oauth_login&lt;br /&gt;
    case params[:provider]&lt;br /&gt;
    when &amp;quot;github&amp;quot;&lt;br /&gt;
      github_login&lt;br /&gt;
    when &amp;quot;google_oauth2&amp;quot;&lt;br /&gt;
      google_login&lt;br /&gt;
    when &amp;quot;github2021&amp;quot; # due to github 0&lt;br /&gt;
      custom_github_login&lt;br /&gt;
    else&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, user.name, &amp;quot;Invalid OAuth Provider&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  def custom_github_login&lt;br /&gt;
    session_code = request.env['rack.request.query_hash']['code']&lt;br /&gt;
    result = RestClient.post('https://github.com/login/oauth/access_token',&lt;br /&gt;
                               {:client_id =&amp;gt; GITHUB_CONFIG['client_key'],&lt;br /&gt;
                                :client_secret =&amp;gt; GITHUB_CONFIG['client_secret'],&lt;br /&gt;
                                :code =&amp;gt; session_code},&lt;br /&gt;
                                :accept =&amp;gt; :json)&lt;br /&gt;
    access_token = JSON.parse(result)['access_token']&lt;br /&gt;
    session[&amp;quot;github_access_token&amp;quot;] = access_token&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'list_submissions', id: session[&amp;quot;assignment_id&amp;quot;]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down option for Github metric on the page&lt;br /&gt;
:4. Process the page without choosing Github metrics report  for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
Detailed of Github Testing&lt;br /&gt;
&lt;br /&gt;
After changing the way of calling the GitHub API, we need to test whether we can get the data from the GitHub API correctly.&lt;br /&gt;
&lt;br /&gt;
 describe '#gets data from GitHub api v4(graphql)' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_github_repository_details' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_statuses_for_pull_request' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
=====Previous Project References=====&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=142532</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=142532"/>
		<updated>2021-11-30T22:12:38Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* OminiAuth Github API update */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The functionality of the showing GitHub metrics cannot be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment. The project doesn't report lines added and deleted because of the lack of support from the current API. It adds quite a lot of lines of code for a single project and some codes could be refactored. The test plans of the current project are not described thoroughly enough. We will modify the existing RSpec test code and add some new tests.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have found numerous action items so far. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves&amp;quot; or features that are either left out of the original project or will make the integration display more integrated.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Turn on.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the GitHub report of the assignment is turned on or turned off, we need to create a new table named &amp;quot;use_github_metric&amp;quot; to save the id of the assignment whose GitHub metric is turned on. We also have an alternative solution to add a boolean field in the assignment table, but due to security concerns, we give it up. We think we should not change the data of the assignment.&lt;br /&gt;
&lt;br /&gt;
'''Table: use_github_metric'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|- style=&amp;quot;font-weight:bold;&amp;quot;&lt;br /&gt;
! id(PK)&lt;br /&gt;
! Assignment_id(FK)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 15&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Simplify the Codes ====&lt;br /&gt;
Extract the repeating part of codes and then construct an independent method based on them. Finally, we could use this method. &lt;br /&gt;
&lt;br /&gt;
The last edition uses the lots of Google API to help generate the chart, we can use the method from helper to generate charts instead.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chooses not to include the GitHub metric in the assignment (the functionality is turned off), the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed on the frontend page.&lt;br /&gt;
&lt;br /&gt;
1. We edited expertiza\app\views\assignments\edit\_general.html.erb and added a checkbox. The codes are as follow.&lt;br /&gt;
If the id of the assignment exists, there will be a checkbox for the user to use github metrics.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;!--Github--&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td style='padding:5px' id='assignment_use_github' colspan=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;checkbox&amp;quot; name = &amp;quot;use_github&amp;quot; id=&amp;quot;use_github&amp;quot; &amp;lt;%= &amp;quot;checked&amp;quot; &lt;br /&gt;
             if UseGithubMetricsController.exist(@assignment_form.assignment.id) %&amp;gt;&amp;gt;&amp;lt;/input&amp;gt;&lt;br /&gt;
      &amp;lt;%= label_tag('use_github', 'Use github metrics?') %&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. The expertiza\app\views\assignments\list_submissions.html.erb is edited too. &lt;br /&gt;
If the id of the assignment exists and github_access_token is null (it means that the user hasn't logged in), then the page will show 'Login to Query Github data' button. If github_access_token is not null, it would show 'Refresh Github data' button because the user has logged in.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;%if UseGithubMetricsController.exist(@assignment.id) %&amp;gt;&lt;br /&gt;
 &amp;lt;% if session[&amp;quot;github_access_token&amp;quot;].nil? %&amp;gt;&lt;br /&gt;
   &amp;lt;% topic_identifier, topic_name, users_for_curr_team, participants = get_data_for_list_submissions(@teams.first) %&amp;gt;&lt;br /&gt;
   &amp;lt;%= link_to 'Login to Query Github data', { controller: 'metrics', action: 'show', id: participants.first.id } %&amp;gt;&lt;br /&gt;
   &amp;lt;% else %&amp;gt;&lt;br /&gt;
 &amp;lt;%= link_to 'Refresh Github data', { controller: 'metrics', action: 'query_assignment_statistics', id: @assignment.id}, &lt;br /&gt;
                                                                                                       :onclick =&amp;gt; &amp;quot;showLoadIcon()&amp;quot;%&amp;gt;&lt;br /&gt;
   &amp;lt;img id=&amp;quot;load_icon&amp;quot; src=&amp;quot;&amp;lt;%= image_url('ajax-loader.gif') %&amp;gt;&amp;quot; style=&amp;quot;display:none&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Controller Modification ====&lt;br /&gt;
We added a function in expertiza\app\controllers\use_github_metrics_controller.rb as follwowing.&lt;br /&gt;
&lt;br /&gt;
1. Return TRUE if the assignment id exists. &lt;br /&gt;
  #check if assignment_id exists in the table use_github_metrics&lt;br /&gt;
  def exist&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.exist(assignment_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. Save assignment is if it doesn't exist. This function is for the frontend page to select the checkbox.&lt;br /&gt;
  #if assignment_id does not exist in the table use_github_metrics, save it&lt;br /&gt;
  def save&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.save(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3. Delete assignment id if it exists. This function is for the frontend page to cancel the checkbox.&lt;br /&gt;
  #if assignment_id exists in the table use_github_metrics, delete it&lt;br /&gt;
  def delete&lt;br /&gt;
    assignment_id = params[:assignment_id]&lt;br /&gt;
    UseGithubMetricsController.delete(assignment_id)&lt;br /&gt;
    respond_to do |format|&lt;br /&gt;
      format.json { render json: assignment_id }&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
An instructor can customize an assignment in this view. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:Before liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they choose Github metrics in the previous assignment edit page and is not authenticated to Github yet. The Login link redirects to an omniauth login page, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors if they don't choose the &amp;quot;use GitHub metric&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
This UML shows the new classes and models we created and implemented in our final project. Besides these, we also modified some of the existing classes and methods, we will give more detailed information later.&lt;br /&gt;
&lt;br /&gt;
[[File:E2149_Uml_1.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==OminiAuth Github API update==&lt;br /&gt;
GitHub no longer supports authentication through query parameters. Thus, we move the authentication to the header.&lt;br /&gt;
From September 8, 2021, using access_token as a query parameter to access the API (as a user or as a GitHub App) and using client_id/client_secret to make OAuth app unauthenticated are disabled. &lt;br /&gt;
&lt;br /&gt;
===Using access_token as a query param===&lt;br /&gt;
Originally, the code uses the API with parameters。&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?access_token=my_access_token&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now, we send the token in the header:&lt;br /&gt;
 curl -H 'Authorization: token my_access_token' https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
===Using client_id/client_secret as a query param===&lt;br /&gt;
Originally, the code uses an OAuth app's client_id and client_secret to make unauthenticated calls with a higher rate limit similar to&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?client_id=my_client_id&amp;amp;client_secret=my_secret_id&amp;quot;&lt;br /&gt;
Instead, we use the following format:&lt;br /&gt;
 curl -u my_client_id:my_client_secret https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
  def oauth_login&lt;br /&gt;
    case params[:provider]&lt;br /&gt;
    when &amp;quot;github&amp;quot;&lt;br /&gt;
      github_login&lt;br /&gt;
    when &amp;quot;google_oauth2&amp;quot;&lt;br /&gt;
      google_login&lt;br /&gt;
    when &amp;quot;github2021&amp;quot; # due to github 0&lt;br /&gt;
      custom_github_login&lt;br /&gt;
    else&lt;br /&gt;
      ExpertizaLogger.error LoggerMessage.new(controller_name, user.name, &amp;quot;Invalid OAuth Provider&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down option for Github metric on the page&lt;br /&gt;
:4. Process the page without choosing Github metrics report  for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
Detailed of Github Testing&lt;br /&gt;
&lt;br /&gt;
After changing the way of calling the GitHub API, we need to test whether we can get the data from the GitHub API correctly.&lt;br /&gt;
&lt;br /&gt;
 describe '#gets data from GitHub api v4(graphql)' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_github_repository_details' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_statuses_for_pull_request' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
=====Previous Project References=====&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141381</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141381"/>
		<updated>2021-11-09T02:13:16Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The functionality of the showing GitHub metrics cannot be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment. The project doesn't report lines added and deleted because of a lack of support from the API. It adds quite a lot of lines of code for a single project. The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Turn on.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the GitHub report of the assignment is turned on or turned off, we need to create a new table named &amp;quot;use_github_metric&amp;quot; to save the id of the assignment which turns on GitHub metric. We also have an alternative solution to add the boolean field in the assignment table, but for security concerns, we give it up we should not influence the data of the assignment.&lt;br /&gt;
&lt;br /&gt;
'''Table: use_github_metric'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|- style=&amp;quot;font-weight:bold;&amp;quot;&lt;br /&gt;
! id(PK)&lt;br /&gt;
! Assignment_id(FK)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 15&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
==== Controller Modification ====&lt;br /&gt;
we will add two functions in the assignment_controller to help update the status of using the Github metric.&lt;br /&gt;
&lt;br /&gt;
def query_github_metric_status&lt;br /&gt;
&lt;br /&gt;
the function will search the assignment_id in the use_github_metric table. If not exist, the Github metric will turn off. Otherwise, it will turn on.&lt;br /&gt;
&lt;br /&gt;
def update_github_metirc&lt;br /&gt;
&lt;br /&gt;
the function will update the status of using the Github metric of assignment and flashes a notice. if turn on the metric, we will add the assignment_id to the table use_github_metric. If turn off we will delete the data.&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:Before liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors if they don't choose &amp;quot;use github metric&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
We show the UML for the new classes and model we created and implemented in our final project for a overview. Other than these, we also modified some of the existing classes and method, we will give detailed introduction later.&lt;br /&gt;
&lt;br /&gt;
[[File:E2149_Uml_1.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==OminiAuth Github API update==&lt;br /&gt;
GitHub no longer supports authentication through query parameters. Thus, we move the authentication in the header.&lt;br /&gt;
Starting on September 8 2021, using access_token as a query parameter to access the API (as a user or as a GitHub App) or using client_id/client_secret to make OAuth app unauthenticated calls are disabled. &lt;br /&gt;
&lt;br /&gt;
===Using access_token as a query param===&lt;br /&gt;
Originally, the code makes an API&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?access_token=my_access_token&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Instead, we send the token in the header:&lt;br /&gt;
 curl -H 'Authorization: token my_access_token' https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
===Using client_id/client_secret as a query param===&lt;br /&gt;
Originally, the code uses an OAuth app's client_id and client_secret to make unauthenticated calls with a higher rate limit similar to&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?client_id=my_client_id&amp;amp;client_secret=my_secret_id&amp;quot;&lt;br /&gt;
Instead, we use the following format:&lt;br /&gt;
 curl -u my_client_id:my_client_secret https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down option for Github metric on the page&lt;br /&gt;
:4. Process the page without choosing Github metrics report  for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
Detailed of Github Testing&lt;br /&gt;
After the change of call GitHub API, we need to test get data from the GitHub API.&lt;br /&gt;
&lt;br /&gt;
 describe '#gets data from GitHub api v4(graphql)' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_github_repository_details' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_statuses_for_pull_request' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
=====Previous Project References=====&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141378</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141378"/>
		<updated>2021-11-09T02:11:56Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* UI Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The functionality of the showing GitHub metrics cannot be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment. The project doesn't report lines added and deleted because of a lack of support from the API. It adds quite a lot of lines of code for a single project. The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Turn on.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the GitHub report of the assignment is turned on or turned off, we need to create a new table named &amp;quot;use_github_metric&amp;quot; to save the id of the assignment which turns on GitHub metric. We also have an alternative solution to add the boolean field in the assignment table, but for security concerns, we give it up we should not influence the data of the assignment.&lt;br /&gt;
&lt;br /&gt;
'''Table: use_github_metric'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|- style=&amp;quot;font-weight:bold;&amp;quot;&lt;br /&gt;
! id(PK)&lt;br /&gt;
! Assignment_id(FK)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 15&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
==== Controller Modification ====&lt;br /&gt;
we will add two functions in the assignment_controller to help update the status of using the Github metric.&lt;br /&gt;
&lt;br /&gt;
def query_github_metric_status&lt;br /&gt;
&lt;br /&gt;
the function will search the assignment_id in the use_github_metric table. If not exist, the Github metric will turn off. Otherwise, it will turn on.&lt;br /&gt;
&lt;br /&gt;
def update_github_metirc&lt;br /&gt;
&lt;br /&gt;
the function will update the status of using the Github metric of assignment and flashes a notice. if turn on the metric, we will add the assignment_id to the table use_github_metric. If turn off we will delete the data.&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:Before liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors if they don't choose &amp;quot;use github metric&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
We show the UML for the new classes and model we created and implemented in our final project for a overview. Other than these, we also modified some of the existing classes and method, we will give detailed introduction later.&lt;br /&gt;
&lt;br /&gt;
[[File:E2149_Uml_1.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==OminiAuth Github API update==&lt;br /&gt;
GitHub no longer supports authentication through query parameters. Thus, we move the authentication in the header.&lt;br /&gt;
Starting on September 8 2021, using access_token as a query parameter to access the API (as a user or as a GitHub App) or using client_id/client_secret to make OAuth app unauthenticated calls are disabled. &lt;br /&gt;
&lt;br /&gt;
===Using access_token as a query param===&lt;br /&gt;
Originally, the code makes an API&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?access_token=my_access_token&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Instead, we send the token in the header:&lt;br /&gt;
 curl -H 'Authorization: token my_access_token' https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
===Using client_id/client_secret as a query param===&lt;br /&gt;
Originally, the code uses an OAuth app's client_id and client_secret to make unauthenticated calls with a higher rate limit similar to&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?client_id=my_client_id&amp;amp;client_secret=my_secret_id&amp;quot;&lt;br /&gt;
Instead, we use the following format:&lt;br /&gt;
 curl -u my_client_id:my_client_secret https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down option for Github metric on the page&lt;br /&gt;
:4. Process the page without choosing Github metrics report  for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
Detailed of Github Testing&lt;br /&gt;
After the change of call GitHub API, we need to test get data from the GitHub API.&lt;br /&gt;
&lt;br /&gt;
 describe '#gets data from GitHub api v4(graphql)' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_github_repository_details' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_statuses_for_pull_request' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
=====Previous Project References=====&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141352</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141352"/>
		<updated>2021-11-09T01:07:03Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The functionality of the showing GitHub metrics cannot be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment. The project doesn't report lines added and deleted because of a lack of support from the API. It adds quite a lot of lines of code for a single project. The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Turn on.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the GitHub report of the assignment is turned on or turned off, we need to create a new table named &amp;quot;use_github_metric&amp;quot; to save the id of the assignment which turns on GitHub metric. We also have an alternative solution to add the boolean field in the assignment table, but for security concerns, we give it up we should not influence the data of the assignment.&lt;br /&gt;
&lt;br /&gt;
'''Table: use_github_metric'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|- style=&amp;quot;font-weight:bold;&amp;quot;&lt;br /&gt;
! id(PK)&lt;br /&gt;
! Assignment_id(FK)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 15&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
==== Controller Modification ====&lt;br /&gt;
we will add two functions in the assignment_controller to help update the status of using the Github metric.&lt;br /&gt;
&lt;br /&gt;
def query_github_metric_status&lt;br /&gt;
&lt;br /&gt;
the function will search the assignment_id in the use_github_metric table. If not exist, the Github metric will turn off. Otherwise, it will turn on.&lt;br /&gt;
&lt;br /&gt;
def update_github_metirc&lt;br /&gt;
&lt;br /&gt;
the function will update the status of using the Github metric of assignment and flashes a notice. if turn on the metric, we will add the assignment_id to the table use_github_metric. If turn off we will delete the data.&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as follows:&lt;br /&gt;
&lt;br /&gt;
[[File:Before liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors if they don't choose &amp;quot;use github metric&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
We show the UML for the new classes and model we created and implemented in our final project for a overview. Other than these, we also modified some of the existing classes and method, we will give detailed introduction later.&lt;br /&gt;
&lt;br /&gt;
[[File:E2149_Uml_1.png|800px]]&lt;br /&gt;
&lt;br /&gt;
==OminiAuth Github API update==&lt;br /&gt;
GitHub no longer supports authentication through query parameters. Thus, we move the authentication in the header.&lt;br /&gt;
Starting on September 8 2021, using access_token as a query parameter to access the API (as a user or as a GitHub App) or using client_id/client_secret to make OAuth app unauthenticated calls are disabled. &lt;br /&gt;
&lt;br /&gt;
===Using access_token as a query param===&lt;br /&gt;
Originally, the code makes an API&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?access_token=my_access_token&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Instead, we send the token in the header:&lt;br /&gt;
 curl -H 'Authorization: token my_access_token' https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
===Using client_id/client_secret as a query param===&lt;br /&gt;
Originally, the code uses an OAuth app's client_id and client_secret to make unauthenticated calls with a higher rate limit similar to&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?client_id=my_client_id&amp;amp;client_secret=my_secret_id&amp;quot;&lt;br /&gt;
Instead, we use the following format:&lt;br /&gt;
 curl -u my_client_id:my_client_secret https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
Detailed of Github Testing&lt;br /&gt;
After the change of call GitHub API, we need to test get data from the GitHub API.&lt;br /&gt;
&lt;br /&gt;
 describe '#gets data from GitHub api v4(graphql)' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_github_repository_details' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 describe '#get_statuses_for_pull_request' do&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
=====Previous Project References=====&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141305</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141305"/>
		<updated>2021-11-08T22:35:48Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The functionality of the showing GitHub metrics cannot in the assignment be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment. The project doesn't report lines added and deleted because of a lack of support from the API. It adds quite a lot of lines of code for a single project. The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the GitHub report of the assignment is turned on or turned off, we need to create a new table named &amp;quot;use_github_metric&amp;quot; to save the id of the assignment which turns on GitHub metric.&lt;br /&gt;
&lt;br /&gt;
'''Table: use_github_metric'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|- style=&amp;quot;font-weight:bold;&amp;quot;&lt;br /&gt;
! id(PK)&lt;br /&gt;
! Assignment_id(FK)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 15&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as following:&lt;br /&gt;
&lt;br /&gt;
[[File:Before liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors if they don't choose &amp;quot;use github metric&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
We show the UML for the new classes and model we created and implemented in our final project for a overview. Other than these, we also modified some of the existing classes and method, we will give detailed introduction later.&lt;br /&gt;
&lt;br /&gt;
==OminiAuth Github API update==&lt;br /&gt;
GitHub no longer supports authentication through query parameters. Thus, we move the authentication in the header.&lt;br /&gt;
Starting on September 8 2021, using access_token as a query parameter to access the API (as a user or as a GitHub App) or using client_id/client_secret to make OAuth app unauthenticated calls are disabled. &lt;br /&gt;
&lt;br /&gt;
===Using access_token as a query param===&lt;br /&gt;
Originally, the code makes an API&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?access_token=my_access_token&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Instead, we send the token in the header:&lt;br /&gt;
 curl -H 'Authorization: token my_access_token' https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
===Using client_id/client_secret as a query param===&lt;br /&gt;
Originally, the code uses an OAuth app's client_id and client_secret to make unauthenticated calls with a higher rate limit similar to&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?client_id=my_client_id&amp;amp;client_secret=my_secret_id&amp;quot;&lt;br /&gt;
Instead, we use the following format:&lt;br /&gt;
 curl -u my_client_id:my_client_secret https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
=====Previous Project References=====&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141304</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141304"/>
		<updated>2021-11-08T22:35:35Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The functionality of the showing GitHub metrics cannot in the assignment be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment. The project doesn't report lines added and deleted because of a lack of support from the API. It adds quite a lot of lines of code (&amp;gt; 1500) for a single project. The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the GitHub report of the assignment is turned on or turned off, we need to create a new table named &amp;quot;use_github_metric&amp;quot; to save the id of the assignment which turns on GitHub metric.&lt;br /&gt;
&lt;br /&gt;
'''Table: use_github_metric'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|- style=&amp;quot;font-weight:bold;&amp;quot;&lt;br /&gt;
! id(PK)&lt;br /&gt;
! Assignment_id(FK)&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| 15&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as following:&lt;br /&gt;
&lt;br /&gt;
[[File:Before liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors if they don't choose &amp;quot;use github metric&amp;quot; option.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
We show the UML for the new classes and model we created and implemented in our final project for a overview. Other than these, we also modified some of the existing classes and method, we will give detailed introduction later.&lt;br /&gt;
&lt;br /&gt;
==OminiAuth Github API update==&lt;br /&gt;
GitHub no longer supports authentication through query parameters. Thus, we move the authentication in the header.&lt;br /&gt;
Starting on September 8 2021, using access_token as a query parameter to access the API (as a user or as a GitHub App) or using client_id/client_secret to make OAuth app unauthenticated calls are disabled. &lt;br /&gt;
&lt;br /&gt;
===Using access_token as a query param===&lt;br /&gt;
Originally, the code makes an API&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?access_token=my_access_token&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Instead, we send the token in the header:&lt;br /&gt;
 curl -H 'Authorization: token my_access_token' https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
===Using client_id/client_secret as a query param===&lt;br /&gt;
Originally, the code uses an OAuth app's client_id and client_secret to make unauthenticated calls with a higher rate limit similar to&lt;br /&gt;
 curl &amp;quot;https://api.github.com/user/repos?client_id=my_client_id&amp;amp;client_secret=my_secret_id&amp;quot;&lt;br /&gt;
Instead, we use the following format:&lt;br /&gt;
 curl -u my_client_id:my_client_secret https://api.github.com/user/repos&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
=====Previous Project References=====&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141222</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141222"/>
		<updated>2021-11-08T18:53:11Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The functionality of the showing GitHub metrics cannot in the assignment be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment. The project doesn't report lines added and deleted because of a lack of support from the API. It adds quite a lot of lines of code (&amp;gt; 1500) for a single project. Code size should be reduced. The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new Boolean field named &amp;quot;use_github_metric&amp;quot; in the table of assignments in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as following:&lt;br /&gt;
&lt;br /&gt;
[[File:Before liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
We show the UML for the new classes and model we created and implemented in our final project for a overview. Other than these, we also modified some of the existing classes and method, we will give detailed introduction later.&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
=====Previous Project References=====&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141208</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141208"/>
		<updated>2021-11-08T17:22:15Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* Resources */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The functionality of the showing GitHub metrics cannot in the assignment be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
The project doesn't report lines added and deleted because of a lack of support from the API. It adds quite a lot of lines of code (&amp;gt; 1500) for a single project. Code size should be reduced.&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new Boolean field named &amp;quot;use_github_metric&amp;quot; in the table of assignments in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as following:&lt;br /&gt;
&lt;br /&gt;
[[File:Before liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
We show the UML for the new classes and model we created and implemented in our final project for a overview. Other than these, we also modified some of the existing classes and method, we will give detailed introduction later.&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
=====Previous Project References=====&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141207</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141207"/>
		<updated>2021-11-08T17:21:39Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The functionality of the showing GitHub metrics cannot in the assignment be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
The project doesn't report lines added and deleted because of a lack of support from the API. It adds quite a lot of lines of code (&amp;gt; 1500) for a single project. Code size should be reduced.&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new Boolean field named &amp;quot;use_github_metric&amp;quot; in the table of assignments in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as following:&lt;br /&gt;
&lt;br /&gt;
[[File:Before liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
We show the UML for the new classes and model we created and implemented in our final project for a overview. Other than these, we also modified some of the existing classes and method, we will give detailed introduction later.&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
======Previous Project References======&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141206</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141206"/>
		<updated>2021-11-08T17:20:29Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The functionality of the showing GitHub metrics cannot in the assignment be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
The project doesn't report lines added and deleted because of a lack of support from the API. It adds quite a lot of lines of code (&amp;gt; 1500) for a single project. Code size should be reduced.&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new Boolean field named &amp;quot;use_github_metric&amp;quot; in the table of assignments in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as following:&lt;br /&gt;
&lt;br /&gt;
[[File:Before liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
We show the UML for the new classes and model we created and implemented in our final project for a overview. Other than these, we also modified some of the existing classes and method, we will give detailed introduction later.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
==OmniAuth and Github API==&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
======Previous Project References======&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141204</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141204"/>
		<updated>2021-11-08T17:07:44Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* Assignment edit page view */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The functionality of the showing GitHub metrics cannot in the assignment be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
The project doesn't report lines added and deleted because of a lack of support from the API. It adds quite a lot of lines of code (&amp;gt; 1500) for a single project. Code size should be reduced.&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new Boolean field named &amp;quot;use_github_metric&amp;quot; in the table of assignments in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as following:&lt;br /&gt;
&lt;br /&gt;
[[File:Before liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
&lt;br /&gt;
==OmniAuth and Github API==&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
======Previous Project References======&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141203</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141203"/>
		<updated>2021-11-08T17:07:28Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* Assignment edit page view */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The functionality of the showing GitHub metrics cannot in the assignment be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
The project doesn't report lines added and deleted because of a lack of support from the API. It adds quite a lot of lines of code (&amp;gt; 1500) for a single project. Code size should be reduced.&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new Boolean field named &amp;quot;use_github_metric&amp;quot; in the table of assignments in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as following:&lt;br /&gt;
[[File:Before liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
&lt;br /&gt;
==OmniAuth and Github API==&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
======Previous Project References======&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141202</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141202"/>
		<updated>2021-11-08T17:05:42Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* Assignment edit page view */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The functionality of the showing GitHub metrics cannot in the assignment be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
The project doesn't report lines added and deleted because of a lack of support from the API. It adds quite a lot of lines of code (&amp;gt; 1500) for a single project. Code size should be reduced.&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new Boolean field named &amp;quot;use_github_metric&amp;quot; in the table of assignments in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as following:&lt;br /&gt;
[[File:assignmentedit.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
&lt;br /&gt;
==OmniAuth and Github API==&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
======Previous Project References======&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Before_liang.png&amp;diff=141201</id>
		<title>File:Before liang.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Before_liang.png&amp;diff=141201"/>
		<updated>2021-11-08T17:05:14Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: Xfang22 uploaded a new version of File:Before liang.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141200</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141200"/>
		<updated>2021-11-08T17:03:37Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The functionality of the showing GitHub metrics cannot in the assignment be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
The project doesn't report lines added and deleted because of a lack of support from the API. It adds quite a lot of lines of code (&amp;gt; 1500) for a single project. Code size should be reduced.&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new Boolean field named &amp;quot;use_github_metric&amp;quot; in the table of assignments in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as following:&lt;br /&gt;
[[File:Before_liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
&lt;br /&gt;
==OmniAuth and Github API==&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
======Previous Project References======&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141199</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141199"/>
		<updated>2021-11-08T17:03:16Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* Abstract */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The functionality of the showing GitHub metrics cannot in the assignment be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
The project doesn't report lines added and deleted because of a lack of support from the API. It adds quite a lot of lines of code (&amp;gt; 1500) for a single project. Code size should be reduced.&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new Boolean field named &amp;quot;use_github_metric&amp;quot; in the table of assignments in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests. &lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as following:&lt;br /&gt;
[[File:Before_liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
&lt;br /&gt;
==OmniAuth and Github API==&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
======Previous Project References======&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141198</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141198"/>
		<updated>2021-11-08T17:02:20Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* Abstract */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
====Problem Statement====&lt;br /&gt;
The functionality of the showing GitHub metrics cannot in the assignment be turned off, meaning that an instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report. There needs to be a way to turn the report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
The project doesn't report lines added and deleted because of a lack of support from the API. It adds quite a lot of lines of code (&amp;gt; 1500) for a single project. Code size should be reduced.&lt;br /&gt;
&lt;br /&gt;
Test&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new Boolean field named &amp;quot;use_github_metric&amp;quot; in the table of assignments in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests. &lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as following:&lt;br /&gt;
[[File:Before_liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
&lt;br /&gt;
==OmniAuth and Github API==&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
======Previous Project References======&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141197</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141197"/>
		<updated>2021-11-08T16:55:46Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* Adding turn on and turn down option */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
====Problem Statement====&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new Boolean field named &amp;quot;use_github_metric&amp;quot; in the table of assignments in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests. &lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as following:&lt;br /&gt;
[[File:Before_liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
&lt;br /&gt;
==OmniAuth and Github API==&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
======Previous Project References======&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141196</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141196"/>
		<updated>2021-11-08T16:52:36Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* Abstract */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
====Problem Statement====&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off, meaning that the instructor who uses Expertiza for writing assignments in an English course would also get a Github metrics report. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new Boolean field named &amp;quot;use_github_metric&amp;quot; in the table of assignments in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests. &lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as following:&lt;br /&gt;
[[File:Before_liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
&lt;br /&gt;
==OmniAuth and Github API==&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
======Previous Project References======&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141195</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141195"/>
		<updated>2021-11-08T16:52:08Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* Abstract */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
'''Problem Statement'''&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off, meaning that the instructor who uses Expertiza for writing assignments in an English course would also get a Github metrics report. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new Boolean field named &amp;quot;use_github_metric&amp;quot; in the table of assignments in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests. &lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as following:&lt;br /&gt;
[[File:Before_liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
&lt;br /&gt;
==OmniAuth and Github API==&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
======Previous Project References======&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141194</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141194"/>
		<updated>2021-11-08T16:51:58Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;Problem Statement&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off, meaning that the instructor who uses Expertiza for writing assignments in an English course would also get a Github metrics report. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new Boolean field named &amp;quot;use_github_metric&amp;quot; in the table of assignments in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests. &lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as following:&lt;br /&gt;
[[File:Before_liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
&lt;br /&gt;
==OmniAuth and Github API==&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
======Previous Project References======&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141193</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141193"/>
		<updated>2021-11-08T16:51:29Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off, meaning that the instructor who uses Expertiza for writing assignments in an English course would also get a Github metrics report. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new Boolean field named &amp;quot;use_github_metric&amp;quot; in the table of assignments in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests. &lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as following:&lt;br /&gt;
[[File:Before_liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
&lt;br /&gt;
==OmniAuth and Github API==&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
======Previous Project References======&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141192</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141192"/>
		<updated>2021-11-08T16:50:28Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* Abstract */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off, meaning that the instructor who uses Expertiza for writing assignments in an English course would also get a Github metrics report. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new Boolean field named &amp;quot;use_github_metric&amp;quot; in the table of assignments in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests. &lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
Before we modified this part, this page is as following:&lt;br /&gt;
[[File:Before_liang.png|900px]]&lt;br /&gt;
&lt;br /&gt;
After modifying it, this page is:&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
&lt;br /&gt;
==OmniAuth and Github API==&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
======Previous Project References======&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141189</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141189"/>
		<updated>2021-11-08T16:46:15Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* Frontend modification */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features based on design patterns and MVC principles. Additionally, the team will investigate DRYing the code using existing graphing functionality, and complete analysis of the automated testing for existing and new code.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off, meaning that the instructor who uses Expertiza for writing assignments in an English course would also get a Github metrics report. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new Boolean field named &amp;quot;use_github_metric&amp;quot; in the table of assignments in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend Modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests. &lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
&lt;br /&gt;
==OmniAuth and Github API==&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
======Previous Project References======&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141188</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141188"/>
		<updated>2021-11-08T16:46:05Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* Team Action Items */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features based on design patterns and MVC principles. Additionally, the team will investigate DRYing the code using existing graphing functionality, and complete analysis of the automated testing for existing and new code.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off, meaning that the instructor who uses Expertiza for writing assignments in an English course would also get a Github metrics report. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Database Modification ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new Boolean field named &amp;quot;use_github_metric&amp;quot; in the table of assignments in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests. &lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
&lt;br /&gt;
==OmniAuth and Github API==&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
======Previous Project References======&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141187</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141187"/>
		<updated>2021-11-08T16:44:48Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features based on design patterns and MVC principles. Additionally, the team will investigate DRYing the code using existing graphing functionality, and complete analysis of the automated testing for existing and new code.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off, meaning that the instructor who uses Expertiza for writing assignments in an English course would also get a Github metrics report. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Adding field of assignment in the database ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new Boolean field named &amp;quot;use_github_metric&amp;quot; in the table of assignments in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests. &lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
&lt;br /&gt;
==OmniAuth and Github API==&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
======Previous Project References======&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141185</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141185"/>
		<updated>2021-11-08T16:44:00Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* Resources */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features based on design patterns and MVC principles. Additionally, the team will investigate DRYing the code using existing graphing functionality, and complete analysis of the automated testing for existing and new code.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off, meaning that the instructor who uses Expertiza for writing assignments in an English course would also get a Github metrics report. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Adding field of assignment in the database ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new Boolean field named &amp;quot;use_github_metric&amp;quot; in the table of assignments in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests. &lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
&lt;br /&gt;
==OmniAuth and Github API==&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
==Non-Project Bugfixes==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Deprecating API authentication through query parameters]&lt;br /&gt;
&lt;br /&gt;
======Previous Project References======&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration E2111 Project Refactoring]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141184</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141184"/>
		<updated>2021-11-08T16:42:32Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features based on design patterns and MVC principles. Additionally, the team will investigate DRYing the code using existing graphing functionality, and complete analysis of the automated testing for existing and new code.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off, meaning that the instructor who uses Expertiza for writing assignments in an English course would also get a Github metrics report. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Adding field of assignment in the database ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new Boolean field named &amp;quot;use_github_metric&amp;quot; in the table of assignments in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests. &lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
&lt;br /&gt;
==OmniAuth and Github API==&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
==Non-Project Bugfixes==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;br /&gt;
&lt;br /&gt;
[https://docs.github.com/en/rest Github API Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/]&lt;br /&gt;
&lt;br /&gt;
'''Previous Project References'''&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2018-_Project_E1858._Github_metrics_integration Original E1858 Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1983._Refactor_E1858,_Github_metrics_integration_view E1983 Revision Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2111._Refactor_github_metrics_integration]&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141183</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141183"/>
		<updated>2021-11-08T16:30:55Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* Team Action Items */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features based on design patterns and MVC principles. Additionally, the team will investigate DRYing the code using existing graphing functionality, and complete analysis of the automated testing for existing and new code.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off, meaning that the instructor who uses Expertiza for writing assignments in an English course would also get a Github metrics report. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Adding field of assignment in the database ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new Boolean field named &amp;quot;use_github_metric&amp;quot; in the table of assignments in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests. &lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
&lt;br /&gt;
==OmniAuth and Github API==&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
==Non-Project Bugfixes==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141182</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141182"/>
		<updated>2021-11-08T16:27:49Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* Team Action Items */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features based on design patterns and MVC principles. Additionally, the team will investigate DRYing the code using existing graphing functionality, and complete analysis of the automated testing for existing and new code.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off, meaning that the instructor who uses Expertiza for writing assignments in an English course would also get a Github metrics report. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Adding field of assignment in the database ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new boolean column &amp;quot;use_github_metric&amp;quot; in the table of assignments in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests. &lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
&lt;br /&gt;
==OmniAuth and Github API==&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
==Non-Project Bugfixes==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141181</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141181"/>
		<updated>2021-11-08T16:16:28Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features based on design patterns and MVC principles. Additionally, the team will investigate DRYing the code using existing graphing functionality, and complete analysis of the automated testing for existing and new code.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down option ====&lt;br /&gt;
The functionality of the current project cannot be turned off, meaning that the instructor who uses Expertiza for writing assignments in an English course would also get a Github metrics report. We will provide an option for instructors not to query Github metrics data before they post the assignment, which is the way we turn the GitHub report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Adding field of assignment in the database ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new field in the table of assignment in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend modification ====&lt;br /&gt;
If a user chose not to include the GitHub metric in the assignment (the functionality is turned off), the frontend page should not occur the icon named &amp;quot;Login to Query of Github data&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests. &lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
&lt;br /&gt;
==OmniAuth and Github API==&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
==Non-Project Bugfixes==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141180</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141180"/>
		<updated>2021-11-08T16:07:00Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* Functionality Walk Through */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features based on design patterns and MVC principles. Additionally, the team will investigate DRYing the code using existing graphing functionality, and complete analysis of the automated testing for existing and new code.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down button ====&lt;br /&gt;
The functionality of the current project cannot be turned off, meaning that every instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report.  There needs to be a way to turn the report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Adding field of assignment in the database ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new field in the table of assignment in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend modification ====&lt;br /&gt;
If the function is turned off, the frontend page should not occur the icon named  &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests. &lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|900px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
&lt;br /&gt;
==OmniAuth and Github API==&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
==Non-Project Bugfixes==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141179</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141179"/>
		<updated>2021-11-08T16:06:50Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* Assignment edit page view */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features based on design patterns and MVC principles. Additionally, the team will investigate DRYing the code using existing graphing functionality, and complete analysis of the automated testing for existing and new code.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down button ====&lt;br /&gt;
The functionality of the current project cannot be turned off, meaning that every instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report.  There needs to be a way to turn the report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Adding field of assignment in the database ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new field in the table of assignment in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend modification ====&lt;br /&gt;
If the function is turned off, the frontend page should not occur the icon named  &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests. &lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
&lt;br /&gt;
==OmniAuth and Github API==&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
==Non-Project Bugfixes==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141178</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141178"/>
		<updated>2021-11-08T16:06:35Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* Functionality Walk Through */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features based on design patterns and MVC principles. Additionally, the team will investigate DRYing the code using existing graphing functionality, and complete analysis of the automated testing for existing and new code.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down button ====&lt;br /&gt;
The functionality of the current project cannot be turned off, meaning that every instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report.  There needs to be a way to turn the report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Adding field of assignment in the database ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new field in the table of assignment in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend modification ====&lt;br /&gt;
If the function is turned off, the frontend page should not occur the icon named  &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests. &lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the previous assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the previous assignment edit page. The Login link for querying Github data would not be provided to the instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
&lt;br /&gt;
==OmniAuth and Github API==&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
==Non-Project Bugfixes==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141177</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141177"/>
		<updated>2021-11-08T16:05:20Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* Functionality Walk Through */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features based on design patterns and MVC principles. Additionally, the team will investigate DRYing the code using existing graphing functionality, and complete analysis of the automated testing for existing and new code.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down button ====&lt;br /&gt;
The functionality of the current project cannot be turned off, meaning that every instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report.  There needs to be a way to turn the report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Adding field of assignment in the database ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new field in the table of assignment in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend modification ====&lt;br /&gt;
If the function is turned off, the frontend page should not occur the icon named  &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests. &lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the assignment edit page. The Login link would not be provided to the instructors.&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwogithub.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
&lt;br /&gt;
==OmniAuth and Github API==&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
==Non-Project Bugfixes==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141176</id>
		<title>CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2149._Finish_Github_metrics_integration_-_Reputations&amp;diff=141176"/>
		<updated>2021-11-08T16:03:41Z</updated>

		<summary type="html">&lt;p&gt;Xfang22: /* Functionality Walk Through */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Abstract==&lt;br /&gt;
Expertiza provides teammate reviews to measure how much each team member contributed. It also augments this data with Github data of each group’s submitted repo link to help differentiate the performance of team members for grading purposes and predict which projects are likely to be merged. Instructors would like to compile this Github repository statistics on a per-project, per-team basis, and integrate the display of these data within Expertiza.&lt;br /&gt;
The project team will troubleshoot existing code and add new features based on design patterns and MVC principles. Additionally, the team will investigate DRYing the code using existing graphing functionality, and complete analysis of the automated testing for existing and new code.&lt;br /&gt;
&lt;br /&gt;
==Methodology==&lt;br /&gt;
The team has synced the revised 2021 Spring project E2111 code with the current status of the Expertiza/beta branch and has begun analyzing the existing code. Prior customer feedback has advised the team to address inextensibility/coupling issues, documentation issues, and synchronization issues. We are performing our own end-to-end analysis of the code in addition to this feedback, and have so far found numerous action items. We have separated these action items into Primary and Secondary objectives: Primary objectives are &amp;quot;must-haves&amp;quot; that need to be addressed before the existing code is mergeable. Secondary objectives are &amp;quot;nice-to-haves,&amp;quot; or features that were either left out of the original project or would make the integration display more complete.&lt;br /&gt;
&lt;br /&gt;
==Design Patterns==&lt;br /&gt;
&lt;br /&gt;
To achieve the Primary Objectives while making the application more extensible, the team proposes using a more strict implementation of the '''Adapter'''  design pattern to decouple the details of the Github API from the proposed Metrics model. &lt;br /&gt;
Elements of the '''Observer''' design pattern will also come into play to ensure that once we queried Github data and an assignment has come to a close, the Metric for that Assignment would be unsubscribed from the Github API. This would further decouple the dependency on API data while retaining the data for future statistical analysis and/or research studies.&lt;br /&gt;
&lt;br /&gt;
==Team Action Items==&lt;br /&gt;
&lt;br /&gt;
==== Adding turn on and turn down button ====&lt;br /&gt;
The functionality of the current project cannot be turned off, meaning that every instructor who uses Expertiza for writing assignments in an English course would get a Github metrics report.  There needs to be a way to turn the report off for a particular assignment.&lt;br /&gt;
&lt;br /&gt;
==== Adding field of assignment in the database ====&lt;br /&gt;
In order to determine whether the project report is turned on or turned off, we need to create a new field in the table of assignment in the database to judge the status of the report.&lt;br /&gt;
&lt;br /&gt;
==== Frontend modification ====&lt;br /&gt;
If the function is turned off, the frontend page should not occur the icon named  &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; should not be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Testing ====&lt;br /&gt;
See the details in Test Plan.&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
The tests of the current project are not described very thoroughly. We will run the existing RSpec test code and add some new tests. &lt;br /&gt;
&lt;br /&gt;
=== UI Testing ===&lt;br /&gt;
&lt;br /&gt;
Our UI tests aim to capture the following core pieces of functionality:&lt;br /&gt;
&lt;br /&gt;
'''Turn on and turn down functionality button: '''&lt;br /&gt;
&lt;br /&gt;
In order to test the functionality manually, we follow the following steps:&lt;br /&gt;
:1. Log in to Expertiza as an instructor&lt;br /&gt;
:2. Navigate to assignments through Manage &lt;br /&gt;
:3. Show a turn on/turn down button on the page&lt;br /&gt;
:4. Click the button to turn the Github metrics report off for a particular assignment&lt;br /&gt;
:5. The page should not display &amp;quot;Login to Query of Github data&amp;quot;, &amp;quot;Refresh Github data&amp;quot; and &amp;quot;Assign grade Github metrics&amp;quot; options.&lt;br /&gt;
&lt;br /&gt;
'''Reduce report lines added and deleted:'''&lt;br /&gt;
&lt;br /&gt;
=== Rspec ===&lt;br /&gt;
&lt;br /&gt;
==Functionality Walk Through==&lt;br /&gt;
=== Assignment edit page view ===&lt;br /&gt;
This view is where an instructor can customize an assignment. We will provide an option for instructors to decide whether they need Github metrics in the assignment or not.&lt;br /&gt;
&lt;br /&gt;
[[File:Edit page.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: with Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they chose Github metrics in the assignment edit page and are not yet authenticated to Github. The Login link redirects to an omniauth login screen, which redirects back to this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:listviewwgithub.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== List Submissions View: without Github metrics option===&lt;br /&gt;
This is how a user will view List Submissions when they did not choose Github metrics in the assignment edit page.&lt;br /&gt;
[[File:listviewwogithub.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
==Final Design UML==&lt;br /&gt;
&lt;br /&gt;
==OmniAuth and Github API==&lt;br /&gt;
&lt;br /&gt;
==Methods Added or Modified==&lt;br /&gt;
&lt;br /&gt;
==Non-Project Bugfixes==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
=====Key Links=====&lt;/div&gt;</summary>
		<author><name>Xfang22</name></author>
	</entry>
</feed>