taskcluster

package
v0.0.0-...-71fd8da Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const AppID = int64(40788)

AppID is the ID of the Community-TC GitHub app.

Variables

View Source
var (
	// TaskNameRegex is based on task names in
	// https://github.com/web-platform-tests/wpt/blob/master/tools/ci/tc/tasks/test.yml.
	TaskNameRegex = regexp.MustCompile(`^wpt-([a-z_]+-[a-z]+)-([a-z]+(?:-[a-z]+)*)(?:-\d+)?$`)
)

Functions

func CreateAllRuns

func CreateAllRuns(
	log shared.Logger,
	aeAPI shared.AppEngineAPI,
	sha,
	username,
	password string,
	urlsByProduct map[string]ArtifactURLs,
	labels []string) error

CreateAllRuns creates run entries in wpt.fyi for a set of products coming from Taskcluster.

func ExtractArtifactURLs

func ExtractArtifactURLs(rootURL string, log shared.Logger, group *TaskGroupInfo, taskID string) (
	urlsByProduct map[string]ArtifactURLs, err error)

ExtractArtifactURLs extracts the results and screenshot URLs for a set of tasks in a TaskGroupInfo.

func ParseTaskclusterURL

func ParseTaskclusterURL(targetURL string) (rootURL, taskGroupID, taskID string)

ParseTaskclusterURL splits a given URL into its root URL, the Taskcluster group id, and an optional specific task ID.

func RegisterRoutes

func RegisterRoutes()

RegisterRoutes adds route handlers for webhooks.

func ShouldProcessStatus

func ShouldProcessStatus(log shared.Logger, status *StatusEventPayload) bool

ShouldProcessStatus determines whether we are interested in processing a given StatusEventPayload or not.

Types

type API

type API interface {
	GetTaskGroupInfo(string, string) (*TaskGroupInfo, error)
	ListCheckRuns(owner string, repo string, checkSuiteID int64) ([]*github.CheckRun, error)
}

API wraps externally provided methods so we can mock them for testing.

type ArtifactURLs

type ArtifactURLs struct {
	Results     []string
	Screenshots []string
}

ArtifactURLs holds the results and screenshot URLs for a Taskcluster run.

type EventInfo

type EventInfo struct {
	Sha     string
	RootURL string
	TaskID  string
	Master  bool
	Sender  string
	Group   *TaskGroupInfo
}

EventInfo is an abstraction of a GitHub Status event, containing the necessary information for us to process the event in wpt.fyi.

func GetCheckSuiteEventInfo

func GetCheckSuiteEventInfo(checkSuite github.CheckSuiteEvent, log shared.Logger, api API) (EventInfo, error)

GetCheckSuiteEventInfo turns a github.CheckSuiteEvent into an EventInfo struct.

func GetStatusEventInfo

func GetStatusEventInfo(status StatusEventPayload, log shared.Logger, api API) (EventInfo, error)

GetStatusEventInfo turns a StatusEventPayload into an EventInfo struct.

type StatusEventPayload

type StatusEventPayload struct {
	github.StatusEvent
}

StatusEventPayload wraps a github.StatusEvent so we can declare methods on it https://developer.github.com/v3/activity/events/types/#statusevent

func (StatusEventPayload) IsCompleted

func (s StatusEventPayload) IsCompleted() bool

IsCompleted checks if a github.StatusEvent has completed.

func (StatusEventPayload) IsOnMaster

func (s StatusEventPayload) IsOnMaster() bool

IsOnMaster checks if a github.StatusEvent affects the master branch.

func (StatusEventPayload) IsTaskcluster

func (s StatusEventPayload) IsTaskcluster() bool

IsTaskcluster checks if a github.StatusEvent is from Taskcluster.

type TaskGroupInfo

type TaskGroupInfo struct {
	TaskGroupID string
	Tasks       []TaskInfo
}

TaskGroupInfo is an abstraction of a Taskcluster task group, containing the necessary information for us to process the group in wpt.fyi.

type TaskInfo

type TaskInfo struct {
	Name   string
	TaskID string
	State  string
}

TaskInfo is an abstraction of a Taskcluster task, containing the necessary information for us to process the task in wpt.fyi.

Directories

Path Synopsis
Package mock_taskcluster is a generated GoMock package.
Package mock_taskcluster is a generated GoMock package.

Jump to

Keyboard shortcuts

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