repo

package
v0.0.0-...-b701bcf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Index

Constants

This section is empty.

Variables

View Source
var (
	// RestrictToTeam is used in several subcommands to restrict the comments included
	// as feedback to only those that are made by immediate team members
	RestrictToTeam bool
	IssuesCmd      = &cobra.Command{
		Use:   "issues",
		Short: "Gather issue-related data",
		Long:  "The subcommand used as the root for all queries for issue-related data",
	}
)

rootCmd represents the base command when called without any subcommands

View Source
var FirstIssueSearchQuery struct {
	Search struct {
		// contains filtered or unexported fields
	} `graphql:"search(first: $first, query: $query, type: $type)"`
}

* define a pair of structs that can be used to query GitHub for a list of all of the * open PRs in a given organization (by name) that match a given query; the first is * used to query for the first page of results and the second is used to query for * subsequent pages of results

View Source
var FirstPrSearchQuery struct {
	Search struct {
		// contains filtered or unexported fields
	} `graphql:"search(first: $first, query: $query, type: $type)"`
}

* define a pair of structs that can be used to query GitHub for a list of all of the * open PRs in a given organization (by name) that match a given query; the first is * used to query for the first page of results and the second is used to query for * subsequent pages of results

View Source
var IssueSearchQuery struct {
	Search struct {
		// contains filtered or unexported fields
	} `graphql:"search(first: $first, after: $after, query: $query, type: $type)"`
}
View Source
var PrSearchQuery struct {
	Search struct {
		// contains filtered or unexported fields
	} `graphql:"search(first: $first, after: $after, query: $query, type: $type)"`
}
View Source
var (
	PullsCmd = &cobra.Command{
		Use:   "pulls",
		Short: "Gather PR-related data",
		Long:  "The subcommand used as the root for all queries for PR-related data",
	}
)

rootCmd represents the base command when called without any subcommands

Functions

func GetFirstResponseTime

func GetFirstResponseTime[C IssueOrPullRequest](contrib C, endDateTime githubv4.DateTime, fromTeamOnly bool, teamIds []string) time.Duration

* Define a generic function that we can use to get the time of the first response to an issue * or pull request. The arguments to this function are as follows: * * - contrib: the issue or pull request for which we want to get the time of the first response * - endDateTime: the end date/time of the query window; this is used to determine the default * time to first response if no response is found * - fromTeamOnly: a boolean flag that indicates whether or not we should only count comments * from immediate team members * - teamIds: a slice of strings that contains the GitHub IDs of the members of the team that * owns the repository that contains the issue or pull request for which we want to get * the time of the first response *

func GetLatestResponseTime

func GetLatestResponseTime[C IssueOrPullRequest](contrib C, endDateTime githubv4.DateTime, fromTeamOnly bool, teamIds []string) time.Duration

* Define a generic function that we can use to get the time of the latest response (or staleness) * to an issue or pull request. The arguments to this function are as follows: * * - contrib: the issue or pull request for which we want to get the time of the first response * - endDateTime: the end date/time of the query window; this is used to determine the default * time to first response if no response is found * - fromTeamOnly: a boolean flag that indicates whether or not we should only count comments * from immediate team members * - teamIds: a slice of strings that contains the GitHub IDs of the members of the team that * owns the repository that contains the issue or pull request for which we want to get * the time of the first response *

func IsClosed

func IsClosed[C IssueOrPullRequest](contrib C) bool

Types

type Issue

type Issue struct {
	cmd.IssueOrPrBase
}

* Define a few types that we can use to define (ane extract data from) the body of the GraphQL * query that will be used to retrieve the list of open issues in the named GitHub organization(s)

func (*Issue) GetClosedAt

func (i *Issue) GetClosedAt() githubv4.DateTime

func (*Issue) GetComments

func (i *Issue) GetComments() cmd.Comments

func (*Issue) GetCreatedAt

func (i *Issue) GetCreatedAt() githubv4.DateTime

func (*Issue) IsClosed

func (i *Issue) IsClosed() bool

* define a few functions to get the values we'll need from the underling Issue

type IssueOrPullRequest

type IssueOrPullRequest interface {
	*Issue | *PullRequest
	IsClosed() bool
	GetCreatedAt() githubv4.DateTime
	GetClosedAt() githubv4.DateTime
	GetComments() cmd.Comments
}

type IssueSearchEdges

type IssueSearchEdges []struct {
	Cursor githubv4.String
	Node   struct {
		Issue `graphql:"... on Issue"`
	}
}

type PrSearchEdges

type PrSearchEdges []struct {
	Cursor githubv4.String
	Node   struct {
		PullRequest `graphql:"... on PullRequest"`
	}
}

type PullRequest

type PullRequest struct {
	cmd.IssueOrPrBase
}

* Define a few types that we can use to define (ane extract data from) the body of the GraphQL * query that will be used to retrieve the list of open PRs in the named GitHub organization(s)

func (*PullRequest) GetClosedAt

func (p *PullRequest) GetClosedAt() githubv4.DateTime

func (*PullRequest) GetComments

func (p *PullRequest) GetComments() cmd.Comments

func (*PullRequest) GetCreatedAt

func (p *PullRequest) GetCreatedAt() githubv4.DateTime

func (*PullRequest) IsClosed

func (p *PullRequest) IsClosed() bool

* define a few functions to get the values we'll need from the underling PullRequest

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL