relnotes

package
v0.0.0-...-c8d90df Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

README

The Release Notes Aggregation Library

This package will aggregate all pending release notes, which are stored in individual files, into a single unordered list in Markdown format. This aggregated list will be inserted at the top of the existing release notes, which is read from a file as a new milestone heading.

The new release notes will be returned to the caller which will be responsible for writing them to a file.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregator

type Aggregator interface {
	// ListNoteFiles will retrieve the base filenames of all files that are
	// considered to be release notes. This function matches all Markdown
	// files (with `*.md` extension), but ignores README.md (if present).
	ListNoteFiles(ctx context.Context, fs vfs.FS, notesDir string) ([]string, error)

	// Aggregate will process all release notes in the //relnotes directory.
	// It will read the current release notes file, identified by |relnotesPath|,
	// to determine the next milestone number. It then aggregates the individual
	// release notes, contained in the //relnotes folder, into a single
	// markdown list. This list will be inserted as a new milestone heading
	// section into a release notes Markdown stream returned as an array of bytes.
	// This function does not modify the existing release notes file.
	Aggregate(ctx context.Context, fs vfs.FS, currentMilestone int, aggregateFilePath, relnotesDir string) ([]byte, error)
}

Aggregator defines an interface for processing all release notes for an upcoming release milestone into a single file.

type AggregatorImpl

type AggregatorImpl struct {
}

func NewAggregator

func NewAggregator() *AggregatorImpl

NewAggregator creates a new relnotes AggregatorImpl object that can be used to aggregate release notes.

func (*AggregatorImpl) Aggregate

func (a *AggregatorImpl) Aggregate(ctx context.Context, fs vfs.FS, newMilestone int, aggregateFilePath, relnotesDir string) ([]byte, error)

Aggregate does the following:

  1. Read all release notes contained within the |relnotesDir| directory.
  2. Create a new m+1 milestone heading with the new release notes included in an unordered list.
  3. Return a new byte array which are the existing release notes, read from |aggregateFilePath|, but with the new milestone section inserted at the top of the stream.

This function does not modify any files on disk. The caller is responsible for writing these modified release notes to disk if desired.

func (*AggregatorImpl) ListNoteFiles

func (a *AggregatorImpl) ListNoteFiles(ctx context.Context, fs vfs.FS, notesDir string) ([]string, error)

provide implementation of ListNoteFiles.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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