Skip to content

Commit

Permalink
status: Print overview for all teams and per team
Browse files Browse the repository at this point in the history
Add some extra logging to get a better sense for how many members and
teams are present in an organization, and print per-team the active
member rate.

Signed-off-by: Joe Stringer <[email protected]>
  • Loading branch information
joestringer authored and aanm committed Dec 2, 2024
1 parent 64f98e2 commit 8119170
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/team/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,9 @@ func CheckRepoSync(localCfg, upstreamCfg *config.Config) error {

func (tm *Manager) CheckUserStatus(ctx context.Context, localCfg *config.Config) error {
busyMembers := map[string]struct{}{}

fmt.Printf("Found %d teams with %d unique members\n", len(localCfg.AllTeams), len(localCfg.Members))

for member := range localCfg.Members {
fmt.Printf("Checking status of %q\n", member)
status, err := tm.fetchMemberLimitedAvailability(ctx, member)
Expand Down Expand Up @@ -506,6 +509,8 @@ func (tm *Manager) CheckUserStatus(ctx context.Context, localCfg *config.Config)
}
}

fmt.Printf("Team %q has the following active member ratio: %d/%d.\n", teamName, len(team.Members)-unavailableMembers, len(team.Members))

// Warn if there teams that have less than two people to review
if len(team.Members)-1 <= unavailableMembers {
if len(team.Members) <= 1 && unavailableMembers == 0 {
Expand Down

0 comments on commit 8119170

Please sign in to comment.