Documentation ¶
Overview ¶
Package commitqueue models the commit queue, which merges code automatically after testing.
Index ¶
- Constants
- Variables
- func ClearAllCommitQueues() (int, error)
- func EnsureCommitQueueExistsForProject(id string) error
- func InsertQueue(q *CommitQueue) error
- type CommitQueue
- func (q *CommitQueue) Enqueue(item CommitQueueItem) (int, error)
- func (q *CommitQueue) EnqueueAtFront(item CommitQueueItem) (int, error)
- func (q *CommitQueue) FindItem(issue string) int
- func (q *CommitQueue) MarshalBSON() ([]byte, error)
- func (q *CommitQueue) Next() (CommitQueueItem, bool)
- func (q *CommitQueue) NextUnprocessed(n int) []CommitQueueItem
- func (q *CommitQueue) Processing() bool
- func (q *CommitQueue) Remove(issue string) (*CommitQueueItem, error)
- func (q *CommitQueue) UnmarshalBSON(in []byte) error
- func (q *CommitQueue) UpdateVersion(item *CommitQueueItem) error
- type CommitQueueItem
- type EnqueuePRInfo
- type Module
Constants ¶
View Source
const ( SourcePullRequest = "PR" SourceDiff = "diff" GithubContext = "evergreen/commitqueue" )
View Source
const Collection = "commit_queue"
Variables ¶
View Source
var ( // bson fields for the CommitQueue struct IdKey = bsonutil.MustHaveTag(CommitQueue{}, "ProjectID") QueueKey = bsonutil.MustHaveTag(CommitQueue{}, "Queue") IssueKey = bsonutil.MustHaveTag(CommitQueueItem{}, "Issue") VersionKey = bsonutil.MustHaveTag(CommitQueueItem{}, "Version") EnqueueTimeKey = bsonutil.MustHaveTag(CommitQueueItem{}, "EnqueueTime") ProcessingStartTimeKey = bsonutil.MustHaveTag(CommitQueueItem{}, "ProcessingStartTime") QueueLengthAtEnqueueKey = bsonutil.MustHaveTag(CommitQueueItem{}, "QueueLengthAtEnqueue") )
Functions ¶
func ClearAllCommitQueues ¶
func EnsureCommitQueueExistsForProject ¶
EnsureCommitQueueExistsForProject inserts a skeleton commit queue if project doesn't have one
func InsertQueue ¶
func InsertQueue(q *CommitQueue) error
Types ¶
type CommitQueue ¶
type CommitQueue struct { ProjectID string `bson:"_id"` Queue []CommitQueueItem `bson:"queue,omitempty"` }
func FindOneId ¶
func FindOneId(id string) (*CommitQueue, error)
func (*CommitQueue) Enqueue ¶
func (q *CommitQueue) Enqueue(item CommitQueueItem) (int, error)
func (*CommitQueue) EnqueueAtFront ¶
func (q *CommitQueue) EnqueueAtFront(item CommitQueueItem) (int, error)
EnqueueAtFront adds a given item to the front of the _unprocessed_ items in the queue
func (*CommitQueue) FindItem ¶
func (q *CommitQueue) FindItem(issue string) int
func (*CommitQueue) MarshalBSON ¶
func (q *CommitQueue) MarshalBSON() ([]byte, error)
func (*CommitQueue) Next ¶
func (q *CommitQueue) Next() (CommitQueueItem, bool)
func (*CommitQueue) NextUnprocessed ¶
func (q *CommitQueue) NextUnprocessed(n int) []CommitQueueItem
func (*CommitQueue) Processing ¶
func (q *CommitQueue) Processing() bool
func (*CommitQueue) Remove ¶
func (q *CommitQueue) Remove(issue string) (*CommitQueueItem, error)
func (*CommitQueue) UnmarshalBSON ¶
func (q *CommitQueue) UnmarshalBSON(in []byte) error
func (*CommitQueue) UpdateVersion ¶
func (q *CommitQueue) UpdateVersion(item *CommitQueueItem) error
type CommitQueueItem ¶
type CommitQueueItem struct { Issue string `bson:"issue"` PatchId string `bson:"patch_id,omitempty"` // Version is the ID of the version that is running the patch. It's also used to determine what entries are processing Version string `bson:"version,omitempty"` EnqueueTime time.Time `bson:"enqueue_time"` ProcessingStartTime time.Time `bson:"processing_start_time"` Modules []Module `bson:"modules"` MessageOverride string `bson:"message_override"` Source string `bson:"source"` // QueueLengthAtEnqueue is the length of the queue when the item was enqueued. Used for tracking the speed of the // commit queue as this value is logged when a commit queue item is processed. QueueLengthAtEnqueue int `bson:"queue_length_at_enqueue"` }
func (*CommitQueueItem) MarshalBSON ¶
func (i *CommitQueueItem) MarshalBSON() ([]byte, error)
func (*CommitQueueItem) UnmarshalBSON ¶
func (i *CommitQueueItem) UnmarshalBSON(in []byte) error
type EnqueuePRInfo ¶
EnqueuePRInfo holds information necessary to enqueue a PR to the commit queue.
Click to show internal directories.
Click to hide internal directories.