Documentation ¶
Index ¶
- Constants
- Variables
- func BuildOutput(changes GitChange, options GitChangeLogOptions) string
- func BuildUnknownOutput(builder *strings.Builder, changes GitChange)
- func CleanFrontAsterisk(title string) string
- func CloneRepo(ref issues.RepoRef, protocol string, dir string) error
- func CommitHasBreakingChange(body string) bool
- func GetChangeLogOutputMessage(bump semver.Bump, c GitChanges, options GitChangeLogOptions) string
- func GetCurrentOrgAndRepo() issues.RepoRef
- func GetCurrentRepoPath() (string, error)
- func GetIssueLink(dir string, issue string) string
- func GetOrgAndRepoFromPath(path string) (string, string)
- func GetRepoPath(path string) (string, error)
- func GetRepoRefFromPath(path string) issues.RepoRef
- func LongBodyFormatter(body string) string
- func NewGithubClient(token string) *github.Client
- func Slug(in string) string
- func Split(r rune) bool
- type BranchName
- type BranchPart
- type BranchParts
- type BranchSpec
- func (b BranchSpec) GetBranchTemplate(typ BranchType) string
- func (b BranchSpec) GetBranchType(branch BranchName) (BranchType, error)
- func (b BranchSpec) GetIssueNumber(branch BranchName) (string, error)
- func (b BranchSpec) GetReleaseNameAndVersion(branch BranchName) (name, version string, err error)
- func (b BranchSpec) IsDevelop(branch BranchName) bool
- func (b BranchSpec) IsFeature(branch BranchName) bool
- func (b BranchSpec) IsMaster(branch BranchName) bool
- func (b BranchSpec) IsRelease(branch BranchName) bool
- func (f BranchSpec) MarshalYAML() (interface{}, error)
- func (b BranchSpec) RenderFeature(name string, number interface{}) (string, error)
- func (b BranchSpec) RenderRelease(parameters BranchParts) (string, error)
- func (f *BranchSpec) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (b BranchSpec) WithDefaults() BranchSpec
- func (b BranchSpec) WithDefaultsFrom(d BranchSpec) BranchSpec
- type BranchType
- type Config
- type Deployer
- type GitAcceptPRCommand
- type GitChange
- type GitChangeLog
- type GitChangeLogOptions
- type GitChangeStory
- type GitChanges
- type GitPullRequestCommand
- type GitWrapper
- func (g GitWrapper) AddAndCommit(message string, files ...string) error
- func (g GitWrapper) Branch() string
- func (g GitWrapper) Branches() []string
- func (g GitWrapper) ChangeLog(notInBranch, inBranch string, svc issues.IssueService, ...) (GitChangeLog, error)
- func (g GitWrapper) CheckOutBranch(branch string) error
- func (g GitWrapper) CheckOutOrCreateBranch(branch string) error
- func (g GitWrapper) CreateBranch(branch string) error
- func (g GitWrapper) Dir() string
- func (g GitWrapper) Exec(args ...string) (string, error)
- func (g GitWrapper) ExecLines(args ...string) ([]string, error)
- func (g GitWrapper) ExecVerbose(args ...string) (string, error)
- func (g GitWrapper) Fetch(flags ...string) error
- func (g GitWrapper) GetCurrentCommit() string
- func (g GitWrapper) IsDirty() bool
- func (g GitWrapper) IsMerged(fromBranch, toBranch string) bool
- func (g GitWrapper) Log(args ...string) ([]string, error)
- func (g GitWrapper) Pull() error
- func (g GitWrapper) PullRebase() error
- func (g GitWrapper) Push() error
- func (g GitWrapper) Tag() string
- func (g GitWrapper) Worktree(branch BranchName) (Worktree, error)
- type IssueRef
- type IssueService
- func (s IssueService) AddDependency(from, to issues.IssueRef, parentIssueNum string) error
- func (s IssueService) ChangeLabels(ref issues.IssueRef, add []string, remove []string) error
- func (s IssueService) Create(issue issues.Issue) (string, error)
- func (s IssueService) GetChildRefs(issue issues.IssueRef) ([]issues.IssueRef, error)
- func (s IssueService) GetClosedIssue(org, repoName string) ([]int, error)
- func (s IssueService) GetIssue(ref issues.IssueRef) (issues.Issue, error)
- func (s IssueService) GetIssueState(issue issues.IssueRef) (string, error)
- func (s IssueService) GetParentRefs(issue issues.IssueRef) ([]issues.IssueRef, error)
- func (s IssueService) GetRepoIdbyName(org, repoName string) (int, error)
- func (s IssueService) RemoveDependency(from, to issues.IssueRef) error
- func (s IssueService) SetProgress(issue issues.IssueRef, column string) error
- func (s IssueService) SplitIssueRef(issue issues.IssueRef) (string, string, int, error)
- type Worktree
- type WorktreeConfig
Constants ¶
View Source
const ( BranchTypeMaster = BranchType("master") BranchTypeDevelop = BranchType("develop") BranchTypeRelease = BranchType("release") BranchTypeFeature = BranchType("feature") BranchPartSlug = BranchPart("Slug") BranchPartVersion = BranchPart("Version") BranchPartNumber = BranchPart("Number") BranchPartName = BranchPart("Name") )
View Source
const ( StateLookingForCommitNumber = iota StateLookingForAuthor StateLookingForDate StateLookingForTitle StateLookingForBody )
View Source
const MalformedCommitFlag = "malformed"
Variables ¶
View Source
var RegexGetCommitId = regexp.MustCompile(` .{40}`)
View Source
var RegexGetCommitType = regexp.MustCompile(`(` + allCommitTypeString + `)`)
View Source
var RegexGetDate = regexp.MustCompile(`Date: `)
View Source
var RegexGetIssue = regexp.MustCompile(`[0-9]+$`)
View Source
var RegexMatchAlternativeTitle = regexp.MustCompile(`^\* .*`)
View Source
var RegexMatchAuthor = regexp.MustCompile(`Author: ([^<]+)\s+<([^>]+)>`)
View Source
var RegexMatchCommitID = regexp.MustCompile(`commit .{40}`)
TODO: imporve Regex with $ and ^ to be robust
View Source
var RegexMatchDate = regexp.MustCompile(`Date: .*`)
View Source
var RegexMatchFormattedTitle = regexp.MustCompile(`(` + allCommitTypeString + `)(\([^)]+\))?:(.*)`)
View Source
var RegexMatchIssue = regexp.MustCompile(`\s+(resolves )?(@|#)?[0-9]+$|^[0-9]+$`)
Functions ¶
func BuildOutput ¶
func BuildOutput(changes GitChange, options GitChangeLogOptions) string
func BuildUnknownOutput ¶
func CleanFrontAsterisk ¶
func CommitHasBreakingChange ¶
func GetChangeLogOutputMessage ¶
func GetChangeLogOutputMessage(bump semver.Bump, c GitChanges, options GitChangeLogOptions) string
func GetCurrentOrgAndRepo ¶
func GetCurrentRepoPath ¶
func GetIssueLink ¶
func GetOrgAndRepoFromPath ¶
func GetRepoPath ¶
func GetRepoRefFromPath ¶
func LongBodyFormatter ¶
func NewGithubClient ¶
GetGithubClient gets a github client. If token == "" the client will not be authenticated.
Types ¶
type BranchName ¶
type BranchName string
func (BranchName) GetBranchType ¶
func (b BranchName) GetBranchType(spec BranchSpec) (BranchType, error)
func (BranchName) String ¶
func (b BranchName) String() string
type BranchPart ¶
type BranchPart string
type BranchParts ¶
type BranchParts map[BranchPart]string
func (BranchParts) Map ¶
func (b BranchParts) Map() map[string]string
type BranchSpec ¶
type BranchSpec struct { Master string `yaml:"master"` Develop string `yaml:"develop"` /* Release is the template for feature branches. The template parameter is: { "Version":int, "Name":string, } */ Release string `yaml:"release"` /* Feature is the template for feature branches. The template parameter is: { "ID":int, "Slug":string, } */ Feature string `yaml:"feature"` IsDefaulted bool `yaml:"-"` }
func (BranchSpec) GetBranchTemplate ¶
func (b BranchSpec) GetBranchTemplate(typ BranchType) string
func (BranchSpec) GetBranchType ¶
func (b BranchSpec) GetBranchType(branch BranchName) (BranchType, error)
func (BranchSpec) GetIssueNumber ¶
func (b BranchSpec) GetIssueNumber(branch BranchName) (string, error)
func (BranchSpec) GetReleaseNameAndVersion ¶
func (b BranchSpec) GetReleaseNameAndVersion(branch BranchName) (name, version string, err error)
func (BranchSpec) IsDevelop ¶
func (b BranchSpec) IsDevelop(branch BranchName) bool
func (BranchSpec) IsFeature ¶
func (b BranchSpec) IsFeature(branch BranchName) bool
func (BranchSpec) IsMaster ¶
func (b BranchSpec) IsMaster(branch BranchName) bool
func (BranchSpec) IsRelease ¶
func (b BranchSpec) IsRelease(branch BranchName) bool
func (BranchSpec) MarshalYAML ¶
func (f BranchSpec) MarshalYAML() (interface{}, error)
func (BranchSpec) RenderFeature ¶
func (b BranchSpec) RenderFeature(name string, number interface{}) (string, error)
func (BranchSpec) RenderRelease ¶
func (b BranchSpec) RenderRelease(parameters BranchParts) (string, error)
func (*BranchSpec) UnmarshalYAML ¶
func (f *BranchSpec) UnmarshalYAML(unmarshal func(interface{}) error) error
func (BranchSpec) WithDefaults ¶
func (b BranchSpec) WithDefaults() BranchSpec
func (BranchSpec) WithDefaultsFrom ¶
func (b BranchSpec) WithDefaultsFrom(d BranchSpec) BranchSpec
type BranchType ¶
type BranchType string
type Deployer ¶
type Deployer struct {
// contains filtered or unexported fields
}
func NewDeployer ¶
func (Deployer) CreateDeploy ¶
func (Deployer) GetMostRecentSuccessfulDeployment ¶
func (d Deployer) GetMostRecentSuccessfulDeployment() (*github.Deployment, error)
type GitAcceptPRCommand ¶
type GitAcceptPRCommand struct { PRNumber int RepoDirectory string // if true, will skip merging the base branch back into the pr branch before merging into the target. DoNotMergeBaseIntoBranch bool Client *github.Client IssueService issues.IssueService }
func (GitAcceptPRCommand) Execute ¶
func (c GitAcceptPRCommand) Execute() error
type GitChange ¶
type GitChangeLog ¶
type GitChangeLog struct { VersionBump semver.Bump Changes GitChanges OutputMessage string }
type GitChangeLogOptions ¶
type GitChangeStory ¶
type GitChanges ¶
type GitChanges []GitChange
func (GitChanges) FilterByBump ¶
func (g GitChanges) FilterByBump(bumps ...semver.Bump) GitChanges
func (GitChanges) GetSeparatedChanges ¶
func (g GitChanges) GetSeparatedChanges() map[semver.Bump]GitChanges
func (GitChanges) GetVersionBump ¶
func (g GitChanges) GetVersionBump() semver.Bump
func (GitChanges) MapToStories ¶
func (g GitChanges) MapToStories(svc issues.IssueService) ([]*GitChangeStory, error)
type GitPullRequestCommand ¶
type GitPullRequestCommand struct { Reviewers []string Title string Body string Base string FromBranch string LocalRepoPath string Client *github.Client }
func (GitPullRequestCommand) Execute ¶
func (c GitPullRequestCommand) Execute() (issueNmb, prNumber int, err error)
type GitWrapper ¶
type GitWrapper struct {
// contains filtered or unexported fields
}
func NewGitWrapper ¶
func NewGitWrapper(pathHint string) (GitWrapper, error)
func (GitWrapper) AddAndCommit ¶
func (g GitWrapper) AddAndCommit(message string, files ...string) error
func (GitWrapper) Branch ¶
func (g GitWrapper) Branch() string
func (GitWrapper) Branches ¶
func (g GitWrapper) Branches() []string
func (GitWrapper) ChangeLog ¶
func (g GitWrapper) ChangeLog(notInBranch, inBranch string, svc issues.IssueService, options GitChangeLogOptions) (GitChangeLog, error)
func (GitWrapper) CheckOutBranch ¶
func (g GitWrapper) CheckOutBranch(branch string) error
func (GitWrapper) CheckOutOrCreateBranch ¶
func (g GitWrapper) CheckOutOrCreateBranch(branch string) error
func (GitWrapper) CreateBranch ¶
func (g GitWrapper) CreateBranch(branch string) error
func (GitWrapper) Dir ¶
func (g GitWrapper) Dir() string
func (GitWrapper) ExecVerbose ¶
func (g GitWrapper) ExecVerbose(args ...string) (string, error)
func (GitWrapper) Fetch ¶
func (g GitWrapper) Fetch(flags ...string) error
func (GitWrapper) GetCurrentCommit ¶
func (g GitWrapper) GetCurrentCommit() string
func (GitWrapper) IsDirty ¶
func (g GitWrapper) IsDirty() bool
func (GitWrapper) IsMerged ¶
func (g GitWrapper) IsMerged(fromBranch, toBranch string) bool
func (GitWrapper) Pull ¶
func (g GitWrapper) Pull() error
func (GitWrapper) PullRebase ¶
func (g GitWrapper) PullRebase() error
func (GitWrapper) Push ¶
func (g GitWrapper) Push() error
func (GitWrapper) Tag ¶
func (g GitWrapper) Tag() string
func (GitWrapper) Worktree ¶
func (g GitWrapper) Worktree(branch BranchName) (Worktree, error)
type IssueService ¶
type IssueService struct { Config // contains filtered or unexported fields }
func NewIssueService ¶
func NewIssueService(config Config, log *logrus.Entry) (IssueService, error)
func (IssueService) AddDependency ¶
func (s IssueService) AddDependency(from, to issues.IssueRef, parentIssueNum string) error
func (IssueService) ChangeLabels ¶
func (IssueService) GetChildRefs ¶
func (IssueService) GetClosedIssue ¶
func (s IssueService) GetClosedIssue(org, repoName string) ([]int, error)
func (IssueService) GetIssueState ¶
func (s IssueService) GetIssueState(issue issues.IssueRef) (string, error)
func (IssueService) GetParentRefs ¶
func (IssueService) GetRepoIdbyName ¶
func (s IssueService) GetRepoIdbyName(org, repoName string) (int, error)
func (IssueService) RemoveDependency ¶
func (s IssueService) RemoveDependency(from, to issues.IssueRef) error
func (IssueService) SetProgress ¶
func (s IssueService) SetProgress(issue issues.IssueRef, column string) error
func (IssueService) SplitIssueRef ¶
type Worktree ¶
type Worktree struct { GitWrapper WorktreeConfig // contains filtered or unexported fields }
func NewWorktree ¶
func NewWorktree(g GitWrapper, branch BranchName) (Worktree, error)
func (Worktree) ResolvePath ¶
Click to show internal directories.
Click to hide internal directories.