repo

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeGitSettings

func InitializeGitSettings(username, email string) error

InitializeGitSettings ensures Git auth is set up for cloning

Types

type Repo

type Repo struct {
	BaseRef       string   // base ref is the branch that the PR is being merged into
	HeadRef       string   // head ref is the branch that the PR is coming from
	DefaultBranch string   // Some repos have default branches we need to capture
	RepoDir       string   // The directory where the repo is cloned
	Remote        string   // Remote address
	CloneURL      string   // Where we clone the repo from
	Name          string   // Name of the repo
	Owner         string   // Owner of the repo (in Gitlab this is the namespace)
	CheckID       int      // MR/PR id that generated this Repo
	SHA           string   // SHA of the MR/PRs head
	FullName      string   // Owner/Name combined (ie zapier/kubechecks)
	Username      string   // Username of auth'd client
	Email         string   // Email of auth'd client
	Labels        []string // Labels associated with the MR/PR
}

Repo represents a local Repostiory on disk, based off of a PR/MR

func (*Repo) CloneRepoLocal

func (r *Repo) CloneRepoLocal(ctx context.Context, repoDir string) error

func (*Repo) GetListOfChangedFiles

func (r *Repo) GetListOfChangedFiles(ctx context.Context) ([]string, error)

GetListOfChangedFiles returns a list of files that have changed between the current branch and the target branch

func (*Repo) GetListOfRepoFiles

func (r *Repo) GetListOfRepoFiles() ([]string, error)

GetListOfRepoFiles returns a list of all files in the local repository

func (*Repo) MergeIntoTarget

func (r *Repo) MergeIntoTarget(ctx context.Context) error

Jump to

Keyboard shortcuts

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