Documentation
¶
Index ¶
- Constants
- Variables
- func BuildAlreadyStartedError(startTime int64) *buildAlreadyStarted
- func BuildNotRunningError() *buildNotRunningError
- func BuildOngoingError(pr int) *buildOngoingError
- func NewBuildLogs(logsRootDir, develPrefix string) *buildLogs
- func NoBuildToStopError() *noBuildToStopError
- func NothingToBuildError(msg string) *nothingToBuildError
- type Build
- type Builder
- type CodeBuilder
- type Fetcher
- type FetcherCounts
- type FetcherTimes
- type Metric
- type ShutdownError
- type Task
Constants ¶
const ( // TaskName is the name of this task TaskName = "prbuild" // TaskDesc describes succintly what this task does TaskDesc = "Builds Github pull requests" )
Variables ¶
var ( Debug = logging.Debug Info = logging.Info Error = logging.Error Field = logging.F ErrField = func(e error) logging.Field { return logging.F("err", e) } )
Logging shortcuts for the package
Functions ¶
func BuildAlreadyStartedError ¶
func BuildAlreadyStartedError(startTime int64) *buildAlreadyStarted
func BuildNotRunningError ¶
func BuildNotRunningError() *buildNotRunningError
func BuildOngoingError ¶
func BuildOngoingError(pr int) *buildOngoingError
func NewBuildLogs ¶
func NewBuildLogs(logsRootDir, develPrefix string) *buildLogs
func NoBuildToStopError ¶
func NoBuildToStopError() *noBuildToStopError
func NothingToBuildError ¶
func NothingToBuildError(msg string) *nothingToBuildError
Types ¶
type Build ¶
type Build struct {
// contains filtered or unexported fields
}
Build wraps the instructions for building a pull request
func NewBuild ¶
func NewBuild(pr *pullrequest.PR) *Build
NewBuild creates a Build instance for the given pull request func NewBuild(pr *pullrequest.PR) *Build {
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder is the type that manages building of pull requests
func NewBuilder ¶
func NewBuilder() *Builder
NewBuilder returns a builder that oversees the building of pull requests
type CodeBuilder ¶
type Fetcher ¶
type Fetcher struct {
// contains filtered or unexported fields
}
Fetcher fetches PRs in a goroutine, and pushes them onto its prs channel
type FetcherCounts ¶
type FetcherCounts struct {
// contains filtered or unexported fields
}
FetcherCounts holds on to useful counts info related to PR fetching
type FetcherTimes ¶
type FetcherTimes struct {
// contains filtered or unexported fields
}
FetcherTimes holds on to useful timing info related to PR fetching
type ShutdownError ¶
type ShutdownError struct {
// contains filtered or unexported fields
}
ShutdownError represents the error returned if an abort request is made
type Task ¶
Task is the main data structure for this pull request building task
func (Task) Exec ¶
Exec performs the meat of the pull request building activity It will exit if an external task abort is detected (the done channel is then closed), if the context is cancelled or if the task decides to stop running for now (because no pull requests have been available in the past N minutes)
func (*Task) FindWork ¶
FindWork checks if the task has work it could do, and updates the HaveWork boolean attribute accordingly It is run during state Seek. It will abort its action if the context is cancelled.