cli

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

README

CLI Package

This package implements the command-line interface for the GitHub Metrics Aggregator.

Purpose

To provide a structured CLI with subcommands for running the different components of the system (webhook server, retry job, relay service, etc.). It follows the abcxyz Go CLI pattern.

Files

  • artifact.go: Defines the command for artifact processing.
  • relay.go: Defines the command for running the event relay service.
  • retry.go: Defines the command for running the retry job.
  • retry_test.go: Unit tests for the retry command.
  • review.go: Defines the command for commit review status processing.
  • root.go: Defines the root command and registers all subcommands.
  • root_test.go: Unit tests for the root command.
  • webhook.go: Defines the command for starting the webhook receiver server.
  • webhook_test.go: Unit tests for the webhook command.

Design Patterns

  • Command Pattern: Each subcommand is defined in its own file and registered with the root command.
  • CLI Framework: Uses github.com/abcxyz/pkg/cli for handling flags, arguments, and command execution.

Documentation

Overview

Package cli implements the commands for the github-metrics-aggregator CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, args []string) error

Run executes the CLI.

Types

type ArtifactJobCommand added in v0.0.26

type ArtifactJobCommand struct {
	cli.BaseCommand
	// contains filtered or unexported fields
}

The ArtifactJobCommand is a Cloud Run job that will read workflow event records from BigQuery and ingest any available logs into cloud storage.

The job acts as a GitHub App for authentication purposes.

func (*ArtifactJobCommand) Desc added in v0.0.26

func (c *ArtifactJobCommand) Desc() string

func (*ArtifactJobCommand) Flags added in v0.0.26

func (c *ArtifactJobCommand) Flags() *cli.FlagSet

func (*ArtifactJobCommand) Help added in v0.0.26

func (c *ArtifactJobCommand) Help() string

func (*ArtifactJobCommand) Run added in v0.0.26

func (c *ArtifactJobCommand) Run(ctx context.Context, args []string) error

type RelayCommand added in v0.4.0

type RelayCommand struct {
	cli.BaseCommand
	// contains filtered or unexported fields
}

func (*RelayCommand) Desc added in v0.4.0

func (c *RelayCommand) Desc() string

func (*RelayCommand) Flags added in v0.4.0

func (c *RelayCommand) Flags() *cli.FlagSet

func (*RelayCommand) Help added in v0.4.0

func (c *RelayCommand) Help() string

func (*RelayCommand) Run added in v0.4.0

func (c *RelayCommand) Run(ctx context.Context, args []string) error

func (*RelayCommand) RunUnstarted added in v0.4.0

func (c *RelayCommand) RunUnstarted(ctx context.Context, args []string) (*serving.Server, http.Handler, error)

RunUnstarted configures the relay server but does not start it. It returns the server, the mux, and any error that occurred during configuration.

type RetryJobCommand added in v0.3.0

type RetryJobCommand struct {
	cli.BaseCommand
	// contains filtered or unexported fields
}

The RetryJobCommand is a Cloud Run job that will read webhook events from BigQuery and retry any that have failed.

The job acts as a GitHub App for authentication purposes.

func (*RetryJobCommand) Desc added in v0.3.0

func (c *RetryJobCommand) Desc() string

func (*RetryJobCommand) Flags added in v0.3.0

func (c *RetryJobCommand) Flags() *cli.FlagSet

func (*RetryJobCommand) Help added in v0.3.0

func (c *RetryJobCommand) Help() string

func (*RetryJobCommand) Run added in v0.3.0

func (c *RetryJobCommand) Run(ctx context.Context, args []string) error

type ReviewJobCommand added in v0.0.26

type ReviewJobCommand struct {
	cli.BaseCommand
	// contains filtered or unexported fields
}

The ReviewJobCommand is a Cloud Run job that will read commits from BigQuery and verify that they received proper review.

The job acts as a GitHub App for authentication purposes.

func (*ReviewJobCommand) Desc added in v0.0.26

func (c *ReviewJobCommand) Desc() string

func (*ReviewJobCommand) Flags added in v0.0.26

func (c *ReviewJobCommand) Flags() *cli.FlagSet

func (*ReviewJobCommand) Help added in v0.0.26

func (c *ReviewJobCommand) Help() string

func (*ReviewJobCommand) Run added in v0.0.26

func (c *ReviewJobCommand) Run(ctx context.Context, args []string) error

type WebhookServerCommand

type WebhookServerCommand struct {
	cli.BaseCommand
	// contains filtered or unexported fields
}

func (*WebhookServerCommand) Desc

func (c *WebhookServerCommand) Desc() string

func (*WebhookServerCommand) Flags

func (c *WebhookServerCommand) Flags() *cli.FlagSet

func (*WebhookServerCommand) Help

func (c *WebhookServerCommand) Help() string

func (*WebhookServerCommand) Run

func (c *WebhookServerCommand) Run(ctx context.Context, args []string) error

func (*WebhookServerCommand) RunUnstarted

func (c *WebhookServerCommand) RunUnstarted(ctx context.Context, args []string) (*serving.Server, http.Handler, error)

Jump to

Keyboard shortcuts

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