rebase

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ChartsStagingBranchName is the name of the branch used to stage changes for user interaction / review.
	ChartsStagingBranchName = "charts-staging"

	// ChartsQuarantineBranchName is the name of the "working" branch where the incoming changes are applied.
	ChartsQuarantineBranchName = "quarantine"

	// RebaseBackupDir is the directory where the charts are backed up to.
	RebaseBackupDir = ".rebase-backup"
)

Variables

View Source
var (
	// AllowedDirectories is the list of directories that are allowed to be untracked in a repository wiuthout being considered dirty.
	AllowedDirectories = []string{".charts-build-scripts"}
)

Functions

func Any

func Any[T any](s []T, f func(T) bool) bool

func CheckoutHash

func CheckoutHash(wt *git.Worktree, hash plumbing.Hash) error

func Commit

func Commit(wt *git.Worktree, shouldCherryPick bool, message string, paths ...string) (plumbing.Hash, error)

func CreateBranch

func CreateBranch(r *git.Repository, branch string, hash plumbing.Hash) error

CreateBranch creates a new branch with the given hash as the head, or the current HEAD hash if empty.

func DeleteBranch

func DeleteBranch(r *git.Repository, branch string) error

func DoOnBranch

func DoOnBranch(r *git.Repository, wt *git.Worktree, branch string, f WorktreeFunc) error

func DoOnWorktree

func DoOnWorktree(wt *git.Worktree, f WorktreeFunc) error

func ForEachChart

func ForEachChart(pkg *charts.Package, pkgFs billy.Filesystem, fn ChartValidateFunc) error

func GetLocalBranchRefName

func GetLocalBranchRefName(branch string) plumbing.ReferenceName

GetLocalBranchRefName returns the reference name of a given local branch

func GetRelaventUpstreamChange

func GetRelaventUpstreamChange(upstream puller.Puller) string

func GetRemoteBranchRefName

func GetRemoteBranchRefName(branch, remote string) plumbing.ReferenceName

GetRemoteBranchRefName returns the reference name of a given remote branch

func GetUpdateExpression

func GetUpdateExpression(upstream puller.Puller) string

todo: should just replace everything or take an upstream delta

func IsWorktreeClean

func IsWorktreeClean(wt *git.Worktree) (bool, error)

func SwitchToBranch

func SwitchToBranch(wt *git.Worktree, branch string) error

func ToPtr

func ToPtr[T any](t T) *T

func UpstreamRef

func UpstreamRef(upstream options.UpstreamOptions) string

func ValidateHelmLint

func ValidateHelmLint(pkg *charts.Package, wt *git.Worktree, pkgFs billy.Filesystem) error

func ValidateWorktree

func ValidateWorktree(pkg *charts.Package, wt *git.Worktree, _ billy.Filesystem) error

Types

type Backup

type Backup interface {
	io.Closer

	Backup() error
}

func NewBackup

func NewBackup(sources []string, destination string) (Backup, error)

type ChartValidateFunc

type ChartValidateFunc func(string) error

ChartValidateFunc is a function that verifies a chart using the provided filesystem.

type FilesystemBackup

type FilesystemBackup struct {
	Sources     []string
	Destination string
	// contains filtered or unexported fields
}

func (*FilesystemBackup) Backup

func (b *FilesystemBackup) Backup() error

func (*FilesystemBackup) Close

func (b *FilesystemBackup) Close() error

type NoopBackup

type NoopBackup struct{}

func (*NoopBackup) Backup

func (b *NoopBackup) Backup() error

func (*NoopBackup) Close

func (b *NoopBackup) Close() error

type Options

type Options struct {
	Logger            *slog.Logger
	Resolver          resolve.Resolver
	EnableBackup      bool
	DisableValidators bool
	ImageNamespace    string
}

type PackageValidateFunc

type PackageValidateFunc func(*charts.Package, *git.Worktree, billy.Filesystem) error

PackageValidateFunc is a function that verifies a package using the provided filesystem.

func ValidateImagesInNamespaceFactory added in v0.1.8

func ValidateImagesInNamespaceFactory(namespace string) PackageValidateFunc

func ValidatePatternNotFoundFactory

func ValidatePatternNotFoundFactory(pattern string) PackageValidateFunc

type Rebase

type Rebase struct {
	Options

	Package *charts.Package
	RootFs  billy.Filesystem
	PkgFs   billy.Filesystem
	Iter    iter.UpstreamIter
	// contains filtered or unexported fields
}

func NewRebase

func NewRebase(pkg *charts.Package, rootFs billy.Filesystem, pkgFs billy.Filesystem, iter iter.UpstreamIter, opts Options) (*Rebase, error)

func (*Rebase) Rebase

func (r *Rebase) Rebase() error

type ValidateError

type ValidateError struct {
	// contains filtered or unexported fields
}

func (ValidateError) Error

func (e ValidateError) Error() string

func (ValidateError) Is

func (e ValidateError) Is(err error) bool

type WorktreeFunc

type WorktreeFunc func(wt *git.Worktree) error

Jump to

Keyboard shortcuts

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