Documentation
¶
Index ¶
- Constants
- func BuildChangelog(commitHistory []*model.Commit, progressChan chan *model.ProgressUpdate, ...) ([]*model.Commit, []error)
- func CheckLocalRepoAvailable(dir string) bool
- func ExtractHistoryFromFile(repoDirectory, filePath string, progressChan chan *model.ProgressUpdate, ...) ([]*model.Commit, []error)
- func ExtractPathAndFile(location string) (string, string)
- func GetTopLevel(dir string) (string, error)
- func PopulateHistory(commitHistory []*model.Commit, progressChan chan *model.ProgressUpdate, ...) ([]*model.Commit, []error)
- func ProcessGithubRepo(username, repo, filePath string, progressChan chan *model.ProgressUpdate, ...) ([]*model.Commit, []error)
- type HistoryOptions
Constants ¶
const ( GIT = "git" LOG = "log" SHOW = "show" REVPARSE = "rev-parse" TOPLEVEL = "--show-toplevel" NOPAGER = "--no-pager" FOLLOW = "--follow" LOGFORMAT = "--pretty=%cD||%h||%s||%an||%ae" NUMBER = "-n" DIV = "--" )
const GithubToken = "GH_TOKEN"
Variables ¶
This section is empty.
Functions ¶
func BuildChangelog ¶ added in v0.1.0
func BuildChangelog(commitHistory []*model.Commit, progressChan chan *model.ProgressUpdate, errorChan chan model.ProgressError, opts HistoryOptions, breakingConfig *whatChangedModel.BreakingRulesConfig, ) ([]*model.Commit, []error)
BuildChangelog compares consecutive commits and populates each with parsed documents and change data. Set opts.KeepComparable to preserve revisions even when the legacy libopenapi diff is empty.
func CheckLocalRepoAvailable ¶
func ExtractHistoryFromFile ¶
func ExtractHistoryFromFile(repoDirectory, filePath string, progressChan chan *model.ProgressUpdate, errorChan chan model.ProgressError, opts HistoryOptions, ) ([]*model.Commit, []error)
func ExtractPathAndFile ¶
func GetTopLevel ¶
func PopulateHistory ¶ added in v0.1.0
func PopulateHistory(commitHistory []*model.Commit, progressChan chan *model.ProgressUpdate, errorChan chan model.ProgressError, opts HistoryOptions, breakingConfig *whatChangedModel.BreakingRulesConfig, ) ([]*model.Commit, []error)
PopulateHistory reads file data from git for each commit, then builds the changelog. Set opts.KeepComparable to preserve revisions even when the legacy libopenapi diff is empty (used by the doctor/changerator-based commands).
func ProcessGithubRepo ¶
func ProcessGithubRepo(username, repo, filePath string, progressChan chan *model.ProgressUpdate, errorChan chan model.ProgressError, opts HistoryOptions, breakingConfig *whatChangedModel.BreakingRulesConfig, ) ([]*model.Commit, []error)
ProcessGithubRepo fetches file history from GitHub and builds the commit changelog. Set opts.KeepComparable to preserve revisions even when the legacy libopenapi diff is empty.
Types ¶
type HistoryOptions ¶ added in v0.1.0
type HistoryOptions struct {
Base string
Remote bool
ExtRefs bool
KeepComparable bool // true = preserve Documents on commits even when legacy diff is empty
Limit int
LimitTime int
ForceCutoff bool // GitHub only
GlobalRevisions bool // ExtractHistoryFromFile only
BaseCommit string
}
HistoryOptions controls how git history is fetched, traversed, and compared. BreakingConfig is intentionally kept as a separate parameter in function signatures — it controls comparison semantics, not history traversal.