 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
- Variables
- func AnnotationSymbol(cs *iostreams.ColorScheme, a Annotation) string
- func IsFailureState(c Conclusion) bool
- func PromptForRun(cs *iostreams.ColorScheme, runs []Run) (string, error)
- func PullRequestForRun(client *api.Client, repo ghrepo.Interface, run Run) (int, error)
- func RenderAnnotations(cs *iostreams.ColorScheme, annotations []Annotation) string
- func RenderJobs(cs *iostreams.ColorScheme, jobs []Job, verbose bool) string
- func RenderRunHeader(cs *iostreams.ColorScheme, run Run, ago, prNumber string) string
- func Symbol(cs *iostreams.ColorScheme, status Status, conclusion Conclusion) (string, colorFunc)
- type Annotation
- type CheckRun
- type Commit
- type Conclusion
- type Job
- type JobsPayload
- type Level
- type Repo
- type Run
- func GetRun(client *api.Client, repo ghrepo.Interface, runID string) (*Run, error)
- func GetRuns(client *api.Client, repo ghrepo.Interface, limit int) ([]Run, error)
- func GetRunsByWorkflow(client *api.Client, repo ghrepo.Interface, limit, workflowID int) ([]Run, error)
- func GetRunsWithFilter(client *api.Client, repo ghrepo.Interface, limit int, f func(Run) bool) ([]Run, error)
- func TestRun(name string, id int, s Status, c Conclusion) Run
 
- type RunsPayload
- type Status
- type Step
Constants ¶
      View Source
      
  
const ( // Run statuses Queued Status = "queued" Completed Status = "completed" InProgress Status = "in_progress" Requested Status = "requested" Waiting Status = "waiting" // Run conclusions ActionRequired Conclusion = "action_required" Cancelled Conclusion = "cancelled" Failure Conclusion = "failure" Neutral Conclusion = "neutral" Skipped Conclusion = "skipped" Stale Conclusion = "stale" StartupFailure Conclusion = "startup_failure" Success Conclusion = "success" TimedOut Conclusion = "timed_out" AnnotationFailure Level = "failure" AnnotationWarning Level = "warning" )
Variables ¶
      View Source
      
  
    var FailedJobAnnotations []Annotation = []Annotation{
	{
		JobName:   "sad job",
		Message:   "the job is sad",
		Path:      "blaze.py",
		Level:     "failure",
		StartLine: 420,
	},
}
    
      View Source
      
  
    var TestRuns []Run = []Run{ TestRun("timed out", 1, Completed, TimedOut), TestRun("in progress", 2, InProgress, ""), SuccessfulRun, TestRun("cancelled", 4, Completed, Cancelled), FailedRun, TestRun("neutral", 6, Completed, Neutral), TestRun("skipped", 7, Completed, Skipped), TestRun("requested", 8, Requested, ""), TestRun("queued", 9, Queued, ""), TestRun("stale", 10, Completed, Stale), }
      View Source
      
  
var WorkflowRuns []Run = []Run{ TestRun("in progress", 2, InProgress, ""), SuccessfulRun, FailedRun, }
Functions ¶
func AnnotationSymbol ¶
func AnnotationSymbol(cs *iostreams.ColorScheme, a Annotation) string
func IsFailureState ¶
func IsFailureState(c Conclusion) bool
func PromptForRun ¶
func PromptForRun(cs *iostreams.ColorScheme, runs []Run) (string, error)
func PullRequestForRun ¶
func RenderAnnotations ¶
func RenderAnnotations(cs *iostreams.ColorScheme, annotations []Annotation) string
func RenderJobs ¶
func RenderJobs(cs *iostreams.ColorScheme, jobs []Job, verbose bool) string
func RenderRunHeader ¶
func RenderRunHeader(cs *iostreams.ColorScheme, run Run, ago, prNumber string) string
func Symbol ¶
func Symbol(cs *iostreams.ColorScheme, status Status, conclusion Conclusion) (string, colorFunc)
Types ¶
type Annotation ¶
type Annotation struct {
	JobName   string
	Message   string
	Path      string
	Level     Level `json:"annotation_level"`
	StartLine int   `json:"start_line"`
}
    func GetAnnotations ¶
type Conclusion ¶
type Conclusion string
type Job ¶
type Job struct {
	ID          int
	Status      Status
	Conclusion  Conclusion
	Name        string
	Steps       []Step
	StartedAt   time.Time `json:"started_at"`
	CompletedAt time.Time `json:"completed_at"`
	URL         string    `json:"html_url"`
	RunID       int       `json:"run_id"`
}
    var FailedJob Job = Job{ ID: 20, Status: Completed, Conclusion: Failure, Name: "sad job", StartedAt: created(), CompletedAt: updated(), URL: "jobs/20", RunID: 1234, Steps: []Step{ { Name: "barf the quux", Status: Completed, Conclusion: Success, Number: 1, }, { Name: "quux the barf", Status: Completed, Conclusion: Failure, Number: 2, }, }, }
var SuccessfulJob Job = Job{ ID: 10, Status: Completed, Conclusion: Success, Name: "cool job", StartedAt: created(), CompletedAt: updated(), URL: "jobs/10", RunID: 3, Steps: []Step{ { Name: "fob the barz", Status: Completed, Conclusion: Success, Number: 1, }, { Name: "barz the fob", Status: Completed, Conclusion: Success, Number: 2, }, }, }
type JobsPayload ¶
type JobsPayload struct {
	Jobs []Job
}
    type Run ¶
type Run struct {
	Name           string
	CreatedAt      time.Time `json:"created_at"`
	UpdatedAt      time.Time `json:"updated_at"`
	Status         Status
	Conclusion     Conclusion
	Event          string
	ID             int
	HeadBranch     string `json:"head_branch"`
	JobsURL        string `json:"jobs_url"`
	HeadCommit     Commit `json:"head_commit"`
	HeadSha        string `json:"head_sha"`
	URL            string `json:"html_url"`
	HeadRepository Repo   `json:"head_repository"`
}
    func GetRunsByWorkflow ¶
func GetRunsWithFilter ¶ added in v1.8.1
type RunsPayload ¶
type RunsPayload struct {
	WorkflowRuns []Run `json:"workflow_runs"`
}
     Click to show internal directories. 
   Click to hide internal directories.