projectgitops

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidInput       = errors.New("invalid git operations input")
	ErrBranchPolicy       = errors.New("git operations branch policy failed")
	ErrCommandFailed      = errors.New("git operations command failed")
	ErrDirtyWorktree      = errors.New("git operations dirty worktree")
	ErrDirtyWorktreeScope = errors.New("git operations dirty worktree outside task scope")
	ErrVerificationFailed = errors.New("git operations verification failed")
)

Functions

func DirtyWorktreeScopePaths added in v0.2.4

func DirtyWorktreeScopePaths(err error) []string

func FailureCategory added in v0.2.4

func FailureCategory(err error) string

func FailureCategoryWithDetail added in v0.2.4

func FailureCategoryWithDetail(err error) string

Types

type Command

type Command struct {
	Path string
	Args []string
	Dir  string
	Env  []string
}

type CommandResult

type CommandResult struct {
	Stdout string
	Stderr string
}

type CommandRunner

type CommandRunner interface {
	Run(context.Context, Command) (CommandResult, error)
}

type Conventions added in v0.2.4

type Conventions struct {
	CommitType               string
	CommitScope              string
	CommitSummaryTemplate    string
	PullRequestTitleTemplate string
	WhatChangedTemplate      string
	HowVerifiedTemplate      string
	TestsTemplate            string
}

func DefaultConventions added in v0.2.4

func DefaultConventions() Conventions

type DirtyWorktreeScopeError added in v0.2.4

type DirtyWorktreeScopeError struct {
	Paths []string
}

func (DirtyWorktreeScopeError) Error added in v0.2.4

func (err DirtyWorktreeScopeError) Error() string

func (DirtyWorktreeScopeError) Unwrap added in v0.2.4

func (err DirtyWorktreeScopeError) Unwrap() error

type GeneratedArtifactVerifier added in v0.2.4

type GeneratedArtifactVerifier struct {
	Paths            []string
	Command          string
	RequiredBeforePR bool
}

type Options

type Options struct {
	Enabled                      bool
	CommitAfterTask              bool
	PushAfterTask                bool
	DraftPRAfterPush             bool
	RequireCleanBeforeTask       bool
	CleanupWorktreeAfterPlanDone bool
	RemoteName                   string
	BranchPrefix                 string
	BranchNamePattern            string
	CommitAuthorName             string
	CommitAuthorEmailEnv         string
	CommitAuthorEmailFile        string
	SSHPrivateKeyPath            string
	SSHPublicKeyPath             string
	SSHKnownHostsPath            string
	GitHubTokenEnv               string
	GitHubTokenFile              string
	GitHubCLIPath                string
	Conventions                  Conventions
	Verification                 VerificationProfile
}

type PostTaskInput

type PostTaskInput struct {
	WorkDir          string
	ProjectID        string
	PlanID           string
	TaskID           string
	TaskRef          string
	TaskTitle        string
	BranchName       string
	AutomationID     string
	AutomationRunID  string
	OperatorID       string
	CommitBody       string
	AllowedPathspecs []string
	ReviewRefs       []string
	VerifierRefs     []string
	TestResults      []string
}

type PostTaskResult

type PostTaskResult struct {
	Skipped        bool
	NoChanges      bool
	CommitRef      string
	PushRef        string
	PullRequestRef string
	EvidenceRefs   []string
}

type RenderedOutput added in v0.2.4

type RenderedOutput struct {
	CommitSubject    string
	CommitBody       string
	PullRequestTitle string
	PullRequestBody  string
}

func Render added in v0.2.4

func Render(input PostTaskInput, conventions Conventions) (RenderedOutput, error)

type Service

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

func New

func New(options Options) *Service

func NewWithRunner

func NewWithRunner(options Options, runner CommandRunner) *Service

func (*Service) PostTask

func (svc *Service) PostTask(ctx context.Context, input PostTaskInput) (PostTaskResult, error)

func (*Service) PreTask

func (svc *Service) PreTask(ctx context.Context, workDir string) error

func (*Service) PreTaskWithinScope added in v0.2.4

func (svc *Service) PreTaskWithinScope(ctx context.Context, workDir string, allowedPathspecs []string) error

type VerificationProfile added in v0.2.4

type VerificationProfile struct {
	BootstrapCommands  []string
	AlwaysBeforePR     []string
	GeneratedArtifacts []GeneratedArtifactVerifier
	Env                map[string]string
}

Jump to

Keyboard shortcuts

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