notes

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package notes wraps engine interfaces with common logic unrelated to any particular engine implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildRequest

type BuildRequest struct {
	From      string
	To        string
	ClosedPRs []git.PullRequest
	Commits   []git.Commit
}

BuildRequest is a request for changelog building.

type Builder

type Builder struct {
	Config
	Evaluator *eval.Evaluator
	Extras    map[string]string
	// contains filtered or unexported fields
}

Builder provides methods to form changelog.

func NewBuilder

func NewBuilder(cfg Config, eval *eval.Evaluator, extras map[string]string) (*Builder, error)

NewBuilder creates a new Builder.

func (*Builder) Build

func (s *Builder) Build(ctx context.Context, req BuildRequest) (string, error)

Build builds the changelog for the tag.

type CategoryConfig added in v0.7.0

type CategoryConfig struct {
	Title  string   `yaml:"title"`
	Labels []string `yaml:"labels"`

	Branch        string `yaml:"branch"`         // regexp to match source branch name
	CommitMessage string `yaml:"commit_message"` // regexp to match commit message

	// next fields are used internally
	BranchRe    *regexp.Regexp `yaml:"-"`
	CommitMsgRe *regexp.Regexp `yaml:"-"`
}

CategoryConfig describes the category configuration.

type Config added in v0.7.0

type Config struct {
	Categories []CategoryConfig `yaml:"categories"` // categories to parse in pull requests

	// field, by which pull requests must be sorted, in format +|-field
	// currently supported fields: number, author, title, closed
	SortField string `yaml:"sort_field"`

	Template     string   `yaml:"template"`      // template for a changelog.
	UnusedTitle  string   `yaml:"unused_title"`  // if set, the unused category will be built under this title at the, end of the changelog
	IgnoreLabels []string `yaml:"ignore_labels"` // labels for pull requests, which won't be in release notes
}

Config describes the configuration of the changelog builder.

func ConfigFromFile added in v0.7.0

func ConfigFromFile(path string) (Config, error)

ConfigFromFile reads the configuration from the file.

type EvalAddon added in v0.9.0

type EvalAddon struct {
	TaskTracker *tengine.Tracker
}

EvalAddon is an addon to evaluator, to be used in release notes template.

func (*EvalAddon) Funcs added in v0.9.0

func (e *EvalAddon) Funcs(ctx context.Context) (template.FuncMap, error)

Funcs returns a map of functions to be used in release notes template.

func (*EvalAddon) String added in v0.9.0

func (e *EvalAddon) String() string

String returns addon name.

type LoadedTree added in v0.9.0

type LoadedTree struct {
	Roots             []*TicketNode
	UnattachedPRs     []git.PullRequest
	UnattachedCommits []git.Commit
}

LoadedTree is a tree of tickets with their children and PRs.

type TicketNode added in v0.9.0

type TicketNode struct {
	task.Ticket
	Children []*TicketNode
	PRs      []git.PullRequest
	Commits  []git.Commit
}

TicketNode is a representation of a ticket with its children.

func (*TicketNode) GetTicket added in v0.10.0

func (t *TicketNode) GetTicket() task.Ticket

GetTicket returns the ticket. FIXME: this is ugly, but it's needed to match the interface for embedded structs.

Jump to

Keyboard shortcuts

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