Documentation
¶
Index ¶
Constants ¶
View Source
const StatusPort = 8808
StatusPort is a default port for Blocker status
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Batch ¶
type Batch struct {
// PRs in the batch
PRs []*PullRequest
// Job is a IntegrationJob's namespaced name for the batch job
Job types.NamespacedName
// Processing is an indicator that the batch is under process
Processing bool
}
Batch is a batch of PRs, waiting for a block-merge.
type MergePool ¶
type MergePool map[git.CommitStatusState]map[int]*PullRequest
MergePool is a pool for PRs. Keys are git.CommitStatusState (same as PullRequest.BlockerStatus) - pr.ID
func (MergePool) Add ¶
func (m MergePool) Add(pr *PullRequest)
Add adds a PullRequest to the MergePool
func (MergePool) Search ¶
func (m MergePool) Search(id int) *PullRequest
Search searches a given PR from the MergePool. Returns nil if it does not exist
type PRPool ¶
type PRPool struct {
// NamespacedName stores a name and a namespace of source IntegrationConfig
types.NamespacedName
// PullRequests store all open PullRequests for an IntegrationConfig, including those who does not meet conditions.
PullRequests map[int]*PullRequest
// MergePool is a cache of PRs which meet all the conditions except for commit status/merge conflict conditions
MergePool MergePool
// CurrentBatch is a batch of PRs, waiting for a block-merge.
// If it's non-nil, maybe merger is retesting the PRs.
CurrentBatch *Batch
// contains filtered or unexported fields
}
PRPool is a PullRequest pool(=cache) of an IntegrationConfig
type PullRequest ¶
type PullRequest struct {
git.PullRequest
// BlockerStatus, BlockerDescription, and LatestSHA is for caching the commit status values
// Only available statuses are pending and success - no failure/error
BlockerStatus git.CommitStatusState
BlockerDescription string
LatestSHA string
// Statuses stores whole commit statuses of the PR
Statuses map[string]git.CommitStatus
// Commits are the list of commits in the PR
// Only set right before merging it, only if mergeConfig's commitTemplate is not empty
Commits []git.Commit
// contains filtered or unexported fields
}
PullRequest stores a raw git.PullRequest and a cache of the blocker's commit status
type PullRequestByID ¶
type PullRequestByID []*PullRequest
PullRequestByID is a PR id, sorted by ID
func (PullRequestByID) Len ¶
func (p PullRequestByID) Len() int
func (PullRequestByID) Less ¶
func (p PullRequestByID) Less(i, j int) bool
func (PullRequestByID) Swap ¶
func (p PullRequestByID) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.