Quickstart

This project uses the Hexagonal Architecture pattern and is designed to extract information from GitHub, GitLab, Bitbucket, and Azure DevOps. This information is stored, processed and analyzed automatically, allowing the calculation of important indicators for a project or team.

Project structure

The code is structured into three main packages:

  • Application: This package contains all the application layer code which determines how the various components of the system interact with each other. It contains various services, controllers, and ports implementation to handle incoming data.
  • Domain: The domain package contains business logic, models, and interfaces (Ports). Business rules and logic reside in this package, which allows these rules and logic to be technology-agnostic.
  • Framework: The framework package includes the technology-specific implementation of the system. This is where the details about data sources, databases, APIs, etc., are implemented.

Data Flow

The process for data retrieval and handling is as follows:

  • The system receives payload data from a webhook (GitHub webhook, GitLab webhook, Azure DevOps webhook, Bitbucket webhook).
  • The system checks the payload for necessary data, if some data, for example, the stats from the commits, are missing in the payload, the system triggers a call to the API (GitHub API, GitLab API, Azure DevOps API, Bitbucket API) to fetch the missing data.
  • The extracted data is then processed and used as needed in the client port.

Requirements

  • Java 17
  • Docker
  • Intellij/Eclipse
  • Mongodb Compass

General Settings

Environment variables that must be configured in the project.

  • MONGODB Environment variable that stores the value of the connection url to the Database example: mongodb+srv://username:[email protected]/performance-persistence
  • AUTH_BASIC_USERNAME Username for connection to the API
  • AUTH_BASIC_PASSWORD Password for connection to the API
  • PROFILES_DEFAULT Environment variable that stores the value of the profiles or platforms to process
  • LICENSE_API_APP_KEY Connection key with the license API

GitHub Settings

Environment variables that must be configured in the project for GitHub

  • GITHUB_ORGANIZATION Environment variable that stores the value of the workspace to process
  • GITHUB_ENTERPRISE Environment variable that stores the value of the GitHub enterprise to process
  • GITHUB_WEBHOOK_SECRET Environment variable that stores the secret key value to process webhooks
  • GITHUB_TOKEN Environment variable that stores the value of the token for the connection to GRAPHQL and API

GitLab Settings

Environment variables that must be configured in the project for GitLab

  • GITLAB_CLIENT_AUTHORIZATION Environment variable that stores the value of the token to connect to the API

Azure DevOps Settings

Environment variables that must be configured in the project for Azure DevOps

  • AZURE_DEVOPS_TOKEN Environment variable that stores the value of the token to connect to the API
  • AZURE_DEVOPS_ORGANIZATION Environment variable that stores the value of the workspace to process, and the token should be created by Team Project Administrator Role.

Bitbucket Settings

Environment variables that must be configured in the project for Bitbucket

  • BITBUCKET_CLIENT_ID Environment variable that stores the value of the user's KEY token to connect to the API
  • BITBUCKET_CLIENT_SECRET Environment variable that stores the value of the user's SECRET token to connect to the API
  • BITBUCKET_WORKSPACE Environment variable that stores the value of the workspace to process

GitHub Copilot Settings

Environment variables that must be configured in the project for obtain GitHub Copilot metrics usage

  • COPILOT_ENTERPRISE Environment variable that stores the value of the GitHub Copilot enterprise to process

  • COPILOT_ORGANIZATION Environment variable that stores the value of the GitHub Copilot organization to process

  • COPILOT_TOKEN Environment variable that stores the value of the OAuth app tokens for the connection

  • COPILOT_METRICS_LEVEL Environment variable that indicates the load level of the metrics

  • To create a new OAuth app, go to the GitHub Developer settings.

Jira Settings

Environment variables that must be configured in the project for Jira

  • JIRA_URL Environment variable with the connection URL to Jira
  • JIRA_TOKEN Environment variable with the token to connect
  • JIRA_USER Environment variable with the user's email associated with the token to connect