Documentation ¶
Index ¶
- Constants
- Variables
- func ChangelogDirExists(fs afero.Fs, changelogParentPath string) (bool, error)
- func GenerateChangelogForTags(ctx context.Context, tags []string, reader ChangelogReader, w io.Writer) error
- func GenerateChangelogFromLocalDirectory(ctx context.Context, repoRootPath, owner, repo, changelogDirPath string, ...) error
- func GenerateChangelogMarkdown(changelog *Changelog) string
- func GetChangelogMarkdownForPR(owner, repo string) (string, error)
- func GetLatestTag(ctx context.Context, owner, repo string) (string, error)
- func GetProposedTag(fs afero.Fs, latestTag, changelogParentPath string) (string, error)
- func GetProposedTagForRepo(ctx context.Context, client *github.Client, owner, repo string) (string, error)deprecated
- func IsInvalidDirectoryNameError(err error) bool
- func IsMultipleVersionsFoundError(err error) bool
- func IsNoVersionFoundError(err error) bool
- func RefHasChangelog(ctx context.Context, client *github.Client, owner, repo, sha string) (bool, error)deprecated
- type Changelog
- type ChangelogEntry
- type ChangelogEntryType
- type ChangelogFile
- type ChangelogList
- type ChangelogReader
- type ChangelogTmplData
- type ChangelogValidator
- type ValidationSettings
Constants ¶
View Source
const ( ChangelogDirectory = "changelog" SummaryFile = "summary.md" ClosingFile = "closing.md" )
View Source
const (
MasterBranch = "master"
)
Variables ¶
View Source
var ( MountLocalDirectoryError = func(err error) error { return errors.Wrapf(err, "unable to mount local directory") } OpenChangelogDirError = func(err error) error { return errors.Wrapf(err, "unable to open changelog directory") } ReadChangelogDirError = func(err error) error { return errors.Wrapf(err, "unable to read changelog directory") } GetChangelogForTagError = func(err error) error { return errors.Wrapf(err, "unable to get changelog for tag") } GenerateChangelogSummaryTemplateError = func(err error) error { return errors.Wrapf(err, "unable to generate changelog summary from template") } )
View Source
var ( UnableToListFilesError = func(err error, directory string) error { return errors.Wrapf(err, "Unable to list files in directory %s", directory) } UnexpectedDirectoryError = func(name, directory string) error { return errors.Errorf("Unexpected directory %s in changelog directory %s", name, directory) } UnableToReadSummaryFileError = func(err error, path string) error { return errors.Wrapf(err, "Unable to read summary file %s", path) } UnableToReadClosingFileError = func(err error, path string) error { return errors.Wrapf(err, "Unable to read closing file %s", path) } NoEntriesInChangelogError = func(filename string) error { return errors.Errorf("No changelog entries found in file %s.", filename) } UnableToParseChangelogError = func(err error, path string) error { return errors.Wrapf(err, "File %s is not a valid changelog file.", path) } MissingIssueLinkError = errors.Errorf("Changelog entries must have an issue link") MissingDescriptionError = errors.Errorf("Changelog entries must have a description") MissingOwnerError = errors.Errorf("Dependency bumps must have an owner") MissingRepoError = errors.Errorf("Dependency bumps must have a repo") MissingTagError = errors.Errorf("Dependency bumps must have a tag") )
View Source
var ( NoChangelogFileAddedError = errors.Errorf("A changelog file must be added. For more information, check out https://github.com/solo-io/go-utils/tree/master/changelogutils.") TooManyChangelogFilesAddedError = func(filesAdded int) error { return errors.Errorf("Only one changelog file can be added in a PR, found %d.", filesAdded) } UnexpectedFileInChangelogDirectoryError = func(name string) error { return errors.Errorf("Found unexpected file %s in changelog directory.", name) } InvalidChangelogSubdirectoryNameError = func(name string) error { return errors.Errorf("%s is not a valid changelog directory name, must be a semver version.", name) } ListReleasesError = func(err error) error { return errors.Wrapf(err, "Error listing releases") } MultipleNewVersionsFoundError = func(latest, version1, version2 string) error { return errors.Errorf("Only one version greater than the latest release %s valid, found %s and %s.", latest, version1, version2) } NoNewVersionsFoundError = func(latest string) error { return errors.Errorf("No new versions greater than the latest release %s found.", latest) } AddedChangelogInOldVersionError = func(latest string) error { return errors.Errorf("Can only add changelog to unreleased version (currently %s)", latest) } InvalidUseOfStableApiError = func(tag string) error { return errors.Errorf("Changelog indicates this is a stable API release, which should be used only to indicate the release of v1.0.0, not %s", tag) } UnexpectedProposedVersionError = func(expected, actual string) error { return errors.Errorf("Expected version %s to be next changelog version, found %s", expected, actual) } )
Functions ¶
func ChangelogDirExists ¶
Deprecated
func GenerateChangelogForTags ¶ added in v0.10.16
func GenerateChangelogFromLocalDirectory ¶ added in v0.10.16
func GetLatestTag ¶
Should return the last released version Deprecated: use githubutils.RepoClient.FindLatestReleaseIncludingPrerelease instead
func GetProposedTag ¶
Should return the next version to release, based on the names of the subdirectories in the changelog Will return an error if there is no version, or multiple versions, larger than the latest tag, according to semver Deprecated: use ChangelogValidator instead
func IsNoVersionFoundError ¶
Types ¶
type Changelog ¶
type Changelog struct { Files []*ChangelogFile Summary string Version *versionutils.Version Closing string }
type ChangelogEntry ¶
type ChangelogEntry struct { Type ChangelogEntryType `json:"type"` Description string `json:"description"` IssueLink string `json:"issueLink"` DependencyOwner string `json:"dependencyOwner,omitempty"` DependencyRepo string `json:"dependencyRepo,omitempty"` DependencyTag string `json:"dependencyTag,omitempty"` ResolvesIssue *bool `json:"resolvesIssue,omitempty"` }
func (*ChangelogEntry) GetResolvesIssue ¶
func (c *ChangelogEntry) GetResolvesIssue() bool
type ChangelogEntryType ¶
type ChangelogEntryType int
const ( BREAKING_CHANGE ChangelogEntryType = iota FIX NEW_FEATURE NON_USER_FACING DEPENDENCY_BUMP HELM UPGRADE )
func (ChangelogEntryType) BreakingChange ¶
func (clt ChangelogEntryType) BreakingChange() bool
func (ChangelogEntryType) MarshalJSON ¶
func (clt ChangelogEntryType) MarshalJSON() ([]byte, error)
func (ChangelogEntryType) NewFeature ¶ added in v0.10.28
func (clt ChangelogEntryType) NewFeature() bool
func (ChangelogEntryType) String ¶
func (clt ChangelogEntryType) String() string
func (*ChangelogEntryType) UnmarshalJSON ¶
func (clt *ChangelogEntryType) UnmarshalJSON(data []byte) error
type ChangelogFile ¶
type ChangelogFile struct { Entries []*ChangelogEntry `json:"changelog,omitempty"` ReleaseStableApi *bool `json:"releaseStableApi,omitempty"` }
func ReadChangelogFile
deprecated
func ReadChangelogFile(fs afero.Fs, path string) (*ChangelogFile, error)
Deprecated: use changelogutils.ChangelogReader instead
func (*ChangelogFile) GetReleaseStableApi ¶
func (c *ChangelogFile) GetReleaseStableApi() bool
func (*ChangelogFile) HasBreakingChange ¶
func (c *ChangelogFile) HasBreakingChange() bool
type ChangelogList ¶ added in v0.10.16
type ChangelogList []*Changelog
func (ChangelogList) Len ¶ added in v0.10.16
func (l ChangelogList) Len() int
func (ChangelogList) Less ¶ added in v0.10.16
func (l ChangelogList) Less(i, j int) bool
func (ChangelogList) Swap ¶ added in v0.10.16
func (l ChangelogList) Swap(i, j int)
type ChangelogReader ¶
type ChangelogReader interface { GetChangelogForTag(ctx context.Context, tag string) (*Changelog, error) ReadChangelogFile(ctx context.Context, path string) (*ChangelogFile, error) }
func NewChangelogReader ¶
func NewChangelogReader(code vfsutils.MountedRepo) ChangelogReader
type ChangelogTmplData ¶ added in v0.10.16
type ChangelogValidator ¶
type ChangelogValidator interface { ShouldCheckChangelog(ctx context.Context) (bool, error) ValidateChangelog(ctx context.Context) (*ChangelogFile, error) }
func NewChangelogValidator ¶
func NewChangelogValidator(client githubutils.RepoClient, code vfsutils.MountedRepo, base string) ChangelogValidator
func NewChangelogValidatorWithSettings ¶ added in v0.11.1
func NewChangelogValidatorWithSettings(client githubutils.RepoClient, code vfsutils.MountedRepo, base string, settings ValidationSettings) ChangelogValidator
type ValidationSettings ¶ added in v0.11.1
type ValidationSettings struct {
RelaxSemverValidation bool
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.