commitqueue

package
v0.0.0-...-a086091 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 9 Imported by: 16

Documentation

Overview

Package commitqueue models the commit queue, which merges code automatically after testing.

Index

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 ClearAllCommitQueues() (int, error)

func EnsureCommitQueueExistsForProject

func EnsureCommitQueueExistsForProject(id string) error

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

type EnqueuePRInfo struct {
	Username      string
	Owner         string
	Repo          string
	PR            int
	CommitMessage string
}

EnqueuePRInfo holds information necessary to enqueue a PR to the commit queue.

type Module

type Module struct {
	Module string `bson:"module" json:"module"`
	Issue  string `bson:"issue" json:"issue"`
}

func (*Module) MarshalBSON

func (m *Module) MarshalBSON() ([]byte, error)

func (*Module) UnmarshalBSON

func (m *Module) UnmarshalBSON(in []byte) error

Jump to

Keyboard shortcuts

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