Skip to content

Commit

Permalink
Fix lead time min bug (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
kincses authored Jan 28, 2022
1 parent f9ed47e commit fda1463
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ go install cmd/vjr/vjr.go

# Usage

Velojiraptor provides various commands. With the `-h` or `--help` flag every command's help can be displayed. Most
commands support different output formats. This can be controlled with the `--format` flag.
Velojiraptor provides various commands. With the `-h` or `--help` flag every command's help can be displayed.

## Search

Expand Down Expand Up @@ -95,3 +94,15 @@ export JIRA_URL=https://baz.atlassian.net

vjr search count --jql "type = bug AND statusCategory NOT IN (Done)"
```

## Formats

Most commands support different output formats. This can be controlled with the `--format` flag.

```bash
# Table
vjr search --jql "project IN (Foo)"
vjr --format table --jql "project IN (Foo)"
# CSV
vjr --format csv search --jql "project IN (Foo)"
```
4 changes: 2 additions & 2 deletions internal/report/lead_time.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ func LeadTime(issues *[]jira.Issue, excludedStatuses []string) LeadTimeReport {
timeInStatusReport := TimeInStatus(issues, excludedStatuses)
min, max, grandTotal := time.Duration(0), time.Duration(0), time.Duration(0)

for _, record := range timeInStatusReport.Summaries {
for i, record := range timeInStatusReport.Summaries {
total := time.Duration(0)

for _, duration := range record.Statuses {
total += duration
}

if min > total || min == 0 {
if min > total || i == 0 {
min = total
}

Expand Down

0 comments on commit fda1463

Please sign in to comment.