feat(grafana dashboard): add PR review rounds

1.add charts PR review rounds
2.change the calculation method of PR review time
3.updated the icons
11 files changed
tree: 58256c80ee78d18fa8c5a22213d60ee675924b8f
  1. .github/
  2. api/
  3. cmd/
  4. config/
  5. config-ui/
  6. devops/
  7. docs/
  8. errors/
  9. grafana/
  10. logger/
  11. models/
  12. plugins/
  13. scripts/
  14. services/
  15. test/
  16. utils/
  17. .editorconfig
  18. .env.example
  19. .gitignore
  20. CONTRIBUTING.md
  21. docker-compose.yml
  22. Dockerfile
  23. go.mod
  24. go.sum
  25. main.go
  26. Makefile
  27. README.md
  28. zoneinfo.zip
README.md

Dev Lake

PRs Welcome Discord badge

What is Dev Lake?

Dev Lake is the one-stop solution that integrates, analyzes, and visualizes software development data throughout the software development life cycle (SDLC) for engineering teams.

Why choose Dev Lake?

  1. Supports various data sources (Gitlab, Jira) and more are being added all the time
  2. Relevant, customizable data metrics ready to view as visual charts
  3. Easily build and view new charts and dashboards with Grafana
  4. Easy-to-setup via Docker
  5. Extensible plugin system to add your own data collectors
  6. Designed to process enterprise-scale data

Contents

SectionDescriptionDocumentation Link
Data SourcesLinks to specific plugin usage & detailsView Section
GrafanaHow to visualize the dataView Section
RequirementsUnderlying software usedView Section
SetupSteps to setup the projectView Section
MigrationsCommands for running migrationsView Section
TestsCommands for running testsView Section
⚠️ (WIP) Build a PluginDetails on how to make your ownLink
⚠️ (WIP) Add Plugin MetricsGuide to adding plugin metricsLink
ContributingHow to contribute to this repoLink

⚠️ (WIP) Data Sources We Currently Support

Below is a list of data source plugins used to collect & enrich data from specific sources. Each have a README.md file with basic setup, troubleshooting and metrics info.

For more information on building a new data source plugin see Build a Plugin.

SectionSection InfoDocs
JiraMetrics, Generating API Token, Find Project/Board IDLink
GitlabMetrics, Generating API TokenLink
JenkinsMetricsLink

Grafana

We use Grafana as a visualization tool to build charts for the data stored in our database. Using SQL queries we can add panels to build, save, and edit customized dashboards.

All the details on provisioning, and customizing a dashboard can be found in the Grafana Doc


Development Requirements

  • Docker
  • Golang
  • Make
    • Mac (Already installed)
    • Windows: Download
    • Ubuntu: sudo apt-get install build-essential

User setup

NOTE: If you only plan to run the product, this is the only section you should need NOTE: Commands written like this are to be run in your terminal

Required Packages to Install

NOTE: After installing docker, you may need to run the docker application and restart your terminal

Commands to run in your terminal

  1. Create a directory and download files

    git clone https://github.com/merico-dev/lake.git devlake
    cd devlake
    git checkout go-main
    cp .env.example .env
    
  2. Open .env file with your editor, fill the values in Jira, Gitlab and Jenkins sections with your deployments.

For more info on how to configure plugins, please refer to the data source plugins section

  1. Launch docker-compose

    docker-compose up
    
  2. Create a http request to trigger data collect tasks, please replace your gitlab projectId and jira boardId in the request body. This can take up to 20 minutes for large projects. (gitlab 10k+ commits or jira 5k+ issues)

    curl -XPOST 'http://localhost:8080/task' \
    -H 'Content-Type: application/json' \
    -d '[
        {
            "plugin": "gitlab",
            "options": {
                "projectId": 8967944
            }
        },
        {
            "plugin": "jira",
            "options": {
                "boardId": 8
            }
        },
        {
            "plugin": "jenkins",
            "options": {}
        }
    ]'
    
  3. Navigate to grafana dashboard http://localhost:3002 (username: admin, password: admin).

Setup cron job

Commonly, we have requirement to synchorize data periodly. We providered a tool called lake-cli to meet that requirement. Check lake-cli usage at here.

Otherwise, if you just want to use the cron job, please check docker-compose version at here

Development Setup

  1. Navigate to where you would like to install this project and clone the repository

    git clone https://github.com/merico-dev/lake.git
    cd lake
    
  2. Install go packages

    make install
    
  3. Copy sample config files to new local file

    cp .env.example .env
    
  4. Start the docker containers

    Make sure the docker application is running before this step

    make compose
    
  5. Run the project

    make dev
    
  6. You can now post to /task to create a jira task. This will collect data from Jira

    curl -XPOST 'localhost:8080/task' \
    -H 'Content-Type: application/json' \
    -d '[{
        "plugin": "jira",
        "options": {
            "boardId": 8
        }
    }]'
    
  7. Collect & enrich data from selected sources and plugins

    These plugins can be selected from the above list (View List), and options for them will be outlined in their specific document.

    Example:

    curl -XPOST 'localhost:8080/source' \
    -H 'Content-Type: application/json' \
    -d '[{
        "plugin": "Jira",
        "options": {}
    
    }]'
    
  8. Visualize the data in the Grafana Dashboard

    From here you can see existing data visualized from collected & enriched data

    • Navigate to http://localhost:3002 (username: admin, password: admin)
    • You can also create/modify existing/save dashboards to lake
    • For more info on working with Grafana in Dev Lake see Grafana Doc

⚠️ (WIP) Migrations

  • Make a migration: <>
  • Migrate your DB: <>
  • Undo a migration: <>

Tests

Sample tests can be found in /test/example

To run the tests: make test

Contributing

CONTRIBUTING.md

Need help?

Message us on Discord

Architecture Layers

Stack (from low to high)

  1. config
  2. logger
  3. models
  4. plugins
  5. services
  6. api / cli

Rules

  1. Higher layer calls lower layer, not the other way around
  2. Whenever lower layer neeeds sth from higher layer, a interface should be introduced for decoupling
  3. Components should be initialized in a low to high order during bootstraping