Documentation
¶
Index ¶
- Variables
- func CombinePRsWithStats(ctx context.Context, graphQlClient *api.GraphQLClient, ...) (combined []string, mergeConflicts []string, combinedPRLink string, err error)
- func GetPRStatusInfo(ctx context.Context, graphQlClient *api.GraphQLClient, owner, repo string, ...) (*prStatusResponse, error)
- func NewRootCmd() *cobra.Command
- func ParseRepositories(args []string, path string) ([]github.Repo, error)
- func PrMatchesCriteria(branch string, prLabels []string) bool
- func PrMeetsRequirements(ctx context.Context, graphQlClient *api.GraphQLClient, owner, repo string, ...) (bool, error)
- func Run() error
- func SetupSignalContext() (context.Context, context.CancelFunc)
- func ValidateInputs(args []string) error
- func ValidateLabels(selectLabels []string, ignoreLabels []string) error
- type CombineOpts
- type MockRESTClient
- func (m *MockRESTClient) Delete(endpoint string, response interface{}) error
- func (m *MockRESTClient) Do(method string, path string, body io.Reader, response interface{}) error
- func (m *MockRESTClient) DoWithContext(ctx context.Context, method string, path string, body io.Reader, ...) error
- func (m *MockRESTClient) Get(endpoint string, response interface{}) error
- func (m *MockRESTClient) Patch(endpoint string, body io.Reader, response interface{}) error
- func (m *MockRESTClient) Post(endpoint string, body io.Reader, response interface{}) error
- func (m *MockRESTClient) Put(path string, body io.Reader, resp interface{}) error
- func (m *MockRESTClient) Request(method string, path string, body io.Reader) (*http.Response, error)
- func (m *MockRESTClient) RequestWithContext(ctx context.Context, method string, path string, body io.Reader) (*http.Response, error)
- type RESTClientInterface
- type RepoStats
- type Spinner
- type StatsCollector
Constants ¶
This section is empty.
Variables ¶
var (
ErrEmptyRepositoriesFilePath = fmt.Errorf("empty repositories file path")
)
var Logger *slog.Logger
Functions ¶
func CombinePRsWithStats ¶ added in v0.0.10
func CombinePRsWithStats(ctx context.Context, graphQlClient *api.GraphQLClient, restClient RESTClientInterface, opts CombineOpts) (combined []string, mergeConflicts []string, combinedPRLink string, err error)
CombinePRsWithStats combines PRs and returns stats for summary output
func GetPRStatusInfo ¶ added in v0.0.2
func GetPRStatusInfo(ctx context.Context, graphQlClient *api.GraphQLClient, owner, repo string, prNumber int) (*prStatusResponse, error)
GetPRStatusInfo fetches both CI status and approval status using GitHub's GraphQL API
func NewRootCmd ¶
NewRootCmd creates the root command for the gh-combine CLI
func PrMatchesCriteria ¶
checks if a PR matches all filtering criteria
func PrMeetsRequirements ¶ added in v0.0.2
func PrMeetsRequirements(ctx context.Context, graphQlClient *api.GraphQLClient, owner, repo string, prNumber int) (bool, error)
PrMeetsRequirements checks if a PR meets additional requirements beyond basic criteria
func SetupSignalContext ¶
func SetupSignalContext() (context.Context, context.CancelFunc)
SetupSignalContext creates a context that's cancelled on SIGINT or SIGTERM
func ValidateInputs ¶
validateInputs checks if the provided inputs are valid
func ValidateLabels ¶ added in v0.0.7
Types ¶
type CombineOpts ¶ added in v0.0.12
CombineOpts holds options for combining PRs Use this struct to pass options to CombinePRsWithStats and related functions This makes the code more maintainable and clear
type MockRESTClient ¶ added in v0.0.10
type MockRESTClient struct { PostFunc func(endpoint string, body interface{}, response interface{}) error GetFunc func(endpoint string, response interface{}) error DeleteFunc func(endpoint string, response interface{}) error PatchFunc func(endpoint string, body io.Reader, response interface{}) error }
func (*MockRESTClient) Delete ¶ added in v0.0.10
func (m *MockRESTClient) Delete(endpoint string, response interface{}) error
func (*MockRESTClient) DoWithContext ¶ added in v0.0.10
func (*MockRESTClient) Get ¶ added in v0.0.10
func (m *MockRESTClient) Get(endpoint string, response interface{}) error
func (*MockRESTClient) Patch ¶ added in v0.0.10
func (m *MockRESTClient) Patch(endpoint string, body io.Reader, response interface{}) error
Updated the Patch method to match the RESTClientInterface signature
func (*MockRESTClient) Post ¶ added in v0.0.10
func (m *MockRESTClient) Post(endpoint string, body io.Reader, response interface{}) error
Updated the Post method to match the RESTClientInterface signature
func (*MockRESTClient) Put ¶ added in v0.0.10
func (m *MockRESTClient) Put(path string, body io.Reader, resp interface{}) error
type RESTClientInterface ¶ added in v0.0.10
type RESTClientInterface interface { Post(endpoint string, body io.Reader, response interface{}) error Get(endpoint string, response interface{}) error Delete(endpoint string, response interface{}) error Patch(endpoint string, body io.Reader, response interface{}) error }
Updated RESTClientInterface to match the method signatures of api.RESTClient
type Spinner ¶
type Spinner struct {
// contains filtered or unexported fields
}
func NewSpinner ¶
func (*Spinner) UpdateMessage ¶
UpdateMessage changes the text displayed next to the spinner while it's running