engine

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeUnreleased = "unreleased"
	ModeRelease    = "release"
)

Mode identifiers for changelog engine runs.

Variables

This section is empty.

Functions

func FormatAssemblyFailureMessage

func FormatAssemblyFailureMessage(errors []section.AssemblyError) string

FormatAssemblyFailureMessage mirrors formatAssemblyFailureMessage in changelog-engine-factory.js.

func ValidateModeAndTargetVersion

func ValidateModeAndTargetVersion(mode, targetVersion string) error

ValidateModeAndTargetVersion mirrors validateModeAndTargetVersion in changelog-engine-factory.js.

Types

type FS

type FS interface {
	ReadFile(path string) ([]byte, error)
	WriteFile(path string, data []byte, perm fs.FileMode) error
}

FS abstracts changelog file IO for Run.

type MergedPRGatherer

type MergedPRGatherer interface {
	GatherMergedPRs(ctx context.Context, owner, repo, compareRange string) ([]section.MergedPR, []string, error)
}

MergedPRGatherer lists merged Pull Requests reachable from the git compare range (mirrors JS engine). The second return value is soft-failure warnings (mirrors core.warning in the JS engine).

type Options

type Options struct {
	Mode          string
	TargetVersion string
	Owner         string
	Repo          string
	ChangelogPath string
	Now           func() time.Time
	FS            FS
	Git           semver.Execer
	Gather        MergedPRGatherer
}

Options configures engine.Run — callers supply env-derived fields and adapters.

type Result

type Result struct {
	TargetVersionOutput    string // empty when not release (matches JS target_version output)
	PreviousTag            string
	CompareRange           string
	TargetBranch           string // resolved canonical branch prior to TARGET_BRANCH override
	SectionHeader          string
	HasPRs                 bool
	HasUserFacingChanges   bool
	Included               []section.IncludedPR
	Excluded               []section.ExcludedPR
	SkippedChangelogUpdate bool
	Warnings               []string
}

Result summarizes engine execution for callers and CI outputs.

func Run

func Run(ctx context.Context, opts Options) (Result, error)

Run validates inputs, resolves compare context, gathers PRs, renders, and optionally rewrites CHANGELOG.md.

Jump to

Keyboard shortcuts

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