git

package
v0.0.1-prerelease5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrProposalNotFound = errors.New("proposal not found")

Functions

func ProposeChanges

func ProposeChanges[A Resource](opts ProposalOption) containers.Option[Source[A]]

ProposeChanges configures the phase to propose the change (via PR or MR) as opposed to directly integrating it into the target trunk branch.

Types

type Branched

type Branched interface {
	Branch() string
}

type Proposal

type Proposal struct {
	BaseRevision string
	BaseBranch   string
	Branch       string
	Digest       string
	Title        string
	Body         string

	ExternalMetadata map[string]any
}

Proposal contains the fields necessary to propose a resource update to a Repository.

type ProposalOption

type ProposalOption struct {
	Labels []string
}

type Proposer

type Proposer interface {
	GetCurrentProposal(_ context.Context, baseBranch, branchPrefix string) (*Proposal, error)
	CreateProposal(context.Context, *Proposal, ProposalOption) error
	MergeProposal(context.Context, *Proposal) error
	CloseProposal(context.Context, *Proposal) error
}

type Resource

type Resource interface {
	core.Resource
	ReadFrom(context.Context, core.Metadata, fs.Filesystem) error
	WriteTo(context.Context, core.Metadata, fs.Filesystem) error
}

type Source

type Source[A Resource] struct {
	// contains filtered or unexported fields
}

func NewSource

func NewSource[A Resource](repo *git.Repository, proposer Proposer, opts ...containers.Option[Source[A]]) (_ *Source[A])

func (*Source[A]) Metadata

func (*Source[A]) Metadata() core.Metadata

func (*Source[A]) Update

func (g *Source[A]) Update(ctx context.Context, pipeline, phase core.Metadata, from, to A) error

func (*Source[A]) View

func (g *Source[A]) View(ctx context.Context, _, phase core.Metadata, r A) error

Jump to

Keyboard shortcuts

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