checks

package
v0.5.12 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2019 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	BaseURL, UploadURL string

	StatusContext     string
	StatusDescription string

	Cmd  string
	Args []string
	// contains filtered or unexported fields
}

func New

func New() *Action

func (*Action) AddFlags

func (c *Action) AddFlags(fs *flag.FlagSet)

func (*Action) CreateCheckRun

func (c *Action) CreateCheckRun(client *github.Client, ctx context.Context, owner, repo string, opt CreateCheckRunOptions) (*github.CheckRun, *github.Response, error)

func (*Action) CreateCheckRunsForSuite

func (c *Action) CreateCheckRunsForSuite(e *github.CheckSuite) error

func (*Action) CreateCheckSuite

func (c *Action) CreateCheckSuite(pre *github.PullRequestEvent) (*github.CheckSuite, error)

CreateCheckSuite creates a new check suite and rerequests it based on a pull request.

The Check Suite webhook events are normally only triggered on `push` events. This function acts as an adapter to take a PR and trigger a check suite.

The GitHub API is still evolving, so the current way we do this is...

  • generate auth tokens for the instance/app combo. This is required to perform the action as a GitHub app
  • try to create a check_suite
  • if success, run a `rerequest` on this check suite because merely creating a check suite does not actually trigger a check_suite:requested webhook event
  • if failure, check to see if we already have a check suite object, and merely run the rerequest on that check suite.

func (*Action) EnsureCheckRun

func (c *Action) EnsureCheckRun(pre *github.PullRequestEvent) error

func (*Action) EnsureCheckSuite

func (c *Action) EnsureCheckSuite(pre *github.PullRequestEvent) (*github.CheckSuite, error)

func (*Action) ExecCheckRun

func (c *Action) ExecCheckRun(e *github.CheckRunEvent) error

func (*Action) HandleEvent

func (c *Action) HandleEvent(payload interface{}) error

func (*Action) Run

func (c *Action) Run(args []string) error

func (*Action) UpdateCheckRun

func (c *Action) UpdateCheckRun(owner, repo string, checkRun *github.CheckRun, summary, text string, runErr error) error

type CreateCheckRunOptions

type CreateCheckRunOptions struct {
	Name       string  `json:"name"`                  // The name of the check (e.g., "code-coverage"). (Required.)
	HeadBranch string  `json:"head_branch"`           // The name of the branch to perform a check against. (Required.)
	HeadSHA    string  `json:"head_sha"`              // The SHA of the commit. (Required.)
	DetailsURL *string `json:"details_url,omitempty"` // The URL of the integrator's site that has the full details of the check. (Optional.)
	ExternalID *string `json:"external_id,omitempty"` // A reference for the run on the integrator's system. (Optional.)
	Status     *string `json:"status,omitempty"`      // The current status. Can be one of "queued", "in_progress", or "completed". Default: "queued". (Optional.)
	Conclusion *string `json:"conclusion,omitempty"`  // Can be one of "success", "failure", "neutral", "cancelled", "timed_out", or "action_required". (Optional. Required if you provide a status of "completed".)
	// Does this really work?
	CheckSuiteID *int64                   `json:"check_suite_id,omitempty`
	StartedAt    *github.Timestamp        `json:"started_at,omitempty"`   // The time that the check run began. (Optional.)
	CompletedAt  *github.Timestamp        `json:"completed_at,omitempty"` // The time the check completed. (Optional. Required if you provide conclusion.)
	Output       *github.CheckRunOutput   `json:"output,omitempty"`       // Provide descriptive details about the run. (Optional)
	Actions      []*github.CheckRunAction `json:"actions,omitempty"`      // Possible further actions the integrator can perform, which a user may trigger. (Optional.)
}

type Run

type Run struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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