GithubHelp home page GithubHelp logo

isabella232 / ps-project-metrics Goto Github PK

View Code? Open in Web Editor NEW

This project forked from prestashop/ps-project-metrics

0.0 0.0 0.0 254 KB

Collects and displays GitHub review statistics

License: MIT License

Shell 0.16% PHP 14.09% CSS 83.08% Twig 2.68%

ps-project-metrics's Introduction

PrestaShop Project Metrics application

PHPUnit tests PHPStan

Symfony 5 application that collects and displays

  • PrestaShop Maintainers review daily statistics
  • PrestaShop "Waiting for..." daily total statistics
  • PrestaShop "Waiting for review" for how long snapshots
  • PrestaShop pull request review comments statistics

Install

composer install

You need

  • a MySQL database
  • a GitHub token with public access

You need to provide 8 parameters using a .env.local file or environment variables.

APP_ENV=dev
APP_SECRET=...

DATABASE_URL=...

APP_DB_HOST=127.0.0.1
APP_DB_TABLE=reviewstats
APP_DB_USER=...
APP_DB_PASSWORD=...
APP_GH_TOKEN=...

Example

APP_ENV=dev
APP_SECRET=abcdefhejeljdxsjshdjfrhghefjejej

DATABASE_URL="mysql://abcd:[email protected]:9999/review-stats?serverVersion=5.7"

APP_DB_HOST=127.0.0.1
APP_DB_TABLE=review-stats
APP_DB_USER=abcd
APP_DB_PASSWORD=abcd
APP_GH_TOKEN=ghp_abchdksjdkdjfhdjzdjdzdhazdazhduzdhzd

Usage

Browse statistics

Browse / using a webserver to see the dashboard.

If you configure a webserver, do use public as root directory.

Example with Symfony built-in server:

symfony server:start

Collect statistics and manage data

# To collect Maintainers review daily statistics ; run once a day
php bin/console ps:review-stats:record

# To collect "Waiting for..." daily total statistics ; run once a day
php bin/console ps:prs-waiting-stats:record

# To collect "Waiting for review" for how long snapshots ; can be run as often as needed
php bin/console ps:prs-statuses:record

# To collect pull request review comments statistics ; run once a day
php bin/console ps:pr-review-comment-stats:compute

# To delete old pull request review comments ; run once a day
php bin/console ps:pr-review-comment:delete-old

Most commands can be triggered as dry-run (does not persist data) or not. Default is dry-run enabled, so in order to persist the data you need to add --dry-run=false:

php bin/console ps:prs-waiting-stats:record --dry-run=false
php bin/console ps:review-stats:record --dry-run=false

Test

Run tests using phpunit

vendor/bin/phpunit -c phpunit.xml

Some tests do load fixtures powered by a sqlite driver

Run static analysis using phpstan

vendor/bin/phpstan analyse -c phpstan.neon

Documentation

Browse /doc folder

ps-project-metrics's People

Contributors

kpodemski avatar matks avatar progi1984 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.