Skip to content

Commit

Permalink
Merge pull request #34 from grafana/simplify
Browse files Browse the repository at this point in the history
simplify; always take issues with updates in the last 7d into account for busyness
  • Loading branch information
replay authored May 13, 2024
2 parents 4cf2bb2 + b7fc7ee commit 8967f10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ Calendars are accessed either via a public ical feed or via google calendar api

#### Determine busyness of individual members of a team

Busyness of team members is calculated by the amount of issues someone is assigned to and which got updated in the past 5 days (not configurable at the moment). Issues updated in this timeframe are taken into account if
Busyness of team members is calculated by the amount of issues someone is assigned to and which got updated in the past 7 days (not configurable at the moment). Issues updated in this timeframe are taken into account if
* Open issues: If they don't contain any of the labels which are configured to be ignored. This allows for example to ignore issues which got marked as `stale`
* Closed issues: If they were closed within the lookback time (5 days).
* Closed issues: If they were closed within the lookback time (7 days).

The higher this count, the more busy an individual team member is seen compared to other members.

Expand Down
7 changes: 1 addition & 6 deletions pkg/icassigner/busyness/busyness.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,7 @@ func CalculateBusynessForTeam(ctx context.Context, now time.Time, githubClient *
}

func calculateBusynessForTeam(ctx context.Context, now time.Time, bA busynessClient, members []string) Report {
// calculate lookback time. If we are on a time shortly after the weekend we'll extend to lookback by 2 days to account for weekends
// TODO: Should this be configurable?
since := now.Add(-5 * 24 * time.Hour)
if since.Weekday() == time.Saturday || since.Weekday() == time.Sunday {
since = since.Add(-2 * 24 * time.Hour)
}
since := now.Add(-7 * 24 * time.Hour)

addMember := func(b map[int][]string, m string, busyness int) {
v, ok := b[busyness]
Expand Down

0 comments on commit 8967f10

Please sign in to comment.