func (r *RunStats) SetSkipPullRequests(skipPullRequests bool) {
	r.skipPullRequests = skipPullRequests
}
SetSkipPullRequests tracks whether the user specified that pull requests should be skipped (in favor of committing and pushing directly to the specified branch)
package stats
import (
	"sync"
	"time"
	"github.com/google/go-github/v32/github"
	"github.com/gruntwork-io/git-xargs/printer"
	"github.com/gruntwork-io/git-xargs/types"
)
const (
	DryRunSet types.Event = "dry-run-set-no-changes-made"
	ReposSelected types.Event = "repos-selected-pre-processing"
	ReposArchivedSkipped types.Event = "repos-archived-skipped"
	TargetBranchNotFound types.Event = "target-branch-not-found"
	TargetBranchAlreadyExists types.Event = "target-branch-already-exists"
	TargetBranchLookupErr types.Event = "target-branch-lookup-err"
	TargetBranchSuccessfullyCreated types.Event = "target-branch-successfully-created"
	FetchedViaGithubAPI types.Event = "fetch-via-github-api"
	RepoSuccessfullyCloned types.Event = "repo-successfully-cloned"
	RepoFailedToClone types.Event = "repo-failed-to-clone"
	BranchCheckoutFailed types.Event = "branch-checkout-failed"
	GetHeadRefFailed types.Event = "get-head-ref-failed"
	CommandErrorOccurredDuringExecution types.Event = "command-error-during-execution"
	WorktreeStatusCheckFailed types.Event = "worktree-status-check-failed"
	WorktreeStatusCheckFailedCommand = "worktree-status-check-failed-command"
	WorktreeStatusDirty types.Event = "worktree-status-dirty"
	WorktreeStatusClean types.Event = "worktree-status-clean"
	WorktreeAddFileFailed types.Event = "worktree-add-file-failed"
	CommitChangesFailed types.Event = "commit-changes-failed"
	PushBranchFailed types.Event = "push-branch-failed"
	PushBranchSkipped types.Event = "push-branch-skipped"
	RepoNotExists types.Event = "repo-not-exists"
	PullRequestOpenErr types.Event = "pull-request-open-error"
	PullRequestAlreadyExists types.Event = "pull-request-already-exists"
	CommitsMadeDirectlyToBranch types.Event = "commits-made-directly-to-branch"
	DirectCommitsPushedToRemoteBranch types.Event = "direct-commits-pushed-to-remote"
	BranchRemotePullFailed types.Event = "branch-remote-pull-failed"
	BranchRemoteDidntExistYet types.Event = "branch-remote-didnt-exist-yet"
	RepoFlagSuppliedRepoMalformed types.Event = "repo-flag-supplied-repo-malformed"
)
var allEvents = []types.AnnotatedEvent{
	{Event: FetchedViaGithubAPI, Description: "Repos successfully fetched via Github API"},
	{Event: DryRunSet, Description: "Repos that were not modified in any way because this was a dry-run"},
	{Event: ReposSelected, Description: "All repos that were targeted for processing AFTER filtering missing / malformed repos"},
	{Event: ReposArchivedSkipped, Description: "All repos that were filtered out with the --skip-archived-repos flag"},
	{Event: TargetBranchNotFound, Description: "Repos whose target branch was not found"},
	{Event: TargetBranchAlreadyExists, Description: "Repos whose target branch already existed"},
	{Event: TargetBranchLookupErr, Description: "Repos whose target branches could not be looked up due to an API error"},
	{Event: RepoSuccessfullyCloned, Description: "Repos that were successfully cloned to the local filesystem"},
	{Event: RepoFailedToClone, Description: "Repos that were unable to be cloned to the local filesystem"},
	{Event: BranchCheckoutFailed, Description: "Repos for which checking out a new tool-specific branch failed"},
	{Event: GetHeadRefFailed, Description: "Repos for which the HEAD git reference could not be obtained"},
	{Event: CommandErrorOccurredDuringExecution, Description: "Repos for which the supplied command raised an error during execution"},
	{Event: WorktreeStatusCheckFailed, Description: "Repos for which the git status command failed following command execution"},
	{Event: WorktreeStatusDirty, Description: "Repos that showed file changes to their working directory following command execution"},
	{Event: WorktreeStatusClean, Description: "Repos that showed NO file changes to their working directory following command execution"},
	{Event: CommitChangesFailed, Description: "Repos whose file changes failed to be committed for some reason"},
	{Event: PushBranchFailed, Description: "Repos whose tool-specific branch containing changes failed to push to remote origin"},
	{Event: PushBranchSkipped, Description: "Repos whose local branch was not pushed because the --dry-run flag was set"},
	{Event: RepoNotExists, Description: "Repos that were supplied by user but don't exist (404'd) via Github API"},
	{Event: PullRequestOpenErr, Description: "Repos against which pull requests failed to be opened"},
	{Event: PullRequestAlreadyExists, Description: "Repos where opening a pull request was skipped because a pull request was already open"},
	{Event: CommitsMadeDirectlyToBranch, Description: "Repos whose local changes were committed directly to the specified branch because --skip-pull-requests was passed"},
	{Event: DirectCommitsPushedToRemoteBranch, Description: "Repos whose changes were pushed directly to the remote branch because --skip-pull-requests was passed"},
	{Event: BranchRemotePullFailed, Description: "Repos whose remote branches could not be successfully pulled"},
	{Event: BranchRemoteDidntExistYet, Description: "Repos whose specified branches did not exist on the remote, and so were first created locally"},
	{Event: RepoFlagSuppliedRepoMalformed, Description: "Repos passed via the --repo flag that were malformed (missing their Github org prefix?) and therefore unprocessable"},
}
type RunStats struct {
	selectionMode         string
	repos                 map[types.Event][]*github.Repository
	skippedArchivedRepos  map[types.Event][]*github.Repository
	pulls                 map[string]string
	command               []string
	fileProvidedRepos     []*types.AllowedRepo
	repoFlagProvidedRepos []*types.AllowedRepo
	startTime             time.Time
	skipPullRequests      bool
	mutex                 *sync.Mutex
}
func NewStatsTracker() *RunStats {
	var fileProvidedRepos []*types.AllowedRepo
	var repoFlagProvidedRepos []*types.AllowedRepo
	t := &RunStats{
		repos:                 make(map[types.Event][]*github.Repository),
		skippedArchivedRepos:  make(map[types.Event][]*github.Repository),
		pulls:                 make(map[string]string),
		command:               []string{},
		fileProvidedRepos:     fileProvidedRepos,
		repoFlagProvidedRepos: repoFlagProvidedRepos,
		startTime:             time.Now(),
		skipPullRequests:      false,
		mutex:                 &sync.Mutex{},
	}
	return t
}
func (r *RunStats) SetSelectionMode(mode string) {
	r.selectionMode = mode
}
func (r *RunStats) GetSelectionMode() string {
	return r.selectionMode
}
func (r *RunStats) GetTotalRunSeconds() int {
	s := time.Since(r.startTime).Seconds()
	return int(s) % 60
}
func (r *RunStats) GetRepos() map[types.Event][]*github.Repository {
	return r.repos
}
func (r *RunStats) GetSkippedArchivedRepos() map[types.Event][]*github.Repository {
	return r.skippedArchivedRepos
}
func (r *RunStats) GetPullRequests() map[string]string {
	return r.pulls
}
func (r *RunStats) SetFileProvidedRepos(fileProvidedRepos []*types.AllowedRepo) {
	for _, ar := range fileProvidedRepos {
		r.fileProvidedRepos = append(r.fileProvidedRepos, ar)
	}
}
func (r *RunStats) GetFileProvidedRepos() []*types.AllowedRepo {
	return r.fileProvidedRepos
}
func (r *RunStats) SetRepoFlagProvidedRepos(repoFlagProvidedRepos []*types.AllowedRepo) {
	for _, ar := range repoFlagProvidedRepos {
		r.repoFlagProvidedRepos = append(r.repoFlagProvidedRepos, ar)
	}
}