revision

package
v0.0.0-...-b95a7b5 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BugProjectBuganizer = "buganizer"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Revision

type Revision struct {
	// Id is the full ID of this Revision, eg. a full commit hash. This is
	// the only required field.
	Id string `json:"id"`

	// Checksum is used to verify the contents of a Revision. Not all use cases
	// will need this, and its exact definition is implementation-dependent.
	// Child should set this whenever possible, and Parent should make it clear
	// when it is required.
	Checksum string `json:"checksum"`

	// Author is a string indicating the author of this Revision.
	Author string `json:"author"`

	// ExternalChangeId is the external change ID that, if specified, is included
	// as part of the roll. The ID is defined by the repo_manager.
	// Eg: CL num for Chromium, PR num for Github, Topic name for Android.
	ExternalChangeId string `json:"external_change_id"`

	// Bugs are the IDs of any bugs referenced by this Revision, keyed by
	// project ID (defined in whatever way makes sense to the user).
	Bugs map[string][]string `json:"bugs"`

	// Dependencies are revision IDs of dependencies of this Revision, keyed
	// by dependency ID (defined in whatever way makes sense to the user).
	Dependencies map[string]string `json:"dependencies"`

	// Description is a brief, human-friendly description of the Revision,
	// eg. a commit title line.
	Description string `json:"description"`

	// Details contains a full description of the Revision, eg. a git commit
	// body.
	Details string `json:"details"`

	// Display is a string used for human-friendly display of the Revision,
	// eg. a shortened commit hash.
	Display string `json:"display"`

	// InvalidReason indicates we should not roll to this Revision and why,
	// if it is non-empty. Note that rolls may still *include* this
	// Revision, eg. if this is a git commit and we roll to a descendant of
	// it.
	InvalidReason string `json:"invalidReason"`

	// Tests are any tests which should be run on rolls including this
	// Revision.
	Tests []string `json:"tests"`

	// Timestamp is the time at which the Revision was created.
	Timestamp time.Time `json:"time"`

	// URL used by a human to view the Revision.
	URL string `json:"url"`
}

Revision is a struct containing information about a given revision.

func FromLongCommit

func FromLongCommit(revLinkTmpl, defaultBugProject string, c *vcsinfo.LongCommit) *Revision

FromLongCommit converts a vcsinfo.LongCommit to a Revision. If revLinkTmpl is not provided, the Revision will have no URL.

func FromLongCommits

func FromLongCommits(revLinkTmpl, defaultBugProject string, commits []*vcsinfo.LongCommit) []*Revision

FromLongCommits converts a slice of vcsinfo.LongCommits to a slice of Revisions. If revLinkTmpl is not provided, the Revisions will have no URL.

func (*Revision) Copy

func (r *Revision) Copy() *Revision

Copy the Revision.

func (*Revision) String

func (r *Revision) String() string

Implement the Stringer interface for prettier printing.

Jump to

Keyboard shortcuts

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