submission

package
v0.0.0-...-4a11b79 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package submission contains all related logic to submit Gerrit CLs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CL

type CL struct {
	Key  string
	Deps []Dep
}

func ComputeOrder

func ComputeOrder(cls []CL) ([]CL, error)

ComputeOrder computes the best order for submission of CLs based on their dependencies. Dependency cycle is broken by arbitrarily but deterministically breaking soft requirement dependencies and approximately minimizing their number.

Returns error if duplicate CLs are provided or the hard requirement dependencies solely form a cycle (This should not be possible within current CV context as hard requirement deps can only be established if CLs follow Git's child -> parent relationship).

Overall, this is as hard as a minimum feedback arc set, which is NP-Hard: https://en.wikipedia.org/wiki/Feedback_arc_set#Minimum_feedback_arc_set However, approximation is fine within CV context so long as hard dependencies are satisfied.

type Dep

type Dep struct {
	Key         string
	Requirement RequirementType
}

type RequirementType

type RequirementType int8
const (
	Soft RequirementType = iota
	Hard
)

Jump to

Keyboard shortcuts

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