leadtime

command module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2023 License: MIT Imports: 2 Imported by: 0

README

Coverage Test Execution Time Go Report Card reviewdog LinuxUnitTest MacUnitTest WindowsUnitTest

leadtime - calculate PR lead time statistics on GitHub

leedtime is a command that outputs statistics about the time it takes for a GitHub Pull Request to be merged. The leadtime command was developed under the influence of the following books.

The motivation for developing the leadtime command is to measure lead time for changes. I used unit test coverage as a measure of software quality. However, as the number of unit tests increased but the code was not rewritten, I questioned whether the quality was improving.

Therefore, I considered measuring lead time, one of the indicators presented in the above book.

How to install

Use "go install"

If you does not have the golang development environment installed on your system, please install golang from the golang official website.

 go install github.com/nao1215/leadtime@latest
Use homebrew (aarch64)
$ brew tap nao1215/tap
$ brew install nao1215/tap/leadtime

How to use

You need to set GitHub access token in environment variable "LT_GITHUB_ACCESS_TOKEN". If you want to check github.com/nao1215/sqly repository, you execute bellow.

$ leadtime stat --owner=nao1215 --repo=sqly
PR      Author  Bot     LeadTime[min]   Title
#29     dependabot[bot] yes     21144   Bump github.com/fatih/color from 1.13.0 to 1.14.1
#28     nao1215 no      12      Change golden pacakge import path
#27     nao1215 no      17      add unit test for infra package
#26     nao1215 no      686     Add basic unit test for shell
#25     dependabot[bot] yes     1850    Bump github.com/google/go-cmp from 0.2.0 to 0.5.9
#24     nao1215 no      6458    Add unit test for model package
#23     nao1215 no      187     Change golden test package from goldie to golden and more
#22     nao1215 no      1       Add sqlite3 syntax completion
#21     nao1215 no      1769    Add unit test for argument paser
#20     nao1215 no      53      Feat dump tsv ltsv json
#19     nao1215 no      6       Add featuer thar print date by markdown table format
#18     nao1215 no      10      Feat import ltsv
#17     nao1215 no      117     Feat import tsv
#15     nao1215 no      57      Fix panic bug when import file that is without extension
#14     nao1215 no      42      Feat import json
#13     nao1215 no      139     Fix input delays when increasing records
#12     nao1215 no      18      Add header command
#11     nao1215 no      1552    Fixed a display collapse problem when multiple lines are entered
#10     nao1215 no      4       Fixed a bug that caused SQL to fail if there was a trailing semicolon
#9      nao1215 no      29      Add move cursor function in intaractive shell
#8      nao1215 no      3       Fixed a bug in which the wrong arguments were used
#7      nao1215 no      76      Added CSV output mode
#6      nao1215 no      222     Improve execute query
#5      nao1215 no      498     Add history usecase, repository, infra. sqly manage history by sqlite3
#4      nao1215 no      139     Add function that execute select query
#3      nao1215 no      37      Add import command
#2      nao1215 no      57      Add .tables command
#1      nao1215 no      127     Add .exit/.help command and history manager

[statistics]
 Total PR       = 28
 Lead Time(Max) = 21144[min]
 Lead Time(Min) = 1[min]
 Lead Time(Sum) = 35310[min]
 Lead Time(Ave) = 1261.07[min]
 Lead Time(Median) = 66.50[min]
markdown format output

If you change output format to markdown, you use --markdown option. Markdown output sample is here.

$ leadtime stat --owner=nao1215 --repo=gup --markdown

Features to be added

  • CSV output format
  • JSON output format
  • Markdown file output
  • Output to file
  • Supports GitHub Actions
  • Exclude the bot's PR
  • faster by goroutine

Contributing / Contact

First off, thanks for taking the time to contribute! heart Contributions are not only related to development. For example, GitHub Star motivates me to develop!

Star History Chart

If you would like to send comments such as "find a bug" or "request for additional features" to the developer, please use one of the following contacts.

LICENSE

The leadtime project is licensed under the terms of MIT LICENSE.

Documentation

Overview

Package main is leadtime command entrypoint.

Directories

Path Synopsis
Package config get setting from environment variable or configuration file.
Package config get setting from environment variable or configuration file.
domain
model
Package model is domain model and business logic.
Package model is domain model and business logic.
infrastructure
github
Package github is http client for GitHub API.
Package github is http client for GitHub API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL