vcs

package
v0.10.39 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StubMetadata = Metadata{
		Remote: urlStringToRemote("https://github.com/infracost/infracost"),
		Branch: Branch{
			Name: "stub-branch",
		},
		Commit: Commit{
			SHA:         "stub-sha",
			AuthorName:  "stub-author",
			AuthorEmail: "stub@stub.com",
			Time:        time.Time{},
			Message:     "stub-message",
		},
	}

	MetadataFetcher = newMetadataFetcher()
)

Functions

This section is empty.

Types

type Branch

type Branch struct {
	Name string
}

type Commit

type Commit struct {
	SHA         string
	AuthorName  string
	AuthorEmail string
	Time        time.Time
	Message     string

	ChangedObjects []string
	GitDiffTarget  *string
}

Commit defines information for a given commit. This information is normally populated from the local VCS environment. Attributes can be overwritten by CI specific properties and variables.

type Metadata

type Metadata struct {
	Remote      Remote
	Branch      Branch
	Commit      Commit
	BaseCommit  Commit
	PullRequest *PullRequest
	Pipeline    *Pipeline
}

Metadata holds a snapshot of information for a given environment and VCS system. PullRequest and Pipeline properties are only populated if running in a CI system.

func (Metadata) HasChanges added in v0.10.15

func (m Metadata) HasChanges() bool

type Pipeline

type Pipeline struct {
	ID string
}

Pipeline holds information about a specific run for a CI system. This is used to aggregate Infracost metadata across commands used in the same pipeline.

type PullRequest

type PullRequest struct {
	ID           string
	VCSProvider  string
	Title        string
	Author       string
	Labels       []string
	SourceBranch string
	BaseBranch   string
	URL          string
}

PullRequest defines information that is unique to a pull request or merge request in a CI system.

type Remote added in v0.10.9

type Remote struct {
	Host string
	Name string
	URL  string
}

Remote holds information about the upstream repository that the git project uses.

Jump to

Keyboard shortcuts

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