CSC/ECE 517 Spring 2024 - G2400 DevOp for GitHub Miner app: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
Line 38: Line 38:
## Identify the correct container to run the steps
## Identify the correct container to run the steps
## Identify the correct actions, one for linting and one for testing, to make up the workflow
## Identify the correct actions, one for linting and one for testing, to make up the workflow
## Identify the correct outcomes for failing each stage and how to configure them
# Place the file into a .github/workflows/ folder in the project root
# Place the file into a .github/workflows/ folder in the project root
# Commit the change
# Commit the change
Line 46: Line 47:
# Verifying using the GUI that there are no errors noted
# Verifying using the GUI that there are no errors noted
# Verify that the unit tests for the project are ran and a coverage report is created
# Verify that the unit tests for the project are ran and a coverage report is created


== Team Members ==
== Team Members ==

Revision as of 23:27, 5 April 2024

GitHub Miner

GitHub Miner is a tool for querying GitHub APIs and returning useful information.


Installation

GitHub Miner is written in Python and can be installed locally using a virtual environment (venv) or using Docker.

To use Docker: Ensure that you have Docker installed Update the GITHUB_OAUTH_CLIENT_ID and GITHUB_OAUTH_CLIENT_SECRET values in the docker-compose.yml file based on the instructions here Optionally - add a value for the SECRET_KEY in the docker-compose.yml file. See the explanation here on secret key values. Run docker compose up.


Testing

The scope of our project was to create a Docker container for the main GitHub miner app and a docker-compose file to run the app and a MySQL container. As such, creating automated tests was not within the scope of our work. Manual tests were completed by:

  1. Running
    docker compose up 
  2. Verifying that an application container and a mysql container were both created.
  3. Running
    docker exec ghminer flask db upgrade 
    to migrate the database.
  4. Running
    docker exec ghminer python -m backend.scripts.seed_db 
    to seed the database.
  5. Opening a browser and navigating to http://localhost:5000/test-insert/2/john_doe
  6. Navigating to http://localhost:5000/test-retrive/2

Final Project Design

Problem: The project has no linters to enforce stylistic guidelines and users must remember to manually trigger unit tests after code updates and before code changes are merged in GitHub.

Solution: For the final project, we will be creating a ci/cd process that will lint the project code and run the unit tests.

To accomplish this, we will be using GitHub Actions. This will require us to:

  1. Create a workflow configuration .yaml file that lays out the process steps and their order
    1. Identify the correct runner (environment) to run the cicd process
    2. Identify the correct container to run the steps
    3. Identify the correct actions, one for linting and one for testing, to make up the workflow
    4. Identify the correct outcomes for failing each stage and how to configure them
  2. Place the file into a .github/workflows/ folder in the project root
  3. Commit the change

Due to the nature of the project, there is no way to run automated tests against the .yaml file outside of linting. Manual verification will be completed by:

  1. Navigating to the Actions tab in the project repository in GitHub
  2. Verifying using the GUI that there are no errors noted
  3. Verify that the unit tests for the project are ran and a coverage report is created

Team Members

Tanner Neff

Andrew Robie

Srinish Pellakur


Mentor: Jialin Cui