Documentation ¶
Index ¶
- func GetMajorAndMinorVersion(v *Version) Version
- func GetMajorAndMinorVersionPtr(v *Version) *Version
- func GetOtherRepoDepsBetweenVersions(otherRepoReleasesSorted []Version, earlierVersion, laterVersion *Version) []Version
- func SortReleaseVersions(versions []Version)
- type ChangelogNotes
- func (c *ChangelogNotes) Add(other *ChangelogNotes)
- func (c *ChangelogNotes) AddWithDependentVersion(other *ChangelogNotes, depVersion Version)
- func (c *ChangelogNotes) AddWithDependentVersionIncludeExtraNotes(other *ChangelogNotes, depVersion Version)
- func (c *ChangelogNotes) Dump() (string, error)
- type DependencyFn
- type MergedReleaseGenerator
- func (g *MergedReleaseGenerator) GenerateJSON(ctx context.Context) (string, error)
- func (g *MergedReleaseGenerator) GetMergedEnterpriseRelease(ctx context.Context) (*ReleaseData, error)
- func (g *MergedReleaseGenerator) GetOpenSourceDependency(enterpriseVersion *Version) (*Version, error)
- func (g *MergedReleaseGenerator) MergeEnterpriseReleaseWithOS(enterpriseReleases, osReleases *ReleaseData) (*ReleaseData, error)
- type MinorReleaseGroupedChangelogGenerator
- func (g *MinorReleaseGroupedChangelogGenerator) GenerateJSON(ctx context.Context) (string, error)
- func (g *MinorReleaseGroupedChangelogGenerator) GetReleaseData(ctx context.Context, cachedReleases []*github.RepositoryRelease) (*ReleaseData, error)
- func (g *MinorReleaseGroupedChangelogGenerator) NewChangelogNotes(r *github.RepositoryRelease) (*ChangelogNotes, error)
- func (g *MinorReleaseGroupedChangelogGenerator) NewReleaseData(releases []*github.RepositoryRelease) (*ReleaseData, error)
- func (g *MinorReleaseGroupedChangelogGenerator) NewVersionData() *VersionData
- type Note
- type Options
- type ReleaseData
- type VersionData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMajorAndMinorVersion ¶
func GetMajorAndMinorVersion(v *Version) Version
func GetMajorAndMinorVersionPtr ¶
func GetMajorAndMinorVersionPtr(v *Version) *Version
func GetOtherRepoDepsBetweenVersions ¶
func GetOtherRepoDepsBetweenVersions(otherRepoReleasesSorted []Version, earlierVersion, laterVersion *Version) []Version
func SortReleaseVersions ¶
func SortReleaseVersions(versions []Version)
Sorts a slice of versions in descending order by version e.g. v1.6.1, v1.6.0, v1.6.0-beta9
Types ¶
type ChangelogNotes ¶
type ChangelogNotes struct { Categories map[string][]*Note ExtraNotes []*Note HeaderSuffix string CreatedAt int64 }
func NewChangelogNotes ¶
func NewChangelogNotes() *ChangelogNotes
func (*ChangelogNotes) Add ¶
func (c *ChangelogNotes) Add(other *ChangelogNotes)
func (*ChangelogNotes) AddWithDependentVersion ¶
func (c *ChangelogNotes) AddWithDependentVersion(other *ChangelogNotes, depVersion Version)
func (*ChangelogNotes) AddWithDependentVersionIncludeExtraNotes ¶
func (c *ChangelogNotes) AddWithDependentVersionIncludeExtraNotes(other *ChangelogNotes, depVersion Version)
func (*ChangelogNotes) Dump ¶
func (c *ChangelogNotes) Dump() (string, error)
type DependencyFn ¶
type DependencyFn func(*Version) (*Version, error)
func GetOSDependencyFunc ¶
func GetOSDependencyFunc(repoOwner, enterpriseRepo, osRepo, githubToken string) (DependencyFn, error)
HOF that returns a Dependency function. The returned function generates changelogs faster than the default but requires passing in the github token.
type MergedReleaseGenerator ¶
type MergedReleaseGenerator struct {
// contains filtered or unexported fields
}
func NewMergedReleaseGenerator ¶
func NewMergedReleaseGenerator(opts Options, client *github.Client) *MergedReleaseGenerator
func NewMergedReleaseGeneratorWithDepFn ¶
func NewMergedReleaseGeneratorWithDepFn(opts Options, client *github.Client, depFn DependencyFn) *MergedReleaseGenerator
func (*MergedReleaseGenerator) GenerateJSON ¶
func (g *MergedReleaseGenerator) GenerateJSON(ctx context.Context) (string, error)
The merged release generator has 3 steps: 1. Fetches enterprise repo release notes 2. Gets open source dependency for each enterprise version 3. Merges open source release notes into enterprise version release notes
func (*MergedReleaseGenerator) GetMergedEnterpriseRelease ¶
func (g *MergedReleaseGenerator) GetMergedEnterpriseRelease(ctx context.Context) (*ReleaseData, error)
func (*MergedReleaseGenerator) GetOpenSourceDependency ¶
func (g *MergedReleaseGenerator) GetOpenSourceDependency(enterpriseVersion *Version) (*Version, error)
Enterprise changelogs have the option to "merge" open source changelogs. The following function retrieves and returns the open source version that an enterprise version depends on. It checks out the enterprise go.mod at the release version and looks for the open source dependency ({RepoOwner}/{DependentRepo}).
func (*MergedReleaseGenerator) MergeEnterpriseReleaseWithOS ¶
func (g *MergedReleaseGenerator) MergeEnterpriseReleaseWithOS(enterpriseReleases, osReleases *ReleaseData) (*ReleaseData, error)
type MinorReleaseGroupedChangelogGenerator ¶
type MinorReleaseGroupedChangelogGenerator struct { Client *github.Client // contains filtered or unexported fields }
func NewMinorReleaseGroupedChangelogGenerator ¶
func NewMinorReleaseGroupedChangelogGenerator(opts Options, client *github.Client) *MinorReleaseGroupedChangelogGenerator
* Groups releases by their minor version: v1.8 - v1.8.2 - v1.8.1 v1.7 - v1.7.1 - v1.7.0-beta9 ...
func (*MinorReleaseGroupedChangelogGenerator) GenerateJSON ¶
func (g *MinorReleaseGroupedChangelogGenerator) GenerateJSON(ctx context.Context) (string, error)
Entry point for generating changelog JSON
func (*MinorReleaseGroupedChangelogGenerator) GetReleaseData ¶
func (g *MinorReleaseGroupedChangelogGenerator) GetReleaseData(ctx context.Context, cachedReleases []*github.RepositoryRelease) (*ReleaseData, error)
func (*MinorReleaseGroupedChangelogGenerator) NewChangelogNotes ¶
func (g *MinorReleaseGroupedChangelogGenerator) NewChangelogNotes(r *github.RepositoryRelease) (*ChangelogNotes, error)
func (*MinorReleaseGroupedChangelogGenerator) NewReleaseData ¶
func (g *MinorReleaseGroupedChangelogGenerator) NewReleaseData(releases []*github.RepositoryRelease) (*ReleaseData, error)
func (*MinorReleaseGroupedChangelogGenerator) NewVersionData ¶
func (g *MinorReleaseGroupedChangelogGenerator) NewVersionData() *VersionData
type Note ¶
type Note struct { Note string // Indicates which version of the dependent Repo that this note is from FromDependentVersion *Version }
func (*Note) MarshalJSON ¶
type Options ¶
type Options struct { // Github user/org RepoOwner, MainRepo, DependentRepo string // List of Github Repository Releases for the Main Repo MainRepoReleases []*github.RepositoryRelease // List of Github Repository Releases for the Dependent Repo DependentRepoReleases []*github.RepositoryRelease // NumVersions sets the maximum amount of releases to be fetched from Github. // Once fetched, MaxVersion and MinVersion are bounds for which versions are included // in the output. The following three only bound the NumVersions int // Maximum release version to be included in this changelog. If not specified, all releases >= MinVersion // will be included MaxVersion *Version // Minimum release version to display on this changelog. If not specified, all releases <= MaxVersion // will be included MinVersion *Version }
type ReleaseData ¶
type ReleaseData struct {
Releases map[Version]*VersionData
}
Release Data is mapped such that it easy to group by minor release e.g. Releases will be a map of v1.2.0 -> VersionData, v1.3.0 -> VersionData VersionData will contain information for individual Versions
func (*ReleaseData) GetChangelogNotes ¶
func (r *ReleaseData) GetChangelogNotes(v Version) (*ChangelogNotes, error)
func (*ReleaseData) GetReleasesSorted ¶
func (r *ReleaseData) GetReleasesSorted() []Version
func (*ReleaseData) MarshalJSON ¶
func (r *ReleaseData) MarshalJSON() ([]byte, error)
type VersionData ¶
type VersionData struct {
ChangelogNotes map[Version]*ChangelogNotes
}
Contains Changelog enterpriseNotes for Individual openSourceReleases ChangelogNotes is a map of individiual openSourceReleases to enterpriseNotes e.g. v1.2.5-beta3 -> ChangelogNotes, v1.4.0 -> ChangelogNotes
func (*VersionData) MarshalJSON ¶
func (v *VersionData) MarshalJSON() ([]byte, error)