changelog

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2019 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildChangelog

func BuildChangelog(
	ctx context.Context,
	client *githubv4.Client,
	logger hclog.Logger,
	changelogTemplate,
	releaseNoteTemplate,
	owner, repo, branch string,
	start, end time.Time,
) (string, error)

func TimeFromCommit

func TimeFromCommit(
	ctx context.Context,
	client *githubv4.Client,
	owner, repo, commit string,
) (time.Time, error)

Types

type ReleaseNote

type ReleaseNote struct {
	// Text is the actual content of the release note
	Text string `json:"text"`

	// Author is the GitHub username of the commit author
	Author string `json:"author"`

	// AuthorURL is the GitHub URL of the commit author
	AuthorURL string `json:"author_url"`

	//PRDate is the Date the PR was merged
	PRDate time.Time `json:"pr_date"`

	// PRUrl is a URL to the PR
	PRURL string `json:"pr_url"`

	// PRNumber is the number of the PR
	PRNumber int `json:"pr_number"`

	// Labels is a list of all the labels on the PR.
	Labels []string `labels:"areas,omitempty"`

	// Indicates whether or not a note will appear as a bug (`bug` label).
	Bug bool `json:"bug,omitempty"`

	// BreakingChange indicates if this change was breaking (the
	// `breaking-change` label was applied to the PR).
	BreakingChange bool `json:"breaking_change,omitempty"`

	// Type is the type of entry the ReleaseNote is
	Type string
}

ReleaseNote is the type that represents the total sum of all the information we've gathered about a single release note.

type ReleaseNoteEntry added in v1.1.0

type ReleaseNoteEntry struct {
	Type string
	Text string
}

ReleaseNoteEntry is a struct containing the type of entry and the body of the entry. One or more ReleaseNoteEntry is extracted from a PR, and represents a single item within the release notes.

func ReleaseNoteBlocks added in v1.1.0

func ReleaseNoteBlocks(title, body string) []ReleaseNoteEntry

ReleaseNoteBlocks accepts the PR title and body contents, and parses them into one or more `ReleaseNoteEntry`s. It first attempts to find explicit releasenote code blocks within the body, and failing that, falls back on using the PR title as long as it is not empty.

Jump to

Keyboard shortcuts

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