CSC/ECE 517 Fall 2024 - E2457. GitHub metrics

From Expertiza_Wiki
Revision as of 17:44, 12 November 2024 by Kdai2 (talk | contribs)
Jump to navigation Jump to search

About Expertiza

Expertiza is a web-based, open-source educational platform built with Ruby on Rails by students and faculty at NC State University. It enables instructors to create flexible assignments that students can select based on their interests and supports team-based projects with a robust peer review system. Through peer evaluations, students gain critical feedback, enhancing self-improvement skills. With support for diverse submission types, Expertiza adapts easily to various assignment formats and teaching approaches.

Problem Statement

Expertiza currently has team reviews to measure how much each team member contributed to a project. However, it would be useful to instructors to be able to see github metrics on expertiza for each group to corroborate the team reviews. These metrics include number of commits, number of lines of code modified, number of lines added, and number of lines deleted.

Background

The main objective of the project is to refactor the code written by the Spring 2023 team for displaying github metrics. The main issue with this team's code is that metrics_controller.rb is too bloated as it has logic that should be in the model as well as having too many github specific methods. Since other metrics could be used in the future, a metrics_controller should be general. In addition, several method names are confusing and need to be renamed, and several methods adhere to the Single Responsibility Principle and so need to be split into multiple methods. Lastly, testing and comments on tests need to be improved.

Changes to metrics_controller.rb

Removing Github Specific Methods

The following functions are all github specific and should not live inside metrics_controller.rb. Instead they will be moved to github_metrics_controller.rb github_metrics_for_submission retrieve_github_data query_all_pull_requests pull_request_data parse_pull_request_data query_all_merge_statuses retrieve_repository_data parse_repository_data query_commit_statistics query_pull_request_status find_user_by_github_email authorize_github

Moving Methods out of the Controller

Testing

To ensure the functionality and reliability of the updates, automated testing was implemented using GitHub Actions. All tests were executed with the command bundle exec rspec spec/, which allowed the full suite of tests to be ran, giving confirmation that the changes met the expected standards without introducing regressions.

Link to the changes here.


Team

Members

  • Brandon Walia
  • Kevin Dai
  • Manav Patel

Mentor

  • Dr. Ed Gehringer