Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify; always take issues with updates in the last 7d into account for busyness #34

Merged
merged 2 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading