Documentation ¶
Index ¶
- Constants
- Variables
- func BitBucketCloudAccessTokenURL(url string, username string) string
- func BitBucketServerAccessTokenURL(url string) string
- func EnsureUserAndEmailSetup(gitter Gitter) (string, string, error)
- func FetchAndMergeSHAs(SHAs []string, baseBranch string, baseSha string, remote string, dir string, ...) error
- func GenerateMarkdown(releaseSpec *v1.ReleaseSpec, gitInfo *GitRepository) (string, error)
- func GetHost(gitProvider GitProvider) (string, error)
- func GetOrganizations(orgLister OrganisationLister, userName string) []string
- func GetOwner(batchMode bool, provider GitProvider, gitUsername string, ...) (string, error)
- func GetRepoName(batchMode, allowExistingRepo bool, provider GitProvider, ...) (string, error)
- func GitHubAccessTokenURL(url string) string
- func GitHubEnterpriseApiEndpointURL(u string) string
- func GiteaAccessTokenURL(url string) string
- func GitlabAccessTokenURL(url string) string
- func IsGitHubServerURL(u string) bool
- func IsGitLabServerURL(u string) bool
- func IsGitRepoStatusFailed(statuses ...*GitRepoStatus) bool
- func IsGitRepoStatusSuccess(statuses ...*GitRepoStatus) bool
- func PickOrganisation(orgLister OrganisationLister, userName string, in terminal.FileReader, ...) (string, error)
- func ProviderAccessTokenURL(kind string, url string, username string) string
- func ReleaseDownloadCount(releases []*GitRelease) int
- func SaasGitKind(gitServiceUrl string) string
- func Unshallow(dir string, gitter Gitter) error
- type BitbucketCloudProvider
- func (b *BitbucketCloudProvider) AcceptInvitation(ID int64) (*github.Response, error)
- func (b *BitbucketCloudProvider) AddCollaborator(user string, organisation string, repo string) error
- func (b *BitbucketCloudProvider) AddPRComment(pr *GitPullRequest, comment string) error
- func (b *BitbucketCloudProvider) BranchArchiveURL(org string, name string, branch string) string
- func (b *BitbucketCloudProvider) CreateIssue(owner string, repo string, issue *GitIssue) (*GitIssue, error)
- func (b *BitbucketCloudProvider) CreateIssueComment(owner string, repo string, number int, comment string) error
- func (b *BitbucketCloudProvider) CreatePullRequest(data *GitPullRequestArguments) (*GitPullRequest, error)
- func (b *BitbucketCloudProvider) CreateRepository(org string, name string, private bool) (*GitRepository, error)
- func (b *BitbucketCloudProvider) CreateWebHook(data *GitWebHookArguments) error
- func (b *BitbucketCloudProvider) CurrentUsername() string
- func (b *BitbucketCloudProvider) DeleteRepository(org string, name string) error
- func (b *BitbucketCloudProvider) ForkRepository(originalOrg string, name string, destinationOrg string) (*GitRepository, error)
- func (b *BitbucketCloudProvider) GetContent(org string, name string, path string, ref string) (*GitFileContent, error)
- func (b *BitbucketCloudProvider) GetIssue(org string, name string, number int) (*GitIssue, error)
- func (b *BitbucketCloudProvider) GetPullRequest(owner string, repoInfo *GitRepository, number int) (*GitPullRequest, error)
- func (b *BitbucketCloudProvider) GetPullRequestCommits(owner string, repository *GitRepository, number int) ([]*GitCommit, error)
- func (b *BitbucketCloudProvider) GetRepository(org string, name string) (*GitRepository, error)
- func (b *BitbucketCloudProvider) GitIssueToBitbucketIssue(gIssue GitIssue) bitbucket.Issue
- func (b *BitbucketCloudProvider) HasIssues() bool
- func (b *BitbucketCloudProvider) IsBitbucketCloud() bool
- func (b *BitbucketCloudProvider) IsBitbucketServer() bool
- func (b *BitbucketCloudProvider) IsGerrit() bool
- func (b *BitbucketCloudProvider) IsGitHub() bool
- func (b *BitbucketCloudProvider) IsGitea() bool
- func (b *BitbucketCloudProvider) IssueURL(org string, name string, number int, isPull bool) string
- func (b *BitbucketCloudProvider) JenkinsWebHookPath(gitURL string, secret string) string
- func (b *BitbucketCloudProvider) Kind() string
- func (b *BitbucketCloudProvider) Label() string
- func (b *BitbucketCloudProvider) ListCommitStatus(org string, repo string, sha string) ([]*GitRepoStatus, error)
- func (b *BitbucketCloudProvider) ListInvitations() ([]*github.RepositoryInvitation, *github.Response, error)
- func (b *BitbucketCloudProvider) ListOpenPullRequests(owner string, repo string) ([]*GitPullRequest, error)
- func (b *BitbucketCloudProvider) ListOrganisations() ([]GitOrganisation, error)
- func (b *BitbucketCloudProvider) ListReleases(org string, name string) ([]*GitRelease, error)
- func (b *BitbucketCloudProvider) ListRepositories(org string) ([]*GitRepository, error)
- func (b *BitbucketCloudProvider) ListWebHooks(owner string, repo string) ([]*GitWebHookArguments, error)
- func (b *BitbucketCloudProvider) MergePullRequest(pr *GitPullRequest, message string) error
- func (b *BitbucketCloudProvider) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)
- func (b *BitbucketCloudProvider) RenameRepository(org string, name string, newName string) (*GitRepository, error)
- func (b *BitbucketCloudProvider) SearchIssues(org string, name string, query string) ([]*GitIssue, error)
- func (b *BitbucketCloudProvider) SearchIssuesClosedSince(org string, name string, t time.Time) ([]*GitIssue, error)
- func (b *BitbucketCloudProvider) ServerURL() string
- func (b *BitbucketCloudProvider) ShouldForkForPullRequest(originalOwner string, repoName string, username string) bool
- func (b *BitbucketCloudProvider) UpdateCommitStatus(org string, repo string, sha string, status *GitRepoStatus) (*GitRepoStatus, error)
- func (b *BitbucketCloudProvider) UpdatePullRequestStatus(pr *GitPullRequest) error
- func (b *BitbucketCloudProvider) UpdateRelease(owner string, repo string, tag string, releaseInfo *GitRelease) error
- func (b *BitbucketCloudProvider) UpdateWebHook(data *GitWebHookArguments) error
- func (b *BitbucketCloudProvider) UserAuth() auth.UserAuth
- func (b *BitbucketCloudProvider) UserInfo(username string) *GitUser
- func (b *BitbucketCloudProvider) ValidateRepositoryName(org string, name string) error
- type BitbucketServerProvider
- func (b *BitbucketServerProvider) AcceptInvitation(ID int64) (*github.Response, error)
- func (b *BitbucketServerProvider) AddCollaborator(user string, organisation string, repo string) error
- func (b *BitbucketServerProvider) AddPRComment(pr *GitPullRequest, comment string) error
- func (b *BitbucketServerProvider) BranchArchiveURL(org string, name string, branch string) string
- func (b *BitbucketServerProvider) CreateIssue(owner string, repo string, issue *GitIssue) (*GitIssue, error)
- func (b *BitbucketServerProvider) CreateIssueComment(owner string, repo string, number int, comment string) error
- func (b *BitbucketServerProvider) CreatePullRequest(data *GitPullRequestArguments) (*GitPullRequest, error)
- func (b *BitbucketServerProvider) CreateRepository(org, name string, private bool) (*GitRepository, error)
- func (b *BitbucketServerProvider) CreateWebHook(data *GitWebHookArguments) error
- func (b *BitbucketServerProvider) CurrentUsername() string
- func (b *BitbucketServerProvider) DeleteRepository(org, name string) error
- func (b *BitbucketServerProvider) ForkRepository(originalOrg, name, destinationOrg string) (*GitRepository, error)
- func (b *BitbucketServerProvider) GetContent(org string, name string, path string, ref string) (*GitFileContent, error)
- func (b *BitbucketServerProvider) GetIssue(org string, name string, number int) (*GitIssue, error)
- func (b *BitbucketServerProvider) GetPullRequest(owner string, repo *GitRepository, number int) (*GitPullRequest, error)
- func (b *BitbucketServerProvider) GetPullRequestCommits(owner string, repository *GitRepository, number int) ([]*GitCommit, error)
- func (b *BitbucketServerProvider) GetRepository(org string, name string) (*GitRepository, error)
- func (b *BitbucketServerProvider) HasIssues() bool
- func (b *BitbucketServerProvider) IsBitbucketCloud() bool
- func (b *BitbucketServerProvider) IsBitbucketServer() bool
- func (b *BitbucketServerProvider) IsGerrit() bool
- func (b *BitbucketServerProvider) IsGitHub() bool
- func (b *BitbucketServerProvider) IsGitea() bool
- func (b *BitbucketServerProvider) IssueURL(org string, name string, number int, isPull bool) string
- func (b *BitbucketServerProvider) JenkinsWebHookPath(gitURL string, secret string) string
- func (b *BitbucketServerProvider) Kind() string
- func (b *BitbucketServerProvider) Label() string
- func (b *BitbucketServerProvider) ListCommitStatus(org, repo, sha string) ([]*GitRepoStatus, error)
- func (b *BitbucketServerProvider) ListInvitations() ([]*github.RepositoryInvitation, *github.Response, error)
- func (b *BitbucketServerProvider) ListOpenPullRequests(owner string, repo string) ([]*GitPullRequest, error)
- func (b *BitbucketServerProvider) ListOrganisations() ([]GitOrganisation, error)
- func (b *BitbucketServerProvider) ListReleases(org string, name string) ([]*GitRelease, error)
- func (b *BitbucketServerProvider) ListRepositories(org string) ([]*GitRepository, error)
- func (b *BitbucketServerProvider) ListWebHooks(owner string, repo string) ([]*GitWebHookArguments, error)
- func (b *BitbucketServerProvider) MergePullRequest(pr *GitPullRequest, message string) error
- func (b *BitbucketServerProvider) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)
- func (b *BitbucketServerProvider) RenameRepository(org, name, newName string) (*GitRepository, error)
- func (b *BitbucketServerProvider) SearchIssues(org string, name string, query string) ([]*GitIssue, error)
- func (b *BitbucketServerProvider) SearchIssuesClosedSince(org string, name string, t time.Time) ([]*GitIssue, error)
- func (b *BitbucketServerProvider) ServerURL() string
- func (b *BitbucketServerProvider) ShouldForkForPullRequest(originalOwner string, repoName string, username string) bool
- func (b *BitbucketServerProvider) UpdateCommitStatus(org string, repo string, sha string, status *GitRepoStatus) (*GitRepoStatus, error)
- func (b *BitbucketServerProvider) UpdatePullRequestStatus(pr *GitPullRequest) error
- func (b *BitbucketServerProvider) UpdateRelease(owner string, repo string, tag string, releaseInfo *GitRelease) error
- func (b *BitbucketServerProvider) UpdateWebHook(data *GitWebHookArguments) error
- func (b *BitbucketServerProvider) UserAuth() auth.UserAuth
- func (b *BitbucketServerProvider) UserInfo(username string) *GitUser
- func (b *BitbucketServerProvider) ValidateRepositoryName(org, name string) error
- type CommitGroup
- type CommitInfo
- type CommitStatus
- type CreateRepoData
- type FakeCommit
- type FakeIssue
- type FakeProvider
- func (f *FakeProvider) AcceptInvitation(ID int64) (*github.Response, error)
- func (f *FakeProvider) AddCollaborator(user string, organisation string, repo string) error
- func (f *FakeProvider) AddPRComment(pr *GitPullRequest, comment string) error
- func (f *FakeProvider) BranchArchiveURL(org string, name string, branch string) string
- func (f *FakeProvider) CreateIssue(owner string, repoName string, issue *GitIssue) (*GitIssue, error)
- func (f *FakeProvider) CreateIssueComment(owner string, repoName string, number int, comment string) error
- func (f *FakeProvider) CreatePullRequest(data *GitPullRequestArguments) (*GitPullRequest, error)
- func (f *FakeProvider) CreateRepository(org string, name string, private bool) (*GitRepository, error)
- func (f *FakeProvider) CreateWebHook(data *GitWebHookArguments) error
- func (f *FakeProvider) CurrentUsername() string
- func (f *FakeProvider) DeleteRepository(org string, name string) error
- func (f *FakeProvider) ForkRepository(originalOrg string, name string, destinationOrg string) (*GitRepository, error)
- func (f *FakeProvider) GetContent(org string, name string, path string, ref string) (*GitFileContent, error)
- func (f *FakeProvider) GetIssue(org string, name string, number int) (*GitIssue, error)
- func (f *FakeProvider) GetPullRequest(owner string, repo *GitRepository, number int) (*GitPullRequest, error)
- func (f *FakeProvider) GetPullRequestCommits(owner string, repo *GitRepository, number int) ([]*GitCommit, error)
- func (f *FakeProvider) GetRepository(org string, name string) (*GitRepository, error)
- func (f *FakeProvider) HasIssues() bool
- func (f *FakeProvider) IsBitbucketCloud() bool
- func (f *FakeProvider) IsBitbucketServer() bool
- func (f *FakeProvider) IsGerrit() bool
- func (f *FakeProvider) IsGitHub() bool
- func (f *FakeProvider) IsGitea() bool
- func (f *FakeProvider) IssueURL(org string, name string, number int, isPull bool) string
- func (f *FakeProvider) JenkinsWebHookPath(gitURL string, secret string) string
- func (f *FakeProvider) Kind() string
- func (f *FakeProvider) Label() string
- func (f *FakeProvider) ListCommitStatus(org string, repoName string, sha string) ([]*GitRepoStatus, error)
- func (f *FakeProvider) ListInvitations() ([]*github.RepositoryInvitation, *github.Response, error)
- func (f *FakeProvider) ListOpenPullRequests(owner string, repo string) ([]*GitPullRequest, error)
- func (f *FakeProvider) ListOrganisations() ([]GitOrganisation, error)
- func (f *FakeProvider) ListReleases(org string, name string) ([]*GitRelease, error)
- func (f *FakeProvider) ListRepositories(org string) ([]*GitRepository, error)
- func (p *FakeProvider) ListWebHooks(owner string, repo string) ([]*GitWebHookArguments, error)
- func (f *FakeProvider) MergePullRequest(pr *GitPullRequest, message string) error
- func (f *FakeProvider) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)
- func (f *FakeProvider) RenameRepository(org string, name string, newName string) (*GitRepository, error)
- func (f *FakeProvider) SearchIssues(org string, name string, query string) ([]*GitIssue, error)
- func (f *FakeProvider) SearchIssuesClosedSince(org string, name string, t time.Time) ([]*GitIssue, error)
- func (f *FakeProvider) ServerURL() string
- func (r *FakeProvider) ShouldForkForPullRequest(originalOwner string, repoName string, username string) bool
- func (f *FakeProvider) UpdateCommitStatus(org string, repo string, sha string, status *GitRepoStatus) (*GitRepoStatus, error)
- func (f *FakeProvider) UpdatePullRequestStatus(pr *GitPullRequest) error
- func (f *FakeProvider) UpdateRelease(owner string, repoName string, tag string, releaseInfo *GitRelease) error
- func (p *FakeProvider) UpdateWebHook(data *GitWebHookArguments) error
- func (f *FakeProvider) UserAuth() auth.UserAuth
- func (f *FakeProvider) UserInfo(username string) *GitUser
- func (f *FakeProvider) ValidateRepositoryName(org string, name string) error
- type FakeProviderType
- type FakePullRequest
- type FakeRepository
- type GerritProvider
- func (p *GerritProvider) AcceptInvitation(ID int64) (*github.Response, error)
- func (p *GerritProvider) AddCollaborator(user string, organisation string, repo string) error
- func (p *GerritProvider) AddPRComment(pr *GitPullRequest, comment string) error
- func (p *GerritProvider) BranchArchiveURL(org string, name string, branch string) string
- func (p *GerritProvider) CreateIssue(owner string, repo string, issue *GitIssue) (*GitIssue, error)
- func (p *GerritProvider) CreateIssueComment(owner string, repo string, number int, comment string) error
- func (p *GerritProvider) CreatePullRequest(data *GitPullRequestArguments) (*GitPullRequest, error)
- func (p *GerritProvider) CreateRepository(org string, name string, private bool) (*GitRepository, error)
- func (p *GerritProvider) CreateWebHook(data *GitWebHookArguments) error
- func (p *GerritProvider) CurrentUsername() string
- func (p *GerritProvider) DeleteRepository(org string, name string) error
- func (p *GerritProvider) ForkRepository(originalOrg string, name string, destinationOrg string) (*GitRepository, error)
- func (p *GerritProvider) GetContent(org string, name string, path string, ref string) (*GitFileContent, error)
- func (p *GerritProvider) GetIssue(org string, name string, number int) (*GitIssue, error)
- func (p *GerritProvider) GetPullRequest(owner string, repo *GitRepository, number int) (*GitPullRequest, error)
- func (p *GerritProvider) GetPullRequestCommits(owner string, repo *GitRepository, number int) ([]*GitCommit, error)
- func (p *GerritProvider) GetRepository(org string, name string) (*GitRepository, error)
- func (p *GerritProvider) HasIssues() bool
- func (p *GerritProvider) IsBitbucketCloud() bool
- func (p *GerritProvider) IsBitbucketServer() bool
- func (p *GerritProvider) IsGerrit() bool
- func (p *GerritProvider) IsGitHub() bool
- func (p *GerritProvider) IsGitea() bool
- func (p *GerritProvider) IssueURL(org string, name string, number int, isPull bool) string
- func (p *GerritProvider) JenkinsWebHookPath(gitURL string, secret string) string
- func (p *GerritProvider) Kind() string
- func (p *GerritProvider) Label() string
- func (p *GerritProvider) ListCommitStatus(org string, repo string, sha string) ([]*GitRepoStatus, error)
- func (p *GerritProvider) ListInvitations() ([]*github.RepositoryInvitation, *github.Response, error)
- func (p *GerritProvider) ListOpenPullRequests(owner string, repo string) ([]*GitPullRequest, error)
- func (p *GerritProvider) ListOrganisations() ([]GitOrganisation, error)
- func (p *GerritProvider) ListReleases(org string, name string) ([]*GitRelease, error)
- func (p *GerritProvider) ListRepositories(org string) ([]*GitRepository, error)
- func (p *GerritProvider) ListWebHooks(org, repo string) ([]*GitWebHookArguments, error)
- func (p *GerritProvider) MergePullRequest(pr *GitPullRequest, message string) error
- func (p *GerritProvider) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)
- func (p *GerritProvider) RenameRepository(org string, name string, newName string) (*GitRepository, error)
- func (p *GerritProvider) SearchIssues(org string, name string, query string) ([]*GitIssue, error)
- func (p *GerritProvider) SearchIssuesClosedSince(org string, name string, t time.Time) ([]*GitIssue, error)
- func (p *GerritProvider) ServerURL() string
- func (p *GerritProvider) ShouldForkForPullRequest(originalOwner string, repoName string, username string) bool
- func (p *GerritProvider) UpdateCommitStatus(org, repo, sha string, status *GitRepoStatus) (*GitRepoStatus, error)
- func (p *GerritProvider) UpdatePullRequestStatus(pr *GitPullRequest) error
- func (p *GerritProvider) UpdateRelease(owner string, repo string, tag string, releaseInfo *GitRelease) error
- func (p *GerritProvider) UpdateWebHook(data *GitWebHookArguments) error
- func (p *GerritProvider) UserAuth() auth.UserAuth
- func (p *GerritProvider) UserInfo(username string) *GitUser
- func (p *GerritProvider) ValidateRepositoryName(org string, name string) error
- type GitCLI
- func (g *GitCLI) Add(dir string, args ...string) error
- func (g *GitCLI) AddCommit(dir string, msg string) error
- func (g *GitCLI) AddRemote(dir string, name string, url string) error
- func (g *GitCLI) Branch(dir string) (string, error)
- func (g *GitCLI) Checkout(dir string, branch string) error
- func (g *GitCLI) CheckoutOrphan(dir string, branch string) error
- func (g *GitCLI) CheckoutRemoteBranch(dir string, branch string) error
- func (g *GitCLI) CleanForce(dir, fileName string) error
- func (g *GitCLI) Clone(url string, dir string) error
- func (g *GitCLI) CloneOrPull(url string, dir string) error
- func (g *GitCLI) CommitDir(dir string, message string) error
- func (g *GitCLI) CommitIfChanges(dir string, message string) error
- func (g *GitCLI) ConvertToValidBranchName(name string) string
- func (g *GitCLI) CreateBranch(dir string, branch string) error
- func (g *GitCLI) CreateBranchFrom(dir string, branchName string, startPoint string) error
- func (g *GitCLI) CreatePushURL(cloneURL string, userAuth *auth.UserAuth) (string, error)
- func (g *GitCLI) CreateTag(dir string, tag string, msg string) error
- func (g *GitCLI) DeleteRemoteBranch(dir string, remoteName string, branch string) error
- func (g *GitCLI) Diff(dir string) (string, error)
- func (g *GitCLI) DiscoverRemoteGitURL(gitConf string) (string, error)
- func (g *GitCLI) DiscoverUpstreamGitURL(gitConf string) (string, error)
- func (g *GitCLI) Email(dir string) (string, error)
- func (g *GitCLI) FetchBranch(dir string, repo string, refspecs ...string) error
- func (g *GitCLI) FetchBranchUnshallow(dir string, repo string, refspecs ...string) error
- func (g *GitCLI) FetchTags(dir string) error
- func (g *GitCLI) FetchUnshallow(dir string) error
- func (g *GitCLI) FindGitConfigDir(dir string) (string, string, error)
- func (g *GitCLI) ForcePushBranch(dir string, localBranch string, remoteBranch string) error
- func (g *GitCLI) GetAuthorEmailForCommit(dir string, sha string) (string, error)
- func (g *GitCLI) GetCurrentGitTagSHA(dir string) (string, error)
- func (g *GitCLI) GetLatestCommitMessage(dir string) (string, error)
- func (g *GitCLI) GetLatestCommitSha(dir string) (string, error)
- func (g *GitCLI) GetPreviousGitTagSHA(dir string) (string, error)
- func (g *GitCLI) GetRemoteUrl(config *gitcfg.Config, name string) string
- func (g *GitCLI) GetRevisionBeforeDate(dir string, t time.Time) (string, error)
- func (g *GitCLI) GetRevisionBeforeDateText(dir string, dateText string) (string, error)
- func (g *GitCLI) HasChanges(dir string) (bool, error)
- func (g *GitCLI) Info(dir string) (*GitRepository, error)
- func (g *GitCLI) Init(dir string) error
- func (g *GitCLI) IsFork(dir string) (bool, error)
- func (g *GitCLI) IsShallow(dir string) (bool, error)
- func (g *GitCLI) ListChangedFilesFromBranch(dir string, branch string) (string, error)
- func (g *GitCLI) LoadFileFromBranch(dir string, branch string, file string) (string, error)
- func (g *GitCLI) Merge(dir string, commitish string) error
- func (g *GitCLI) PrintCreateRepositoryGenerateAccessToken(server *auth.AuthServer, username string, o io.Writer)
- func (g *GitCLI) Pull(dir string) error
- func (g *GitCLI) PullRemoteBranches(dir string) error
- func (g *GitCLI) PullUpstream(dir string) error
- func (g *GitCLI) Push(dir string) error
- func (g *GitCLI) PushMaster(dir string) error
- func (g *GitCLI) PushTag(dir string, tag string) error
- func (g *GitCLI) RemoteBranchNames(dir string, prefix string) ([]string, error)
- func (g *GitCLI) RemoteBranches(dir string) ([]string, error)
- func (g *GitCLI) RemoteUpdate(dir string) error
- func (g *GitCLI) Remove(dir, fileName string) error
- func (g *GitCLI) RemoveForce(dir, fileName string) error
- func (g *GitCLI) RepoName(org, repoName string) string
- func (g *GitCLI) ResetHard(dir string, commitish string) error
- func (g *GitCLI) ResetToUpstream(dir string, branch string) error
- func (g *GitCLI) Server(dir string) (string, error)
- func (g *GitCLI) SetEmail(dir string, email string) error
- func (g *GitCLI) SetRemoteURL(dir string, name string, gitURL string) error
- func (g *GitCLI) SetUsername(dir string, username string) error
- func (g *GitCLI) ShallowCloneBranch(url string, branch string, dir string) error
- func (g *GitCLI) Stash(dir string) error
- func (g *GitCLI) Status(dir string) error
- func (g *GitCLI) Tags(dir string) ([]string, error)
- func (g *GitCLI) UpdateRemote(dir, url string) error
- func (g *GitCLI) Username(dir string) (string, error)
- func (g *GitCLI) Version() (string, error)
- func (g *GitCLI) WriteOperation(dir string, args ...string) error
- type GitCommit
- type GitFake
- func (g *GitFake) Add(dir string, args ...string) error
- func (g *GitFake) AddCommit(dir string, msg string) error
- func (g *GitFake) AddRemote(dir string, name string, url string) error
- func (g *GitFake) Branch(dir string) (string, error)
- func (g *GitFake) Checkout(dir string, branch string) error
- func (g *GitFake) CheckoutOrphan(dir string, branch string) error
- func (g *GitFake) CheckoutRemoteBranch(dir string, branch string) error
- func (g *GitFake) CleanForce(dir string, fileName string) error
- func (g *GitFake) Clone(url string, directory string) error
- func (g *GitFake) CloneOrPull(url string, directory string) error
- func (g *GitFake) CommitDir(dir string, message string) error
- func (g *GitFake) CommitIfChanges(dir string, message string) error
- func (g *GitFake) ConvertToValidBranchName(name string) string
- func (g *GitFake) CreateBranch(dir string, branch string) error
- func (g *GitFake) CreateBranchFrom(dir string, branchName string, startPoint string) error
- func (g *GitFake) CreatePushURL(cloneURL string, userAuth *auth.UserAuth) (string, error)
- func (g *GitFake) CreateTag(dir string, tag string, msg string) error
- func (g *GitFake) DeleteRemoteBranch(dir string, remoteName string, branch string) error
- func (g *GitFake) Diff(dir string) (string, error)
- func (g *GitFake) DiscoverRemoteGitURL(gitConf string) (string, error)
- func (g *GitFake) DiscoverUpstreamGitURL(gitConf string) (string, error)
- func (g *GitFake) Email(dir string) (string, error)
- func (g *GitFake) FetchBranch(dir string, repo string, refspec ...string) error
- func (g *GitFake) FetchBranchUnshallow(dir string, repo string, refspec ...string) error
- func (g *GitFake) FetchTags(dir string) error
- func (g *GitFake) FetchUnshallow(dir string) error
- func (g *GitFake) FindGitConfigDir(dir string) (string, string, error)
- func (g *GitFake) ForcePushBranch(dir string, localBranch string, remoteBranch string) error
- func (g *GitFake) GetAuthorEmailForCommit(dir string, sha string) (string, error)
- func (g *GitFake) GetCurrentGitTagSHA(dir string) (string, error)
- func (g *GitFake) GetLatestCommitMessage(dir string) (string, error)
- func (g *GitFake) GetLatestCommitSha(dir string) (string, error)
- func (g *GitFake) GetPreviousGitTagSHA(dir string) (string, error)
- func (g *GitFake) GetRemoteUrl(config *gitcfg.Config, name string) string
- func (g *GitFake) GetRevisionBeforeDate(dir string, t time.Time) (string, error)
- func (g *GitFake) GetRevisionBeforeDateText(dir string, dateText string) (string, error)
- func (g *GitFake) HasChanges(dir string) (bool, error)
- func (g *GitFake) Info(dir string) (*GitRepository, error)
- func (g *GitFake) Init(dir string) error
- func (g *GitFake) IsFork(dir string) (bool, error)
- func (g *GitFake) IsShallow(dir string) (bool, error)
- func (g *GitFake) ListChangedFilesFromBranch(dir string, branch string) (string, error)
- func (g *GitFake) LoadFileFromBranch(dir string, branch string, file string) (string, error)
- func (g *GitFake) Merge(dir string, commitish string) error
- func (g *GitFake) PrintCreateRepositoryGenerateAccessToken(server *auth.AuthServer, username string, o io.Writer)
- func (g *GitFake) Pull(dir string) error
- func (g *GitFake) PullRemoteBranches(dir string) error
- func (g *GitFake) PullUpstream(dir string) error
- func (g *GitFake) Push(dir string) error
- func (g *GitFake) PushMaster(dir string) error
- func (g *GitFake) PushTag(dir string, tag string) error
- func (g *GitFake) RemoteBranchNames(dir string, prefix string) ([]string, error)
- func (g *GitFake) RemoteBranches(dir string) ([]string, error)
- func (g *GitFake) RemoteUpdate(dir string) error
- func (g *GitFake) Remove(dir string, fileName string) error
- func (g *GitFake) RemoveForce(dir string, fileName string) error
- func (g *GitFake) RepoName(org string, repoName string) string
- func (g *GitFake) ResetHard(dir string, commitish string) error
- func (g *GitFake) ResetToUpstream(dir string, branch string) error
- func (g *GitFake) Server(dir string) (string, error)
- func (g *GitFake) SetEmail(dir string, email string) error
- func (g *GitFake) SetRemoteURL(dir string, name string, gitURL string) error
- func (g *GitFake) SetUsername(dir string, username string) error
- func (g *GitFake) ShallowCloneBranch(url string, branch string, directory string) error
- func (g *GitFake) Stash(dir string) error
- func (g *GitFake) Status(dir string) error
- func (g *GitFake) Tags(dir string) ([]string, error)
- func (g *GitFake) UpdateRemote(dir string, url string) error
- func (g *GitFake) Username(dir string) (string, error)
- func (g *GitFake) Version() (string, error)
- type GitFileContent
- type GitHubProvider
- func (p *GitHubProvider) AcceptInvitation(ID int64) (*github.Response, error)
- func (p *GitHubProvider) AddCollaborator(user string, organisation string, repo string) error
- func (p *GitHubProvider) AddPRComment(pr *GitPullRequest, comment string) error
- func (p *GitHubProvider) BranchArchiveURL(org string, name string, branch string) string
- func (p *GitHubProvider) CreateIssue(owner string, repo string, issue *GitIssue) (*GitIssue, error)
- func (p *GitHubProvider) CreateIssueComment(owner string, repo string, number int, comment string) error
- func (p *GitHubProvider) CreatePullRequest(data *GitPullRequestArguments) (*GitPullRequest, error)
- func (p *GitHubProvider) CreateRepository(org string, name string, private bool) (*GitRepository, error)
- func (p *GitHubProvider) CreateWebHook(data *GitWebHookArguments) error
- func (p *GitHubProvider) CurrentUsername() string
- func (p *GitHubProvider) DeleteRepository(org string, name string) error
- func (p *GitHubProvider) ForkRepository(originalOrg string, name string, destinationOrg string) (*GitRepository, error)
- func (p *GitHubProvider) GetContent(org string, name string, path string, ref string) (*GitFileContent, error)
- func (p *GitHubProvider) GetEnterpriseApiURL() string
- func (p *GitHubProvider) GetIssue(org string, name string, number int) (*GitIssue, error)
- func (p *GitHubProvider) GetPullRequest(owner string, repo *GitRepository, number int) (*GitPullRequest, error)
- func (p *GitHubProvider) GetPullRequestCommits(owner string, repository *GitRepository, number int) ([]*GitCommit, error)
- func (p *GitHubProvider) GetRepository(org string, name string) (*GitRepository, error)
- func (p *GitHubProvider) HasIssues() bool
- func (p *GitHubProvider) IsBitbucketCloud() bool
- func (p *GitHubProvider) IsBitbucketServer() bool
- func (p *GitHubProvider) IsGerrit() bool
- func (p *GitHubProvider) IsGitHub() bool
- func (p *GitHubProvider) IsGitea() bool
- func (p *GitHubProvider) IsUserInOrganisation(user string, org string) (bool, error)
- func (p *GitHubProvider) IssueURL(org string, name string, number int, isPull bool) string
- func (p *GitHubProvider) JenkinsWebHookPath(gitURL string, secret string) string
- func (p *GitHubProvider) Kind() string
- func (p *GitHubProvider) Label() string
- func (p *GitHubProvider) ListCommitStatus(org string, repo string, sha string) ([]*GitRepoStatus, error)
- func (p *GitHubProvider) ListInvitations() ([]*github.RepositoryInvitation, *github.Response, error)
- func (p *GitHubProvider) ListOpenPullRequests(owner string, repo string) ([]*GitPullRequest, error)
- func (p *GitHubProvider) ListOrganisations() ([]GitOrganisation, error)
- func (p *GitHubProvider) ListReleases(org string, name string) ([]*GitRelease, error)
- func (p *GitHubProvider) ListRepositories(org string) ([]*GitRepository, error)
- func (p *GitHubProvider) ListWebHooks(owner string, repo string) ([]*GitWebHookArguments, error)
- func (p *GitHubProvider) MergePullRequest(pr *GitPullRequest, message string) error
- func (p *GitHubProvider) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)
- func (p *GitHubProvider) RenameRepository(org string, name string, newName string) (*GitRepository, error)
- func (p *GitHubProvider) SearchIssues(org string, name string, filter string) ([]*GitIssue, error)
- func (p *GitHubProvider) SearchIssuesClosedSince(org string, name string, t time.Time) ([]*GitIssue, error)
- func (p *GitHubProvider) ServerURL() string
- func (p *GitHubProvider) ShouldForkForPullRequest(originalOwner string, repoName string, username string) bool
- func (p *GitHubProvider) UpdateCommitStatus(org string, repo string, sha string, status *GitRepoStatus) (*GitRepoStatus, error)
- func (p *GitHubProvider) UpdatePullRequestStatus(pr *GitPullRequest) error
- func (p *GitHubProvider) UpdateRelease(owner string, repo string, tag string, releaseInfo *GitRelease) error
- func (p *GitHubProvider) UpdateWebHook(data *GitWebHookArguments) error
- func (p *GitHubProvider) UserAuth() auth.UserAuth
- func (p *GitHubProvider) UserInfo(username string) *GitUser
- func (p *GitHubProvider) ValidateRepositoryName(org string, name string) error
- type GitIssue
- type GitLabel
- type GitLocal
- func (g *GitLocal) Add(dir string, args ...string) error
- func (g *GitLocal) AddCommit(dir string, msg string) error
- func (g *GitLocal) AddRemote(dir string, name string, url string) error
- func (g *GitLocal) Branch(dir string) (string, error)
- func (g *GitLocal) Checkout(dir string, branch string) error
- func (g *GitLocal) CheckoutOrphan(dir string, branch string) error
- func (g *GitLocal) CheckoutRemoteBranch(dir string, branch string) error
- func (g *GitLocal) CleanForce(dir, fileName string) error
- func (g *GitLocal) Clone(url string, dir string) error
- func (g *GitLocal) CloneOrPull(url string, dir string) error
- func (g *GitLocal) CommitDir(dir string, message string) error
- func (g *GitLocal) CommitIfChanges(dir string, message string) error
- func (g *GitLocal) ConvertToValidBranchName(name string) string
- func (g *GitLocal) CreateBranch(dir string, branch string) error
- func (g *GitLocal) CreateBranchFrom(dir string, branchName string, startPoint string) error
- func (g *GitLocal) CreatePushURL(cloneURL string, userAuth *auth.UserAuth) (string, error)
- func (g *GitLocal) CreateTag(dir string, tag string, msg string) error
- func (g *GitLocal) DeleteRemoteBranch(dir string, remoteName string, branch string) error
- func (g *GitLocal) Diff(dir string) (string, error)
- func (g *GitLocal) DiscoverRemoteGitURL(gitConf string) (string, error)
- func (g *GitLocal) DiscoverUpstreamGitURL(gitConf string) (string, error)
- func (g *GitLocal) Email(dir string) (string, error)
- func (g *GitLocal) FetchBranch(dir string, repo string, refspec ...string) error
- func (g *GitLocal) FetchBranchUnshallow(dir string, repo string, refspec ...string) error
- func (g *GitLocal) FetchTags(dir string) error
- func (g *GitLocal) FetchUnshallow(dir string) error
- func (g *GitLocal) FindGitConfigDir(dir string) (string, string, error)
- func (g *GitLocal) ForcePushBranch(dir string, localBranch string, remoteBranch string) error
- func (g *GitLocal) GetAuthorEmailForCommit(dir string, sha string) (string, error)
- func (g *GitLocal) GetCurrentGitTagSHA(dir string) (string, error)
- func (g *GitLocal) GetLatestCommitMessage(dir string) (string, error)
- func (g *GitLocal) GetLatestCommitSha(dir string) (string, error)
- func (g *GitLocal) GetPreviousGitTagSHA(dir string) (string, error)
- func (g *GitLocal) GetRemoteUrl(config *gitcfg.Config, name string) string
- func (g *GitLocal) GetRevisionBeforeDate(dir string, t time.Time) (string, error)
- func (g *GitLocal) GetRevisionBeforeDateText(dir string, dateText string) (string, error)
- func (g *GitLocal) HasChanges(dir string) (bool, error)
- func (g *GitLocal) Info(dir string) (*GitRepository, error)
- func (g *GitLocal) Init(dir string) error
- func (g *GitLocal) IsFork(dir string) (bool, error)
- func (g *GitLocal) IsShallow(dir string) (bool, error)
- func (g *GitLocal) ListChangedFilesFromBranch(dir string, branch string) (string, error)
- func (g *GitLocal) LoadFileFromBranch(dir string, branch string, file string) (string, error)
- func (g *GitLocal) Merge(dir string, commitish string) error
- func (g *GitLocal) PrintCreateRepositoryGenerateAccessToken(server *auth.AuthServer, username string, o io.Writer)
- func (g *GitLocal) Pull(dir string) error
- func (g *GitLocal) PullRemoteBranches(dir string) error
- func (g *GitLocal) PullUpstream(dir string) error
- func (g *GitLocal) Push(dir string) error
- func (g *GitLocal) PushMaster(dir string) error
- func (g *GitLocal) PushTag(dir string, tag string) error
- func (g *GitLocal) RemoteBranchNames(dir string, prefix string) ([]string, error)
- func (g *GitLocal) RemoteBranches(dir string) ([]string, error)
- func (g *GitLocal) RemoteUpdate(dir string) error
- func (g *GitLocal) Remove(dir, fileName string) error
- func (g *GitLocal) RemoveForce(dir, fileName string) error
- func (g *GitLocal) RepoName(org, repoName string) string
- func (g *GitLocal) ResetHard(dir string, commitish string) error
- func (g *GitLocal) ResetToUpstream(dir string, branch string) error
- func (g *GitLocal) Server(dir string) (string, error)
- func (g *GitLocal) SetEmail(dir string, email string) error
- func (g *GitLocal) SetRemoteURL(dir string, name string, gitURL string) error
- func (g *GitLocal) SetUsername(dir string, username string) error
- func (g *GitLocal) ShallowCloneBranch(url string, branch string, dir string) error
- func (g *GitLocal) Stash(dir string) error
- func (g *GitLocal) Status(dir string) error
- func (g *GitLocal) Tags(dir string) ([]string, error)
- func (g *GitLocal) UpdateRemote(dir, url string) error
- func (g *GitLocal) Username(dir string) (string, error)
- func (g *GitLocal) Version() (string, error)
- type GitOrganisation
- type GitProvider
- func CreateProvider(server *auth.AuthServer, user *auth.UserAuth, git Gitter) (GitProvider, error)
- func CreateProviderForURL(inCluster bool, authConfigSvc auth.ConfigService, gitKind string, ...) (GitProvider, error)
- func NewBitbucketCloudProvider(server *auth.AuthServer, user *auth.UserAuth, git Gitter) (GitProvider, error)
- func NewBitbucketServerProvider(server *auth.AuthServer, user *auth.UserAuth, git Gitter) (GitProvider, error)
- func NewGerritProvider(server *auth.AuthServer, user *auth.UserAuth, git Gitter) (GitProvider, error)
- func NewGitHubProvider(server *auth.AuthServer, user *auth.UserAuth, git Gitter) (GitProvider, error)
- func NewGiteaProvider(server *auth.AuthServer, user *auth.UserAuth, git Gitter) (GitProvider, error)
- func NewGitlabProvider(server *auth.AuthServer, user *auth.UserAuth, git Gitter) (GitProvider, error)
- func WithGitlabClient(server *auth.AuthServer, user *auth.UserAuth, client *gitlab.Client, ...) (GitProvider, error)
- type GitPullRequest
- type GitPullRequestArguments
- type GitRelease
- type GitReleaseAsset
- type GitRemote
- type GitRepoStatus
- type GitRepository
- func BitbucketRepositoryToGitRepository(bRepo bitbucket.Repository) *GitRepository
- func BitbucketServerRepositoryToGitRepository(bRepo bitbucket.Repository) *GitRepository
- func ParseGitURL(text string) (*GitRepository, error)
- func PickRepositories(provider GitProvider, owner string, message string, selectAll bool, ...) ([]*GitRepository, error)
- func (i *GitRepository) CreateProvider(inCluster bool, authConfigSvc auth.ConfigService, gitKind string, git Gitter, ...) (GitProvider, error)
- func (i *GitRepository) CreateProviderForUser(server *auth.AuthServer, user *auth.UserAuth, gitKind string, git Gitter) (GitProvider, error)
- func (i *GitRepository) HostURL() string
- func (i *GitRepository) HostURLWithoutUser() string
- func (i *GitRepository) HttpCloneURL() string
- func (i *GitRepository) HttpURL() string
- func (i *GitRepository) HttpsURL() string
- func (i *GitRepository) IsGitHub() bool
- func (i *GitRepository) PickOrCreateProvider(authConfigSvc auth.ConfigService, message string, batchMode bool, ...) (GitProvider, error)
- func (i *GitRepository) PipelinePath() string
- func (i *GitRepository) PullRequestURL(prName string) string
- type GitRepositoryOptions
- type GitTag
- type GitUser
- type GitWebHookArguments
- type GiteaProvider
- func (p *GiteaProvider) AcceptInvitation(ID int64) (*github.Response, error)
- func (p *GiteaProvider) AddCollaborator(user string, organisation string, repo string) error
- func (p *GiteaProvider) AddPRComment(pr *GitPullRequest, comment string) error
- func (p *GiteaProvider) BranchArchiveURL(org string, name string, branch string) string
- func (p *GiteaProvider) CreateIssue(owner string, repo string, issue *GitIssue) (*GitIssue, error)
- func (p *GiteaProvider) CreateIssueComment(owner string, repo string, number int, comment string) error
- func (p *GiteaProvider) CreatePullRequest(data *GitPullRequestArguments) (*GitPullRequest, error)
- func (p *GiteaProvider) CreateRepository(org string, name string, private bool) (*GitRepository, error)
- func (p *GiteaProvider) CreateWebHook(data *GitWebHookArguments) error
- func (p *GiteaProvider) CurrentUsername() string
- func (p *GiteaProvider) DeleteRepository(org string, name string) error
- func (p *GiteaProvider) ForkRepository(originalOrg string, name string, destinationOrg string) (*GitRepository, error)
- func (p *GiteaProvider) GetContent(org string, name string, path string, ref string) (*GitFileContent, error)
- func (p *GiteaProvider) GetIssue(org string, name string, number int) (*GitIssue, error)
- func (p *GiteaProvider) GetPullRequest(owner string, repo *GitRepository, number int) (*GitPullRequest, error)
- func (p *GiteaProvider) GetPullRequestCommits(owner string, repository *GitRepository, number int) ([]*GitCommit, error)
- func (p *GiteaProvider) GetRepository(org string, name string) (*GitRepository, error)
- func (p *GiteaProvider) HasIssues() bool
- func (p *GiteaProvider) IsBitbucketCloud() bool
- func (p *GiteaProvider) IsBitbucketServer() bool
- func (p *GiteaProvider) IsGerrit() bool
- func (p *GiteaProvider) IsGitHub() bool
- func (p *GiteaProvider) IsGitea() bool
- func (p *GiteaProvider) IssueURL(org string, name string, number int, isPull bool) string
- func (p *GiteaProvider) JenkinsWebHookPath(gitURL string, secret string) string
- func (p *GiteaProvider) Kind() string
- func (p *GiteaProvider) Label() string
- func (p *GiteaProvider) ListCommitStatus(org string, repo string, sha string) ([]*GitRepoStatus, error)
- func (p *GiteaProvider) ListInvitations() ([]*github.RepositoryInvitation, *github.Response, error)
- func (p *GiteaProvider) ListOpenPullRequests(owner string, repo string) ([]*GitPullRequest, error)
- func (p *GiteaProvider) ListOrganisations() ([]GitOrganisation, error)
- func (p *GiteaProvider) ListReleases(org string, name string) ([]*GitRelease, error)
- func (p *GiteaProvider) ListRepositories(org string) ([]*GitRepository, error)
- func (p *GiteaProvider) ListWebHooks(owner string, repo string) ([]*GitWebHookArguments, error)
- func (p *GiteaProvider) MergePullRequest(pr *GitPullRequest, message string) error
- func (p *GiteaProvider) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)
- func (p *GiteaProvider) RenameRepository(org string, name string, newName string) (*GitRepository, error)
- func (p *GiteaProvider) SearchIssues(org string, name string, filter string) ([]*GitIssue, error)
- func (p *GiteaProvider) SearchIssuesClosedSince(org string, name string, t time.Time) ([]*GitIssue, error)
- func (p *GiteaProvider) ServerURL() string
- func (p *GiteaProvider) ShouldForkForPullRequest(originalOwner string, repoName string, username string) bool
- func (b *GiteaProvider) UpdateCommitStatus(org string, repo string, sha string, status *GitRepoStatus) (*GitRepoStatus, error)
- func (p *GiteaProvider) UpdatePullRequestStatus(pr *GitPullRequest) error
- func (p *GiteaProvider) UpdateRelease(owner string, repo string, tag string, releaseInfo *GitRelease) error
- func (p *GiteaProvider) UpdateWebHook(data *GitWebHookArguments) error
- func (p *GiteaProvider) UserAuth() auth.UserAuth
- func (p *GiteaProvider) UserInfo(username string) *GitUser
- func (p *GiteaProvider) ValidateRepositoryName(org string, name string) error
- type GitlabProvider
- func (g *GitlabProvider) AcceptInvitation(ID int64) (*github.Response, error)
- func (g *GitlabProvider) AddCollaborator(user string, organisation string, repo string) error
- func (g *GitlabProvider) AddPRComment(pr *GitPullRequest, comment string) error
- func (g *GitlabProvider) BranchArchiveURL(org string, name string, branch string) string
- func (g *GitlabProvider) CreateIssue(owner string, repo string, issue *GitIssue) (*GitIssue, error)
- func (g *GitlabProvider) CreateIssueComment(owner string, repo string, number int, comment string) error
- func (g *GitlabProvider) CreatePullRequest(data *GitPullRequestArguments) (*GitPullRequest, error)
- func (g *GitlabProvider) CreateRepository(org string, name string, private bool) (*GitRepository, error)
- func (g *GitlabProvider) CreateWebHook(data *GitWebHookArguments) error
- func (g *GitlabProvider) CurrentUsername() string
- func (g *GitlabProvider) DeleteRepository(org, name string) error
- func (g *GitlabProvider) ForkRepository(originalOrg, name, destinationOrg string) (*GitRepository, error)
- func (g *GitlabProvider) GetContent(org string, name string, path string, ref string) (*GitFileContent, error)
- func (g *GitlabProvider) GetIssue(org, repo string, number int) (*GitIssue, error)
- func (g *GitlabProvider) GetPullRequest(owner string, repo *GitRepository, number int) (*GitPullRequest, error)
- func (g *GitlabProvider) GetPullRequestCommits(owner string, repository *GitRepository, number int) ([]*GitCommit, error)
- func (g *GitlabProvider) GetRepository(org, name string) (*GitRepository, error)
- func (g *GitlabProvider) HasIssues() bool
- func (g *GitlabProvider) IsBitbucketCloud() bool
- func (g *GitlabProvider) IsBitbucketServer() bool
- func (g *GitlabProvider) IsGerrit() bool
- func (g *GitlabProvider) IsGitHub() bool
- func (g *GitlabProvider) IsGitea() bool
- func (g *GitlabProvider) IssueURL(org string, name string, number int, isPull bool) string
- func (g *GitlabProvider) JenkinsWebHookPath(gitURL string, secret string) string
- func (g *GitlabProvider) Kind() string
- func (g *GitlabProvider) Label() string
- func (g *GitlabProvider) ListCommitStatus(org string, repo string, sha string) ([]*GitRepoStatus, error)
- func (g *GitlabProvider) ListInvitations() ([]*github.RepositoryInvitation, *github.Response, error)
- func (g *GitlabProvider) ListOpenPullRequests(owner string, repo string) ([]*GitPullRequest, error)
- func (g *GitlabProvider) ListOrganisations() ([]GitOrganisation, error)
- func (g *GitlabProvider) ListReleases(org string, name string) ([]*GitRelease, error)
- func (g *GitlabProvider) ListRepositories(org string) ([]*GitRepository, error)
- func (g *GitlabProvider) ListWebHooks(owner string, repo string) ([]*GitWebHookArguments, error)
- func (g *GitlabProvider) MergePullRequest(pr *GitPullRequest, message string) error
- func (g *GitlabProvider) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)
- func (g *GitlabProvider) RenameRepository(org, name, newName string) (*GitRepository, error)
- func (g *GitlabProvider) SearchIssues(org, repo, query string) ([]*GitIssue, error)
- func (g *GitlabProvider) SearchIssuesClosedSince(org string, repo string, t time.Time) ([]*GitIssue, error)
- func (g *GitlabProvider) ServerURL() string
- func (g *GitlabProvider) ShouldForkForPullRequest(originalOwner string, repoName string, username string) bool
- func (g *GitlabProvider) UpdateCommitStatus(org string, repo string, sha string, status *GitRepoStatus) (*GitRepoStatus, error)
- func (g *GitlabProvider) UpdatePullRequestStatus(pr *GitPullRequest) error
- func (g *GitlabProvider) UpdateRelease(owner string, repo string, tag string, releaseInfo *GitRelease) error
- func (g *GitlabProvider) UpdateWebHook(data *GitWebHookArguments) error
- func (g *GitlabProvider) UserAuth() auth.UserAuth
- func (g *GitlabProvider) UserInfo(username string) *GitUser
- func (g *GitlabProvider) ValidateRepositoryName(org, name string) error
- type Gitter
- type GroupAndCommitInfos
- type Label
- type OrganisationChecker
- type OrganisationLister
- type PullRequestInfo
Constants ¶
const ( // KindBitBucketCloud git kind for BitBucket Cloud KindBitBucketCloud = "bitbucketcloud" // KindBitBucketServer git kind for BitBucket Server KindBitBucketServer = "bitbucketserver" // KindGitea git kind for gitea KindGitea = "gitea" // KindGitlab git kind for gitlab KindGitlab = "gitlab" // KindGitHub git kind for github KindGitHub = "github" // KindGitFake git kind for fake git KindGitFake = "fakegit" // KindUnknown git kind for unknown git KindUnknown = "unknown" // BitbucketCloudURL the default URL for BitBucket Cloud BitbucketCloudURL = "https://bitbucket.org" // FakeGitURL the default URL for the fake git provider FakeGitURL = "https://fake.git" )
const ( GitHubHost = "github.com" GitHubURL = "https://github.com" )
const ( CommitStatusPending CommitStatus = "pending" CommitSatusSuccess = "success" CommitStatusError = "error" CommitStatusFailure = "failure" )
Variables ¶
var ( // ConventionalCommitTitles textual descriptions for // Conventional Commit types: https://conventionalcommits.org/ ConventionalCommitTitles = map[string]*CommitGroup{ "feat": createCommitGroup("New Features"), "fix": createCommitGroup("Bug Fixes"), "perf": createCommitGroup("Performance Improvements"), "refactor": createCommitGroup("Code Refactoring"), "docs": createCommitGroup("Documentation"), "test": createCommitGroup("Tests"), "revert": createCommitGroup("Reverts"), "style": createCommitGroup("Styles"), "chore": createCommitGroup("Chores"), "": createCommitGroup(""), } )
var (
KindGits = []string{KindBitBucketCloud, KindBitBucketServer, KindGitea, KindGitHub, KindGitlab}
)
Functions ¶
func EnsureUserAndEmailSetup ¶
EnsureUserAndEmailSetup returns the user name and email for the gitter lazily setting them if they are blank either from the environment variables `GIT_AUTHOR_NAME` and `GIT_AUTHOR_EMAIL` or using default values
func FetchAndMergeSHAs ¶ added in v1.3.886
func FetchAndMergeSHAs(SHAs []string, baseBranch string, baseSha string, remote string, dir string, gitter Gitter, verbose bool) error
FetchAndMergeSHAs merges any SHAs into the baseBranch which has a tip of baseSha, fetching the commits from remote for the git repo in dir. It will try to fetch individual commits ( if the remote repo supports it - see https://github. com/git/git/commit/68ee628932c2196742b77d2961c5e16360734a62) otherwise it uses git remote update to pull down the whole repo.
func GenerateMarkdown ¶
func GenerateMarkdown(releaseSpec *v1.ReleaseSpec, gitInfo *GitRepository) (string, error)
GenerateMarkdown generates the markdown document for the commits
func GetHost ¶
func GetHost(gitProvider GitProvider) (string, error)
GetHost returns the Git Provider hostname, e.g github.com
func GetOrganizations ¶
func GetOrganizations(orgLister OrganisationLister, userName string) []string
GetOrganizations gets the organisation
func GetOwner ¶
func GetOwner(batchMode bool, provider GitProvider, gitUsername string, in terminal.FileReader, out terminal.FileWriter, errOut io.Writer) (string, error)
func GetRepoName ¶
func GetRepoName(batchMode, allowExistingRepo bool, provider GitProvider, defaultRepoName, owner string, in terminal.FileReader, out terminal.FileWriter, errOut io.Writer) (string, error)
func GitHubAccessTokenURL ¶
func GiteaAccessTokenURL ¶
func GitlabAccessTokenURL ¶
GitlabAccessTokenURL returns the URL to click on to generate a personal access token for the Git provider
func IsGitHubServerURL ¶
func IsGitLabServerURL ¶
func IsGitRepoStatusFailed ¶
func IsGitRepoStatusFailed(statuses ...*GitRepoStatus) bool
IsGitRepoStatusFailed returns true if any of the statuses have failed
func IsGitRepoStatusSuccess ¶
func IsGitRepoStatusSuccess(statuses ...*GitRepoStatus) bool
IsGitRepoStatusSuccess returns true if all the statuses are successful
func PickOrganisation ¶
func PickOrganisation(orgLister OrganisationLister, userName string, in terminal.FileReader, out terminal.FileWriter, errOut io.Writer) (string, error)
PickOrganisation picks an organisations login if there is one available
func ProviderAccessTokenURL ¶
func ReleaseDownloadCount ¶
func ReleaseDownloadCount(releases []*GitRelease) int
ReleaseDownloadCount returns the total number of downloads for the given set of releases
func SaasGitKind ¶
SaasGitKind returns the kind for SaaS Git providers or "" if the URL could not be deduced
Types ¶
type BitbucketCloudProvider ¶
type BitbucketCloudProvider struct { Client *bitbucket.APIClient Username string Context context.Context Server auth.AuthServer User auth.UserAuth Git Gitter }
BitbucketCloudProvider implements GitProvider interface for bitbucket.org
func (*BitbucketCloudProvider) AcceptInvitation ¶
func (b *BitbucketCloudProvider) AcceptInvitation(ID int64) (*github.Response, error)
func (*BitbucketCloudProvider) AddCollaborator ¶
func (b *BitbucketCloudProvider) AddCollaborator(user string, organisation string, repo string) error
func (*BitbucketCloudProvider) AddPRComment ¶
func (b *BitbucketCloudProvider) AddPRComment(pr *GitPullRequest, comment string) error
func (*BitbucketCloudProvider) BranchArchiveURL ¶
func (b *BitbucketCloudProvider) BranchArchiveURL(org string, name string, branch string) string
func (*BitbucketCloudProvider) CreateIssue ¶
func (*BitbucketCloudProvider) CreateIssueComment ¶
func (*BitbucketCloudProvider) CreatePullRequest ¶
func (b *BitbucketCloudProvider) CreatePullRequest( data *GitPullRequestArguments, ) (*GitPullRequest, error)
func (*BitbucketCloudProvider) CreateRepository ¶
func (b *BitbucketCloudProvider) CreateRepository( org string, name string, private bool, ) (*GitRepository, error)
func (*BitbucketCloudProvider) CreateWebHook ¶
func (b *BitbucketCloudProvider) CreateWebHook(data *GitWebHookArguments) error
func (*BitbucketCloudProvider) CurrentUsername ¶
func (b *BitbucketCloudProvider) CurrentUsername() string
CurrentUsername the current user name
func (*BitbucketCloudProvider) DeleteRepository ¶
func (b *BitbucketCloudProvider) DeleteRepository(org string, name string) error
func (*BitbucketCloudProvider) ForkRepository ¶
func (b *BitbucketCloudProvider) ForkRepository( originalOrg string, name string, destinationOrg string, ) (*GitRepository, error)
func (*BitbucketCloudProvider) GetContent ¶
func (b *BitbucketCloudProvider) GetContent(org string, name string, path string, ref string) (*GitFileContent, error)
func (*BitbucketCloudProvider) GetPullRequest ¶
func (b *BitbucketCloudProvider) GetPullRequest(owner string, repoInfo *GitRepository, number int) (*GitPullRequest, error)
GetPullRequest returns the PR
func (*BitbucketCloudProvider) GetPullRequestCommits ¶
func (b *BitbucketCloudProvider) GetPullRequestCommits(owner string, repository *GitRepository, number int) ([]*GitCommit, error)
func (*BitbucketCloudProvider) GetRepository ¶
func (b *BitbucketCloudProvider) GetRepository( org string, name string, ) (*GitRepository, error)
func (*BitbucketCloudProvider) GitIssueToBitbucketIssue ¶
func (b *BitbucketCloudProvider) GitIssueToBitbucketIssue(gIssue GitIssue) bitbucket.Issue
func (*BitbucketCloudProvider) HasIssues ¶
func (b *BitbucketCloudProvider) HasIssues() bool
func (*BitbucketCloudProvider) IsBitbucketCloud ¶
func (b *BitbucketCloudProvider) IsBitbucketCloud() bool
func (*BitbucketCloudProvider) IsBitbucketServer ¶
func (b *BitbucketCloudProvider) IsBitbucketServer() bool
func (*BitbucketCloudProvider) IsGerrit ¶
func (b *BitbucketCloudProvider) IsGerrit() bool
func (*BitbucketCloudProvider) IsGitHub ¶
func (b *BitbucketCloudProvider) IsGitHub() bool
func (*BitbucketCloudProvider) IsGitea ¶
func (b *BitbucketCloudProvider) IsGitea() bool
func (*BitbucketCloudProvider) JenkinsWebHookPath ¶
func (b *BitbucketCloudProvider) JenkinsWebHookPath(gitURL string, secret string) string
Exposed by Jenkins plugin; this one is for https://wiki.jenkins.io/display/JENKINS/BitBucket+Plugin
func (*BitbucketCloudProvider) Kind ¶
func (b *BitbucketCloudProvider) Kind() string
func (*BitbucketCloudProvider) Label ¶
func (b *BitbucketCloudProvider) Label() string
func (*BitbucketCloudProvider) ListCommitStatus ¶
func (b *BitbucketCloudProvider) ListCommitStatus(org string, repo string, sha string) ([]*GitRepoStatus, error)
func (*BitbucketCloudProvider) ListInvitations ¶
func (b *BitbucketCloudProvider) ListInvitations() ([]*github.RepositoryInvitation, *github.Response, error)
func (*BitbucketCloudProvider) ListOpenPullRequests ¶ added in v1.3.893
func (b *BitbucketCloudProvider) ListOpenPullRequests(owner string, repo string) ([]*GitPullRequest, error)
ListOpenPullRequests lists the open pull requests
func (*BitbucketCloudProvider) ListOrganisations ¶
func (b *BitbucketCloudProvider) ListOrganisations() ([]GitOrganisation, error)
func (*BitbucketCloudProvider) ListReleases ¶
func (b *BitbucketCloudProvider) ListReleases(org string, name string) ([]*GitRelease, error)
ListReleases lists the releases
func (*BitbucketCloudProvider) ListRepositories ¶
func (b *BitbucketCloudProvider) ListRepositories(org string) ([]*GitRepository, error)
func (*BitbucketCloudProvider) ListWebHooks ¶
func (b *BitbucketCloudProvider) ListWebHooks(owner string, repo string) ([]*GitWebHookArguments, error)
ListWebHooks lists the webhooks
func (*BitbucketCloudProvider) MergePullRequest ¶
func (b *BitbucketCloudProvider) MergePullRequest(pr *GitPullRequest, message string) error
func (*BitbucketCloudProvider) PullRequestLastCommitStatus ¶
func (b *BitbucketCloudProvider) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)
func (*BitbucketCloudProvider) RenameRepository ¶
func (b *BitbucketCloudProvider) RenameRepository( org string, name string, newName string, ) (*GitRepository, error)
func (*BitbucketCloudProvider) SearchIssues ¶
func (*BitbucketCloudProvider) SearchIssuesClosedSince ¶
func (*BitbucketCloudProvider) ServerURL ¶
func (b *BitbucketCloudProvider) ServerURL() string
func (*BitbucketCloudProvider) ShouldForkForPullRequest ¶ added in v1.3.962
func (b *BitbucketCloudProvider) ShouldForkForPullRequest(originalOwner string, repoName string, username string) bool
ShouldForkForPullReques treturns true if we should create a personal fork of this repository before creating a pull request
func (*BitbucketCloudProvider) UpdateCommitStatus ¶
func (b *BitbucketCloudProvider) UpdateCommitStatus(org string, repo string, sha string, status *GitRepoStatus) (*GitRepoStatus, error)
func (*BitbucketCloudProvider) UpdatePullRequestStatus ¶
func (b *BitbucketCloudProvider) UpdatePullRequestStatus(pr *GitPullRequest) error
func (*BitbucketCloudProvider) UpdateRelease ¶
func (b *BitbucketCloudProvider) UpdateRelease(owner string, repo string, tag string, releaseInfo *GitRelease) error
func (*BitbucketCloudProvider) UpdateWebHook ¶
func (b *BitbucketCloudProvider) UpdateWebHook(data *GitWebHookArguments) error
UpdateWebHook updates the webhook
func (*BitbucketCloudProvider) UserAuth ¶
func (b *BitbucketCloudProvider) UserAuth() auth.UserAuth
UserAuth returns the user auth
func (*BitbucketCloudProvider) UserInfo ¶
func (b *BitbucketCloudProvider) UserInfo(username string) *GitUser
UserInfo returns the user info
func (*BitbucketCloudProvider) ValidateRepositoryName ¶
func (b *BitbucketCloudProvider) ValidateRepositoryName(org string, name string) error
type BitbucketServerProvider ¶
type BitbucketServerProvider struct { Client *bitbucket.APIClient Username string Context context.Context Server auth.AuthServer User auth.UserAuth Git Gitter }
BitbucketServerProvider implements GitProvider interface for a bitbucket server
func (*BitbucketServerProvider) AcceptInvitation ¶
func (b *BitbucketServerProvider) AcceptInvitation(ID int64) (*github.Response, error)
func (*BitbucketServerProvider) AddCollaborator ¶
func (b *BitbucketServerProvider) AddCollaborator(user string, organisation string, repo string) error
func (*BitbucketServerProvider) AddPRComment ¶
func (b *BitbucketServerProvider) AddPRComment(pr *GitPullRequest, comment string) error
func (*BitbucketServerProvider) BranchArchiveURL ¶
func (b *BitbucketServerProvider) BranchArchiveURL(org string, name string, branch string) string
func (*BitbucketServerProvider) CreateIssue ¶
func (*BitbucketServerProvider) CreateIssueComment ¶
func (*BitbucketServerProvider) CreatePullRequest ¶
func (b *BitbucketServerProvider) CreatePullRequest(data *GitPullRequestArguments) (*GitPullRequest, error)
func (*BitbucketServerProvider) CreateRepository ¶
func (b *BitbucketServerProvider) CreateRepository(org, name string, private bool) (*GitRepository, error)
func (*BitbucketServerProvider) CreateWebHook ¶
func (b *BitbucketServerProvider) CreateWebHook(data *GitWebHookArguments) error
CreateWebHook adds a new webhook to a git repository
func (*BitbucketServerProvider) CurrentUsername ¶
func (b *BitbucketServerProvider) CurrentUsername() string
func (*BitbucketServerProvider) DeleteRepository ¶
func (b *BitbucketServerProvider) DeleteRepository(org, name string) error
func (*BitbucketServerProvider) ForkRepository ¶
func (b *BitbucketServerProvider) ForkRepository(originalOrg, name, destinationOrg string) (*GitRepository, error)
func (*BitbucketServerProvider) GetContent ¶
func (b *BitbucketServerProvider) GetContent(org string, name string, path string, ref string) (*GitFileContent, error)
func (*BitbucketServerProvider) GetPullRequest ¶
func (b *BitbucketServerProvider) GetPullRequest(owner string, repo *GitRepository, number int) (*GitPullRequest, error)
func (*BitbucketServerProvider) GetPullRequestCommits ¶
func (b *BitbucketServerProvider) GetPullRequestCommits(owner string, repository *GitRepository, number int) ([]*GitCommit, error)
func (*BitbucketServerProvider) GetRepository ¶
func (b *BitbucketServerProvider) GetRepository(org string, name string) (*GitRepository, error)
func (*BitbucketServerProvider) HasIssues ¶
func (b *BitbucketServerProvider) HasIssues() bool
func (*BitbucketServerProvider) IsBitbucketCloud ¶
func (b *BitbucketServerProvider) IsBitbucketCloud() bool
func (*BitbucketServerProvider) IsBitbucketServer ¶
func (b *BitbucketServerProvider) IsBitbucketServer() bool
func (*BitbucketServerProvider) IsGerrit ¶
func (b *BitbucketServerProvider) IsGerrit() bool
func (*BitbucketServerProvider) IsGitHub ¶
func (b *BitbucketServerProvider) IsGitHub() bool
func (*BitbucketServerProvider) IsGitea ¶
func (b *BitbucketServerProvider) IsGitea() bool
func (*BitbucketServerProvider) JenkinsWebHookPath ¶
func (b *BitbucketServerProvider) JenkinsWebHookPath(gitURL string, secret string) string
Exposed by Jenkins plugin; this one is for https://wiki.jenkins.io/display/JENKINS/BitBucket+Plugin
func (*BitbucketServerProvider) Kind ¶
func (b *BitbucketServerProvider) Kind() string
func (*BitbucketServerProvider) Label ¶
func (b *BitbucketServerProvider) Label() string
func (*BitbucketServerProvider) ListCommitStatus ¶
func (b *BitbucketServerProvider) ListCommitStatus(org, repo, sha string) ([]*GitRepoStatus, error)
func (*BitbucketServerProvider) ListInvitations ¶
func (b *BitbucketServerProvider) ListInvitations() ([]*github.RepositoryInvitation, *github.Response, error)
func (*BitbucketServerProvider) ListOpenPullRequests ¶ added in v1.3.893
func (b *BitbucketServerProvider) ListOpenPullRequests(owner string, repo string) ([]*GitPullRequest, error)
ListOpenPullRequests lists the open pull requests
func (*BitbucketServerProvider) ListOrganisations ¶
func (b *BitbucketServerProvider) ListOrganisations() ([]GitOrganisation, error)
func (*BitbucketServerProvider) ListReleases ¶
func (b *BitbucketServerProvider) ListReleases(org string, name string) ([]*GitRelease, error)
func (*BitbucketServerProvider) ListRepositories ¶
func (b *BitbucketServerProvider) ListRepositories(org string) ([]*GitRepository, error)
func (*BitbucketServerProvider) ListWebHooks ¶
func (b *BitbucketServerProvider) ListWebHooks(owner string, repo string) ([]*GitWebHookArguments, error)
ListWebHooks lists all of the webhooks on a given git repository
func (*BitbucketServerProvider) MergePullRequest ¶
func (b *BitbucketServerProvider) MergePullRequest(pr *GitPullRequest, message string) error
func (*BitbucketServerProvider) PullRequestLastCommitStatus ¶
func (b *BitbucketServerProvider) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)
func (*BitbucketServerProvider) RenameRepository ¶
func (b *BitbucketServerProvider) RenameRepository(org, name, newName string) (*GitRepository, error)
func (*BitbucketServerProvider) SearchIssues ¶
func (*BitbucketServerProvider) SearchIssuesClosedSince ¶
func (*BitbucketServerProvider) ServerURL ¶
func (b *BitbucketServerProvider) ServerURL() string
func (*BitbucketServerProvider) ShouldForkForPullRequest ¶ added in v1.3.962
func (b *BitbucketServerProvider) ShouldForkForPullRequest(originalOwner string, repoName string, username string) bool
ShouldForkForPullReques treturns true if we should create a personal fork of this repository before creating a pull request
func (*BitbucketServerProvider) UpdateCommitStatus ¶
func (b *BitbucketServerProvider) UpdateCommitStatus(org string, repo string, sha string, status *GitRepoStatus) (*GitRepoStatus, error)
func (*BitbucketServerProvider) UpdatePullRequestStatus ¶
func (b *BitbucketServerProvider) UpdatePullRequestStatus(pr *GitPullRequest) error
func (*BitbucketServerProvider) UpdateRelease ¶
func (b *BitbucketServerProvider) UpdateRelease(owner string, repo string, tag string, releaseInfo *GitRelease) error
func (*BitbucketServerProvider) UpdateWebHook ¶
func (b *BitbucketServerProvider) UpdateWebHook(data *GitWebHookArguments) error
UpdateWebHook is used to update a webhook on a git repository. It is best to pass in the webhook ID.
func (*BitbucketServerProvider) UserAuth ¶
func (b *BitbucketServerProvider) UserAuth() auth.UserAuth
func (*BitbucketServerProvider) UserInfo ¶
func (b *BitbucketServerProvider) UserInfo(username string) *GitUser
func (*BitbucketServerProvider) ValidateRepositoryName ¶
func (b *BitbucketServerProvider) ValidateRepositoryName(org, name string) error
type CommitGroup ¶
func ConventionalCommitTypeToTitle ¶
func ConventionalCommitTypeToTitle(kind string) *CommitGroup
ConventionalCommitTypeToTitle returns the title of the conventional commit type see: https://conventionalcommits.org/
type CommitInfo ¶
type CommitInfo struct { Kind string Feature string Message string // contains filtered or unexported fields }
func ParseCommit ¶
func ParseCommit(message string) *CommitInfo
ParseCommit parses a conventional commit see: https://conventionalcommits.org/
func (*CommitInfo) Group ¶
func (c *CommitInfo) Group() *CommitGroup
func (*CommitInfo) Order ¶
func (c *CommitInfo) Order() int
func (*CommitInfo) Title ¶
func (c *CommitInfo) Title() string
type CommitStatus ¶
type CommitStatus string
type CreateRepoData ¶
type CreateRepoData struct { Organisation string RepoName string FullName string PrivateRepo bool User *auth.UserAuth GitProvider GitProvider GitServer *auth.AuthServer }
func PickNewGitRepository ¶
func PickNewGitRepository(batchMode bool, authConfigSvc auth.ConfigService, defaultRepoName string, repoOptions *GitRepositoryOptions, server *auth.AuthServer, userAuth *auth.UserAuth, git Gitter, in terminal.FileReader, out terminal.FileWriter, outErr io.Writer) (*CreateRepoData, error)
func PickNewOrExistingGitRepository ¶
func PickNewOrExistingGitRepository(batchMode bool, authConfigSvc auth.ConfigService, defaultRepoName string, repoOptions *GitRepositoryOptions, server *auth.AuthServer, userAuth *auth.UserAuth, git Gitter, allowExistingRepo bool, in terminal.FileReader, out terminal.FileWriter, errOut io.Writer) (*CreateRepoData, error)
func (*CreateRepoData) CreateRepository ¶
func (d *CreateRepoData) CreateRepository() (*GitRepository, error)
CreateRepository creates the repository - failing if it already exists
func (*CreateRepoData) GetRepository ¶
func (d *CreateRepoData) GetRepository() (*GitRepository, error)
GetRepository returns the repository if it already exists
type FakeCommit ¶
type FakeCommit struct { Commit *GitCommit Status CommitStatus }
type FakeProvider ¶
type FakeProvider struct { Server auth.AuthServer User auth.UserAuth Organizations []GitOrganisation Repositories map[string][]*FakeRepository ForkedRepositories map[string][]*FakeRepository Type FakeProviderType Users []*GitUser WebHooks []*GitWebHookArguments }
func NewFakeProvider ¶
func NewFakeProvider(repositories ...*FakeRepository) *FakeProvider
NewFakeRepository creates a new fake repository
func (*FakeProvider) AcceptInvitation ¶
func (f *FakeProvider) AcceptInvitation(ID int64) (*github.Response, error)
func (*FakeProvider) AddCollaborator ¶
func (f *FakeProvider) AddCollaborator(user string, organisation string, repo string) error
func (*FakeProvider) AddPRComment ¶
func (f *FakeProvider) AddPRComment(pr *GitPullRequest, comment string) error
func (*FakeProvider) BranchArchiveURL ¶
func (f *FakeProvider) BranchArchiveURL(org string, name string, branch string) string
func (*FakeProvider) CreateIssue ¶
func (*FakeProvider) CreateIssueComment ¶
func (*FakeProvider) CreatePullRequest ¶
func (f *FakeProvider) CreatePullRequest(data *GitPullRequestArguments) (*GitPullRequest, error)
func (*FakeProvider) CreateRepository ¶
func (f *FakeProvider) CreateRepository(org string, name string, private bool) (*GitRepository, error)
func (*FakeProvider) CreateWebHook ¶
func (f *FakeProvider) CreateWebHook(data *GitWebHookArguments) error
func (*FakeProvider) CurrentUsername ¶
func (f *FakeProvider) CurrentUsername() string
func (*FakeProvider) DeleteRepository ¶
func (f *FakeProvider) DeleteRepository(org string, name string) error
func (*FakeProvider) ForkRepository ¶
func (f *FakeProvider) ForkRepository(originalOrg string, name string, destinationOrg string) (*GitRepository, error)
func (*FakeProvider) GetContent ¶
func (f *FakeProvider) GetContent(org string, name string, path string, ref string) (*GitFileContent, error)
GetContent gets the content
func (*FakeProvider) GetPullRequest ¶
func (f *FakeProvider) GetPullRequest(owner string, repo *GitRepository, number int) (*GitPullRequest, error)
func (*FakeProvider) GetPullRequestCommits ¶
func (f *FakeProvider) GetPullRequestCommits(owner string, repo *GitRepository, number int) ([]*GitCommit, error)
func (*FakeProvider) GetRepository ¶
func (f *FakeProvider) GetRepository(org string, name string) (*GitRepository, error)
func (*FakeProvider) HasIssues ¶
func (f *FakeProvider) HasIssues() bool
func (*FakeProvider) IsBitbucketCloud ¶
func (f *FakeProvider) IsBitbucketCloud() bool
func (*FakeProvider) IsBitbucketServer ¶
func (f *FakeProvider) IsBitbucketServer() bool
func (*FakeProvider) IsGerrit ¶
func (f *FakeProvider) IsGerrit() bool
func (*FakeProvider) IsGitHub ¶
func (f *FakeProvider) IsGitHub() bool
func (*FakeProvider) IsGitea ¶
func (f *FakeProvider) IsGitea() bool
func (*FakeProvider) JenkinsWebHookPath ¶
func (f *FakeProvider) JenkinsWebHookPath(gitURL string, secret string) string
func (*FakeProvider) Kind ¶
func (f *FakeProvider) Kind() string
func (*FakeProvider) Label ¶
func (f *FakeProvider) Label() string
func (*FakeProvider) ListCommitStatus ¶
func (f *FakeProvider) ListCommitStatus(org string, repoName string, sha string) ([]*GitRepoStatus, error)
func (*FakeProvider) ListInvitations ¶
func (f *FakeProvider) ListInvitations() ([]*github.RepositoryInvitation, *github.Response, error)
func (*FakeProvider) ListOpenPullRequests ¶ added in v1.3.893
func (f *FakeProvider) ListOpenPullRequests(owner string, repo string) ([]*GitPullRequest, error)
func (*FakeProvider) ListOrganisations ¶
func (f *FakeProvider) ListOrganisations() ([]GitOrganisation, error)
func (*FakeProvider) ListReleases ¶
func (f *FakeProvider) ListReleases(org string, name string) ([]*GitRelease, error)
func (*FakeProvider) ListRepositories ¶
func (f *FakeProvider) ListRepositories(org string) ([]*GitRepository, error)
func (*FakeProvider) ListWebHooks ¶
func (p *FakeProvider) ListWebHooks(owner string, repo string) ([]*GitWebHookArguments, error)
func (*FakeProvider) MergePullRequest ¶
func (f *FakeProvider) MergePullRequest(pr *GitPullRequest, message string) error
func (*FakeProvider) PullRequestLastCommitStatus ¶
func (f *FakeProvider) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)
func (*FakeProvider) RenameRepository ¶
func (f *FakeProvider) RenameRepository(org string, name string, newName string) (*GitRepository, error)
func (*FakeProvider) SearchIssues ¶
func (*FakeProvider) SearchIssuesClosedSince ¶
func (*FakeProvider) ServerURL ¶
func (f *FakeProvider) ServerURL() string
func (*FakeProvider) ShouldForkForPullRequest ¶ added in v1.3.962
func (r *FakeProvider) ShouldForkForPullRequest(originalOwner string, repoName string, username string) bool
ShouldForkForPullReques treturns true if we should create a personal fork of this repository before creating a pull request
func (*FakeProvider) UpdateCommitStatus ¶
func (f *FakeProvider) UpdateCommitStatus(org string, repo string, sha string, status *GitRepoStatus) (*GitRepoStatus, error)
func (*FakeProvider) UpdatePullRequestStatus ¶
func (f *FakeProvider) UpdatePullRequestStatus(pr *GitPullRequest) error
func (*FakeProvider) UpdateRelease ¶
func (f *FakeProvider) UpdateRelease(owner string, repoName string, tag string, releaseInfo *GitRelease) error
func (*FakeProvider) UpdateWebHook ¶
func (p *FakeProvider) UpdateWebHook(data *GitWebHookArguments) error
func (*FakeProvider) UserAuth ¶
func (f *FakeProvider) UserAuth() auth.UserAuth
func (*FakeProvider) UserInfo ¶
func (f *FakeProvider) UserInfo(username string) *GitUser
func (*FakeProvider) ValidateRepositoryName ¶
func (f *FakeProvider) ValidateRepositoryName(org string, name string) error
type FakeProviderType ¶
type FakeProviderType int
const ( GitHub FakeProviderType = iota Gitlab Gitea BitbucketCloud BitbucketServer Gerrit Fake )
type FakePullRequest ¶
type FakePullRequest struct { PullRequest *GitPullRequest Commits []*FakeCommit Comment string }
type FakeRepository ¶
type FakeRepository struct { Owner string GitRepo *GitRepository PullRequests map[int]*FakePullRequest Issues map[int]*FakeIssue Commits []*FakeCommit Releases map[string]*GitRelease PullRequestCounter int // contains filtered or unexported fields }
func NewFakeRepository ¶
func NewFakeRepository(owner string, repoName string) *FakeRepository
NewFakeRepository creates a new fake repository
func (*FakeRepository) Name ¶
func (r *FakeRepository) Name() string
func (*FakeRepository) String ¶
func (r *FakeRepository) String() string
type GerritProvider ¶
type GerritProvider struct { Client *gerrit.Client Username string Context context.Context Server auth.AuthServer User auth.UserAuth Git Gitter }
func (*GerritProvider) AcceptInvitation ¶
func (p *GerritProvider) AcceptInvitation(ID int64) (*github.Response, error)
func (*GerritProvider) AddCollaborator ¶
func (p *GerritProvider) AddCollaborator(user string, organisation string, repo string) error
func (*GerritProvider) AddPRComment ¶
func (p *GerritProvider) AddPRComment(pr *GitPullRequest, comment string) error
func (*GerritProvider) BranchArchiveURL ¶
func (p *GerritProvider) BranchArchiveURL(org string, name string, branch string) string
func (*GerritProvider) CreateIssue ¶
func (*GerritProvider) CreateIssueComment ¶
func (*GerritProvider) CreatePullRequest ¶
func (p *GerritProvider) CreatePullRequest(data *GitPullRequestArguments) (*GitPullRequest, error)
func (*GerritProvider) CreateRepository ¶
func (p *GerritProvider) CreateRepository(org string, name string, private bool) (*GitRepository, error)
func (*GerritProvider) CreateWebHook ¶
func (p *GerritProvider) CreateWebHook(data *GitWebHookArguments) error
func (*GerritProvider) CurrentUsername ¶
func (p *GerritProvider) CurrentUsername() string
func (*GerritProvider) DeleteRepository ¶
func (p *GerritProvider) DeleteRepository(org string, name string) error
func (*GerritProvider) ForkRepository ¶
func (p *GerritProvider) ForkRepository(originalOrg string, name string, destinationOrg string) (*GitRepository, error)
func (*GerritProvider) GetContent ¶
func (p *GerritProvider) GetContent(org string, name string, path string, ref string) (*GitFileContent, error)
func (*GerritProvider) GetPullRequest ¶
func (p *GerritProvider) GetPullRequest(owner string, repo *GitRepository, number int) (*GitPullRequest, error)
func (*GerritProvider) GetPullRequestCommits ¶
func (p *GerritProvider) GetPullRequestCommits(owner string, repo *GitRepository, number int) ([]*GitCommit, error)
func (*GerritProvider) GetRepository ¶
func (p *GerritProvider) GetRepository(org string, name string) (*GitRepository, error)
func (*GerritProvider) HasIssues ¶
func (p *GerritProvider) HasIssues() bool
func (*GerritProvider) IsBitbucketCloud ¶
func (p *GerritProvider) IsBitbucketCloud() bool
func (*GerritProvider) IsBitbucketServer ¶
func (p *GerritProvider) IsBitbucketServer() bool
func (*GerritProvider) IsGerrit ¶
func (p *GerritProvider) IsGerrit() bool
func (*GerritProvider) IsGitHub ¶
func (p *GerritProvider) IsGitHub() bool
func (*GerritProvider) IsGitea ¶
func (p *GerritProvider) IsGitea() bool
func (*GerritProvider) JenkinsWebHookPath ¶
func (p *GerritProvider) JenkinsWebHookPath(gitURL string, secret string) string
func (*GerritProvider) Kind ¶
func (p *GerritProvider) Kind() string
func (*GerritProvider) Label ¶
func (p *GerritProvider) Label() string
func (*GerritProvider) ListCommitStatus ¶
func (p *GerritProvider) ListCommitStatus(org string, repo string, sha string) ([]*GitRepoStatus, error)
func (*GerritProvider) ListInvitations ¶
func (p *GerritProvider) ListInvitations() ([]*github.RepositoryInvitation, *github.Response, error)
func (*GerritProvider) ListOpenPullRequests ¶ added in v1.3.893
func (p *GerritProvider) ListOpenPullRequests(owner string, repo string) ([]*GitPullRequest, error)
ListOpenPullRequests lists the open pull requests
func (*GerritProvider) ListOrganisations ¶
func (p *GerritProvider) ListOrganisations() ([]GitOrganisation, error)
ListOrganisations lists all organizations the configured user has access to.
func (*GerritProvider) ListReleases ¶
func (p *GerritProvider) ListReleases(org string, name string) ([]*GitRelease, error)
func (*GerritProvider) ListRepositories ¶
func (p *GerritProvider) ListRepositories(org string) ([]*GitRepository, error)
func (*GerritProvider) ListWebHooks ¶
func (p *GerritProvider) ListWebHooks(org, repo string) ([]*GitWebHookArguments, error)
ListWebHooks lists all webhooks for the specified repo.
func (*GerritProvider) MergePullRequest ¶
func (p *GerritProvider) MergePullRequest(pr *GitPullRequest, message string) error
func (*GerritProvider) PullRequestLastCommitStatus ¶
func (p *GerritProvider) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)
func (*GerritProvider) RenameRepository ¶
func (p *GerritProvider) RenameRepository(org string, name string, newName string) (*GitRepository, error)
func (*GerritProvider) SearchIssues ¶
func (*GerritProvider) SearchIssuesClosedSince ¶
func (*GerritProvider) ServerURL ¶
func (p *GerritProvider) ServerURL() string
func (*GerritProvider) ShouldForkForPullRequest ¶ added in v1.3.962
func (p *GerritProvider) ShouldForkForPullRequest(originalOwner string, repoName string, username string) bool
ShouldForkForPullReques treturns true if we should create a personal fork of this repository before creating a pull request
func (*GerritProvider) UpdateCommitStatus ¶
func (p *GerritProvider) UpdateCommitStatus(org, repo, sha string, status *GitRepoStatus) (*GitRepoStatus, error)
UpdateCommitStatus updates the status of a specified commit in a specified repo.
func (*GerritProvider) UpdatePullRequestStatus ¶
func (p *GerritProvider) UpdatePullRequestStatus(pr *GitPullRequest) error
func (*GerritProvider) UpdateRelease ¶
func (p *GerritProvider) UpdateRelease(owner string, repo string, tag string, releaseInfo *GitRelease) error
func (*GerritProvider) UpdateWebHook ¶
func (p *GerritProvider) UpdateWebHook(data *GitWebHookArguments) error
UpdateWebHook update a webhook with the data specified.
func (*GerritProvider) UserAuth ¶
func (p *GerritProvider) UserAuth() auth.UserAuth
func (*GerritProvider) UserInfo ¶
func (p *GerritProvider) UserInfo(username string) *GitUser
func (*GerritProvider) ValidateRepositoryName ¶
func (p *GerritProvider) ValidateRepositoryName(org string, name string) error
type GitCLI ¶
type GitCLI struct{}
GitCLI implements common git actions based on git CLI
func (*GitCLI) AddCommit ¶
AddCommit perform an add and commit of the changes from the repository at the given directory with the given messages
func (*GitCLI) AddRemote ¶
AddRemote adds a remote repository at the given URL and with the given name
func (*GitCLI) Branch ¶
Branch returns the current branch of the repository located at the given directory
func (*GitCLI) CheckoutOrphan ¶
Checkout checks out the given branch
func (*GitCLI) CheckoutRemoteBranch ¶
CheckoutRemoteBranch checks out the given remote tracking branch
func (*GitCLI) CleanForce ¶
Clean force cleans a git repository located at a given directory
func (*GitCLI) CloneOrPull ¶
CloneOrPull clones the given git URL or pull if it already exists
func (*GitCLI) CommitIfChanges ¶
CommiIfChanges does a commit if there are any changes in the repository at the given directory
func (*GitCLI) ConvertToValidBranchName ¶
ConvertToValidBranchName converts the given branch name into a valid git branch string replacing any dodgy characters
func (*GitCLI) CreateBranch ¶
CreateBranch creates a branch with the given name in the Git repository from the given directory
func (*GitCLI) CreateBranchFrom ¶ added in v1.3.818
CreateBranchFrom creates a new branch called branchName from startPoint
func (*GitCLI) CreatePushURL ¶
CreatePushURL creates the Git repository URL with the username and password encoded for HTTPS based URLs
func (*GitCLI) CreateTag ¶
CreateTag creates a tag with the given name and message in the repository at the given directory
func (*GitCLI) DeleteRemoteBranch ¶
DeleteRemoteBranch deletes the remote branch in the given given directory
func (*GitCLI) DiscoverRemoteGitURL ¶
DiscoverRemoteGitURL discovers the remote git URL from the given git configuration
func (*GitCLI) DiscoverUpstreamGitURL ¶
DiscoverUpstreamGitURL discovers the upstream git URL from the given git configuration
func (*GitCLI) FetchBranch ¶
FetchBranch fetches the refspecs from the repo
func (*GitCLI) FetchBranchUnshallow ¶ added in v1.3.931
FetchBranch fetches the refspecs from the repo
func (*GitCLI) FetchUnshallow ¶
FetchUnshallow runs git fetch --unshallow in dir
func (*GitCLI) FindGitConfigDir ¶
FindGitConfigDir tries to find the `.git` directory either in the current directory or in parent directories
func (*GitCLI) ForcePushBranch ¶
ForcePushBranch does a force push of the local branch into the remote branch of the repository at the given directory
func (*GitCLI) GetAuthorEmailForCommit ¶
GetAuthorEmailForCommit returns the author email from commit message with the given SHA
func (*GitCLI) GetCurrentGitTagSHA ¶
GetCurrentGitTagSHA return the SHA of the current git tag from the repository at the given directory
func (*GitCLI) GetLatestCommitMessage ¶
GetLatestCommitMessage returns the latest git commit message
func (*GitCLI) GetLatestCommitSha ¶ added in v1.3.886
GetLatestCommitSha returns the sha of the last commit
func (*GitCLI) GetPreviousGitTagSHA ¶
GetPreviousGitTagSHA returns the previous git tag from the repository at the given directory
func (*GitCLI) GetRemoteUrl ¶
GetRemoteUrl returns the remote URL from the given git config
func (*GitCLI) GetRevisionBeforeDate ¶
GetRevisionBeforeDate returns the revision before the given date
func (*GitCLI) GetRevisionBeforeDateText ¶
GetRevisionBeforeDateText returns the revision before the given date in format "MonthName dayNumber year"
func (*GitCLI) HasChanges ¶
HasChanges indicates if there are any changes in the repository from the given directory
func (*GitCLI) Info ¶
func (g *GitCLI) Info(dir string) (*GitRepository, error)
Info returns the git info of the repository at the given directory
func (*GitCLI) IsShallow ¶
IsShallow runs git rev-parse --is-shallow-repository in dir and returns the result
func (*GitCLI) ListChangedFilesFromBranch ¶ added in v1.3.912
ListChangedFilesFromBranch lists files changed between branches
func (*GitCLI) LoadFileFromBranch ¶ added in v1.3.912
LoadFileFromBranch returns a files's contents from a branch
func (*GitCLI) PrintCreateRepositoryGenerateAccessToken ¶
func (g *GitCLI) PrintCreateRepositoryGenerateAccessToken(server *auth.AuthServer, username string, o io.Writer)
PrintCreateRepositoryGenerateAccessToken prints the access token URL of a Git repository
func (*GitCLI) PullRemoteBranches ¶
PullRemoteBranches pulls the remote Git tags from the given given directory
func (*GitCLI) PullUpstream ¶
PullUpstream pulls the remote upstream branch into master branch into the given directory
func (*GitCLI) PushMaster ¶
PushMaster pushes the master branch into the origin
func (*GitCLI) RemoteBranchNames ¶
RemoteBranches returns all remote branches with the given prefix
func (*GitCLI) RemoteBranches ¶
RemoteBranches returns the remote branches
func (*GitCLI) RemoteUpdate ¶ added in v1.3.886
RemoteUpdate performs a git remote update
func (*GitCLI) Remove ¶
Remove removes the given file from a Git repository located at the given directory
func (*GitCLI) RemoveForce ¶
Remove force removes the given file from a git repository located at the given directory
func (*GitCLI) ResetHard ¶ added in v1.3.886
ResetHard performs a git reset --hard back to the commitish specified
func (*GitCLI) ResetToUpstream ¶ added in v1.3.1013
ResetToUpstream resets the given branch to the upstream version
func (*GitCLI) SetRemoteURL ¶
SetRemoteURL sets the remote URL of the remote with the given name
func (*GitCLI) SetUsername ¶
SetUsername sets the username in the git configuration
func (*GitCLI) ShallowCloneBranch ¶
Clone clones a single branch of the given git URL into the given directory
func (*GitCLI) UpdateRemote ¶
UpdateRemote updates the URL of the remote repository
type GitFake ¶
type GitFake struct { Remotes []GitRemote Branches []string BranchesRemote []string CurrentBranch string AccessTokenURL string RepoInfo GitRepository Fork bool GitVersion string GitUser GitUser Commits []GitCommit Changes bool GitTags []GitTag Revision string // contains filtered or unexported fields }
GitFake provides a fake Gitter
func (*GitFake) CheckoutOrphan ¶
CheckoutOrphan checkout the orphan
func (*GitFake) CheckoutRemoteBranch ¶
CheckoutRemoteBranch checkout remote branch
func (*GitFake) CleanForce ¶
CleanForce clean force
func (*GitFake) CloneOrPull ¶
CloneOrPull performs a clone or pull
func (*GitFake) CommitIfChanges ¶
CommitIfChanges git commit if there are changes
func (*GitFake) ConvertToValidBranchName ¶
ConvertToValidBranchName converts the name to a valid branch name
func (*GitFake) CreateBranch ¶
CreateBranch creates a branch
func (*GitFake) CreateBranchFrom ¶ added in v1.3.818
CreateBranchFrom creates a new branch called branchName from startPoint
func (*GitFake) CreatePushURL ¶
CreatePushURL creates a Push URL
func (*GitFake) DeleteRemoteBranch ¶
DeleteRemoteBranch deletes a remote branch
func (*GitFake) DiscoverRemoteGitURL ¶
DiscoverRemoteGitURL discover the remote git URL
func (*GitFake) DiscoverUpstreamGitURL ¶
DiscoverUpstreamGitURL discover the upstream git URL
func (*GitFake) FetchBranch ¶
FetchBranch fetch branch
func (*GitFake) FetchBranchUnshallow ¶ added in v1.3.931
FetchBranch fetch branch
func (*GitFake) FetchUnshallow ¶
FetchUnshallow deepens a shallow git clone
func (*GitFake) FindGitConfigDir ¶
FindGitConfigDir finds the git config dir
func (*GitFake) ForcePushBranch ¶
ForcePushBranch force push a branch
func (*GitFake) GetAuthorEmailForCommit ¶
GetAuthorEmailForCommit returns the author email for a commit
func (*GitFake) GetCurrentGitTagSHA ¶
GetCurrentGitTagSHA returns the current git tag sha
func (*GitFake) GetLatestCommitMessage ¶
GetLatestCommitMessage returns the last commit message
func (*GitFake) GetLatestCommitSha ¶ added in v1.3.886
GetLatestCommitSha returns the sha of the last commit
func (*GitFake) GetPreviousGitTagSHA ¶
GetPreviousGitTagSHA returns the previous git tag SHA
func (*GitFake) GetRemoteUrl ¶
GetRemoteUrl get the remote URL
func (*GitFake) GetRevisionBeforeDate ¶
GetRevisionBeforeDate get the revision before the date
func (*GitFake) GetRevisionBeforeDateText ¶
GetRevisionBeforeDateText get the revision before the date text
func (*GitFake) HasChanges ¶
HasChanges returns true if has changes in git
func (*GitFake) Info ¶
func (g *GitFake) Info(dir string) (*GitRepository, error)
Info returns the git repo info
func (*GitFake) ListChangedFilesFromBranch ¶ added in v1.3.912
ListChangedFilesFromBranch lists changes files between current checkout and a branch
func (*GitFake) LoadFileFromBranch ¶ added in v1.3.912
LoadFileFromBranch returns a files's contents from a branch
func (*GitFake) PrintCreateRepositoryGenerateAccessToken ¶
func (g *GitFake) PrintCreateRepositoryGenerateAccessToken(server *auth.AuthServer, username string, o io.Writer)
PrintCreateRepositoryGenerateAccessToken prints the generate access token URL
func (*GitFake) PullRemoteBranches ¶
PullRemoteBranches pull remote branches
func (*GitFake) PullUpstream ¶
PullUpstream pulls upstream
func (*GitFake) PushMaster ¶
PushMaster pushes to master
func (*GitFake) RemoteBranchNames ¶
RemoteBranchNames list the remote branch names
func (*GitFake) RemoteBranches ¶
RemoteBranches list the remote branches
func (*GitFake) RemoteUpdate ¶ added in v1.3.886
RemoteUpdate performs a git remote update
func (*GitFake) RemoveForce ¶
RemoveForce remove force
func (*GitFake) ResetHard ¶ added in v1.3.886
ResetHard performs a git reset --hard back to the commitish specified
func (*GitFake) ResetToUpstream ¶ added in v1.3.1013
ResetToUpstream resets the given branch to the upstream version
func (*GitFake) SetRemoteURL ¶
SetRemoteURL sets a remote URL
func (*GitFake) SetUsername ¶
SetUsername sets the username
func (*GitFake) ShallowCloneBranch ¶
ShallowCloneBranch shallow clone of a branch
func (*GitFake) UpdateRemote ¶
UpdateRemote updates a remote
type GitFileContent ¶
type GitHubProvider ¶
type GitHubProvider struct { Username string Client *github.Client Context context.Context Server auth.AuthServer User auth.UserAuth Git Gitter }
func (*GitHubProvider) AcceptInvitation ¶
func (p *GitHubProvider) AcceptInvitation(ID int64) (*github.Response, error)
func (*GitHubProvider) AddCollaborator ¶
func (p *GitHubProvider) AddCollaborator(user string, organisation string, repo string) error
func (*GitHubProvider) AddPRComment ¶
func (p *GitHubProvider) AddPRComment(pr *GitPullRequest, comment string) error
func (*GitHubProvider) BranchArchiveURL ¶
func (p *GitHubProvider) BranchArchiveURL(org string, name string, branch string) string
func (*GitHubProvider) CreateIssue ¶
func (*GitHubProvider) CreateIssueComment ¶
func (*GitHubProvider) CreatePullRequest ¶
func (p *GitHubProvider) CreatePullRequest(data *GitPullRequestArguments) (*GitPullRequest, error)
func (*GitHubProvider) CreateRepository ¶
func (p *GitHubProvider) CreateRepository(org string, name string, private bool) (*GitRepository, error)
func (*GitHubProvider) CreateWebHook ¶
func (p *GitHubProvider) CreateWebHook(data *GitWebHookArguments) error
func (*GitHubProvider) CurrentUsername ¶
func (p *GitHubProvider) CurrentUsername() string
func (*GitHubProvider) DeleteRepository ¶
func (p *GitHubProvider) DeleteRepository(org string, name string) error
func (*GitHubProvider) ForkRepository ¶
func (p *GitHubProvider) ForkRepository(originalOrg string, name string, destinationOrg string) (*GitRepository, error)
func (*GitHubProvider) GetContent ¶
func (p *GitHubProvider) GetContent(org string, name string, path string, ref string) (*GitFileContent, error)
func (*GitHubProvider) GetEnterpriseApiURL ¶
func (p *GitHubProvider) GetEnterpriseApiURL() string
GetEnterpriseApiURL returns the github enterprise API URL or blank if this provider is for the https://github.com service
func (*GitHubProvider) GetPullRequest ¶
func (p *GitHubProvider) GetPullRequest(owner string, repo *GitRepository, number int) (*GitPullRequest, error)
func (*GitHubProvider) GetPullRequestCommits ¶
func (p *GitHubProvider) GetPullRequestCommits(owner string, repository *GitRepository, number int) ([]*GitCommit, error)
func (*GitHubProvider) GetRepository ¶
func (p *GitHubProvider) GetRepository(org string, name string) (*GitRepository, error)
func (*GitHubProvider) HasIssues ¶
func (p *GitHubProvider) HasIssues() bool
func (*GitHubProvider) IsBitbucketCloud ¶
func (p *GitHubProvider) IsBitbucketCloud() bool
func (*GitHubProvider) IsBitbucketServer ¶
func (p *GitHubProvider) IsBitbucketServer() bool
func (*GitHubProvider) IsGerrit ¶
func (p *GitHubProvider) IsGerrit() bool
func (*GitHubProvider) IsGitHub ¶
func (p *GitHubProvider) IsGitHub() bool
func (*GitHubProvider) IsGitea ¶
func (p *GitHubProvider) IsGitea() bool
func (*GitHubProvider) IsUserInOrganisation ¶
func (p *GitHubProvider) IsUserInOrganisation(user string, org string) (bool, error)
func (*GitHubProvider) JenkinsWebHookPath ¶
func (p *GitHubProvider) JenkinsWebHookPath(gitURL string, secret string) string
func (*GitHubProvider) Kind ¶
func (p *GitHubProvider) Kind() string
func (*GitHubProvider) Label ¶
func (p *GitHubProvider) Label() string
func (*GitHubProvider) ListCommitStatus ¶
func (p *GitHubProvider) ListCommitStatus(org string, repo string, sha string) ([]*GitRepoStatus, error)
func (*GitHubProvider) ListInvitations ¶
func (p *GitHubProvider) ListInvitations() ([]*github.RepositoryInvitation, *github.Response, error)
func (*GitHubProvider) ListOpenPullRequests ¶ added in v1.3.893
func (p *GitHubProvider) ListOpenPullRequests(owner string, repo string) ([]*GitPullRequest, error)
ListOpenPullRequests lists the open pull requests
func (*GitHubProvider) ListOrganisations ¶
func (p *GitHubProvider) ListOrganisations() ([]GitOrganisation, error)
func (*GitHubProvider) ListReleases ¶
func (p *GitHubProvider) ListReleases(org string, name string) ([]*GitRelease, error)
func (*GitHubProvider) ListRepositories ¶
func (p *GitHubProvider) ListRepositories(org string) ([]*GitRepository, error)
func (*GitHubProvider) ListWebHooks ¶
func (p *GitHubProvider) ListWebHooks(owner string, repo string) ([]*GitWebHookArguments, error)
func (*GitHubProvider) MergePullRequest ¶
func (p *GitHubProvider) MergePullRequest(pr *GitPullRequest, message string) error
func (*GitHubProvider) PullRequestLastCommitStatus ¶
func (p *GitHubProvider) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)
func (*GitHubProvider) RenameRepository ¶
func (p *GitHubProvider) RenameRepository(org string, name string, newName string) (*GitRepository, error)
func (*GitHubProvider) SearchIssues ¶
func (*GitHubProvider) SearchIssuesClosedSince ¶
func (*GitHubProvider) ServerURL ¶
func (p *GitHubProvider) ServerURL() string
func (*GitHubProvider) ShouldForkForPullRequest ¶ added in v1.3.962
func (p *GitHubProvider) ShouldForkForPullRequest(originalOwner string, repoName string, username string) bool
ShouldForkForPullRequest returns true if we should create a personal fork of this repository before creating a pull request
func (*GitHubProvider) UpdateCommitStatus ¶
func (p *GitHubProvider) UpdateCommitStatus(org string, repo string, sha string, status *GitRepoStatus) (*GitRepoStatus, error)
func (*GitHubProvider) UpdatePullRequestStatus ¶
func (p *GitHubProvider) UpdatePullRequestStatus(pr *GitPullRequest) error
func (*GitHubProvider) UpdateRelease ¶
func (p *GitHubProvider) UpdateRelease(owner string, repo string, tag string, releaseInfo *GitRelease) error
func (*GitHubProvider) UpdateWebHook ¶
func (p *GitHubProvider) UpdateWebHook(data *GitWebHookArguments) error
func (*GitHubProvider) UserAuth ¶
func (p *GitHubProvider) UserAuth() auth.UserAuth
func (*GitHubProvider) UserInfo ¶
func (p *GitHubProvider) UserInfo(username string) *GitUser
func (*GitHubProvider) ValidateRepositoryName ¶
func (p *GitHubProvider) ValidateRepositoryName(org string, name string) error
type GitIssue ¶
type GitIssue struct { URL string Owner string Repo string Number *int Key string Title string Body string State *string Labels []GitLabel StatusesURL *string IssueURL *string CreatedAt *time.Time UpdatedAt *time.Time ClosedAt *time.Time IsPullRequest bool User *GitUser ClosedBy *GitUser Assignees []GitUser }
func BitbucketIssueToGitIssue ¶
func BitbucketIssueToGitIssue(bIssue bitbucket.Issue) *GitIssue
func FilterIssuesClosedSince ¶
FilterIssuesClosedSince returns a filtered slice of all the issues closed since the given date
func (*GitIssue) IsClosedSince ¶
IsClosedSince returns true if the issue has been closed since the given da
type GitLabel ¶
func ToGitLabels ¶
ToGitLabels converts the list of label names into an array of GitLabels
type GitLocal ¶
GitLocal provides a semi-fake Gitter - local operations delegate to GitCLI but remote operations are delegated to FakeGit. When using it in tests you must make sure you are operating on a temporary copy of a git repo NOT the real one on your disk (as it will get changed!). Faked out methods have the comment "Faked out"
func (*GitLocal) AddCommit ¶
AddCommit perform an add and commit of the changes from the repository at the given directory with the given messages
func (*GitLocal) AddRemote ¶
AddRemote adds a remote repository at the given URL and with the given name
func (*GitLocal) Branch ¶
Branch returns the current branch of the repository located at the given directory
func (*GitLocal) CheckoutOrphan ¶
CheckoutOrphan checks out the given branch as an orphan
func (*GitLocal) CheckoutRemoteBranch ¶
CheckoutRemoteBranch checks out the given remote tracking branch
func (*GitLocal) CleanForce ¶
CleanForce cleans a git repository located at a given directory
func (*GitLocal) CloneOrPull ¶
CloneOrPull clones the given git URL or pull if it already exists Faked out
func (*GitLocal) CommitIfChanges ¶
CommitIfChanges does a commit if there are any changes in the repository at the given directory
func (*GitLocal) ConvertToValidBranchName ¶
ConvertToValidBranchName converts the given branch name into a valid git branch string replacing any dodgy characters
func (*GitLocal) CreateBranch ¶
CreateBranch creates a branch with the given name in the Git repository from the given directory
func (*GitLocal) CreateBranchFrom ¶ added in v1.3.818
CreateBranchFrom creates a new branch called branchName from startPoint
func (*GitLocal) CreatePushURL ¶
CreatePushURL creates the Git repository URL with the username and password encoded for HTTPS based URLs
func (*GitLocal) CreateTag ¶
CreateTag creates a tag with the given name and message in the repository at the given directory
func (*GitLocal) DeleteRemoteBranch ¶
DeleteRemoteBranch deletes the remote branch in the given given directory Faked out
func (*GitLocal) DiscoverRemoteGitURL ¶
DiscoverRemoteGitURL discovers the remote git URL from the given git configuration
func (*GitLocal) DiscoverUpstreamGitURL ¶
DiscoverUpstreamGitURL discovers the upstream git URL from the given git configuration
func (*GitLocal) FetchBranch ¶
FetchBranch fetches a branch Faked out
func (*GitLocal) FetchBranchUnshallow ¶ added in v1.3.931
FetchBranchUnshallow fetches a branch Faked out
func (*GitLocal) FetchUnshallow ¶
FetchUnshallow does nothing Faked out
func (*GitLocal) FindGitConfigDir ¶
FindGitConfigDir tries to find the `.git` directory either in the current directory or in parent directories Faked out
func (*GitLocal) ForcePushBranch ¶
ForcePushBranch does a force push of the local branch into the remote branch of the repository at the given directory Faked out
func (*GitLocal) GetAuthorEmailForCommit ¶
GetAuthorEmailForCommit returns the author email from commit message with the given SHA
func (*GitLocal) GetCurrentGitTagSHA ¶
GetCurrentGitTagSHA return the SHA of the current git tag from the repository at the given directory
func (*GitLocal) GetLatestCommitMessage ¶
GetLatestCommitMessage returns the latest git commit message
func (*GitLocal) GetLatestCommitSha ¶ added in v1.3.886
GetLatestCommitSha returns the sha of the last commit
func (*GitLocal) GetPreviousGitTagSHA ¶
GetPreviousGitTagSHA returns the previous git tag from the repository at the given directory
func (*GitLocal) GetRemoteUrl ¶
GetRemoteUrl returns the remote URL from the given git config
func (*GitLocal) GetRevisionBeforeDate ¶
GetRevisionBeforeDate returns the revision before the given date
func (*GitLocal) GetRevisionBeforeDateText ¶
GetRevisionBeforeDateText returns the revision before the given date in format "MonthName dayNumber year"
func (*GitLocal) HasChanges ¶
HasChanges indicates if there are any changes in the repository from the given directory
func (*GitLocal) Info ¶
func (g *GitLocal) Info(dir string) (*GitRepository, error)
Info returns the git info of the repository at the given directory
func (*GitLocal) ListChangedFilesFromBranch ¶ added in v1.3.912
ListChangedFilesFromBranch lists files changed between branches
func (*GitLocal) LoadFileFromBranch ¶ added in v1.3.912
LoadFileFromBranch returns a files's contents from a branch
func (*GitLocal) PrintCreateRepositoryGenerateAccessToken ¶
func (g *GitLocal) PrintCreateRepositoryGenerateAccessToken(server *auth.AuthServer, username string, o io.Writer)
PrintCreateRepositoryGenerateAccessToken prints the access token URL of a Git repository
func (*GitLocal) PullRemoteBranches ¶
PullRemoteBranches pulls the remote Git tags from the given given directory Faked out
func (*GitLocal) PullUpstream ¶
PullUpstream pulls the remote upstream branch into master branch into the given directory Faked out
func (*GitLocal) Push ¶
Push pushes the changes from the repository at the given directory Faked out
func (*GitLocal) PushMaster ¶
PushMaster pushes the master branch into the origin Faked out
func (*GitLocal) RemoteBranchNames ¶
RemoteBranchNames returns all remote branch names with the given prefix
func (*GitLocal) RemoteBranches ¶
RemoteBranches returns the remote branches
func (*GitLocal) RemoteUpdate ¶ added in v1.3.886
RemoteUpdate performs a git remote update Faked out
func (*GitLocal) Remove ¶
Remove removes the given file from a Git repository located at the given directory
func (*GitLocal) RemoveForce ¶
RemoveForce removes the given file from a git repository located at the given directory
func (*GitLocal) ResetHard ¶ added in v1.3.886
ResetHard performs a git reset --hard back to the commitish specified
func (*GitLocal) ResetToUpstream ¶ added in v1.3.1013
ResetToUpstream resets the given branch to the upstream version
func (*GitLocal) SetRemoteURL ¶
SetRemoteURL sets the remote URL of the remote with the given name
func (*GitLocal) SetUsername ¶
SetUsername sets the username in the git configuration Faked out
func (*GitLocal) ShallowCloneBranch ¶
ShallowCloneBranch clones a single branch of the given git URL into the given directory Faked out
func (*GitLocal) UpdateRemote ¶
UpdateRemote updates the URL of the remote repository
type GitOrganisation ¶
type GitOrganisation struct {
Login string
}
type GitProvider ¶
type GitProvider interface { OrganisationLister ListRepositories(org string) ([]*GitRepository, error) CreateRepository(org string, name string, private bool) (*GitRepository, error) GetRepository(org string, name string) (*GitRepository, error) DeleteRepository(org string, name string) error ForkRepository(originalOrg string, name string, destinationOrg string) (*GitRepository, error) RenameRepository(org string, name string, newName string) (*GitRepository, error) ValidateRepositoryName(org string, name string) error CreatePullRequest(data *GitPullRequestArguments) (*GitPullRequest, error) UpdatePullRequestStatus(pr *GitPullRequest) error GetPullRequest(owner string, repo *GitRepository, number int) (*GitPullRequest, error) ListOpenPullRequests(owner string, repo string) ([]*GitPullRequest, error) GetPullRequestCommits(owner string, repo *GitRepository, number int) ([]*GitCommit, error) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error) ListCommitStatus(org string, repo string, sha string) ([]*GitRepoStatus, error) UpdateCommitStatus(org string, repo string, sha string, status *GitRepoStatus) (*GitRepoStatus, error) MergePullRequest(pr *GitPullRequest, message string) error CreateWebHook(data *GitWebHookArguments) error ListWebHooks(org string, repo string) ([]*GitWebHookArguments, error) UpdateWebHook(data *GitWebHookArguments) error IsGitHub() bool IsGitea() bool IsBitbucketCloud() bool IsBitbucketServer() bool IsGerrit() bool Kind() string GetIssue(org string, name string, number int) (*GitIssue, error) IssueURL(org string, name string, number int, isPull bool) string SearchIssues(org string, name string, query string) ([]*GitIssue, error) SearchIssuesClosedSince(org string, name string, t time.Time) ([]*GitIssue, error) CreateIssue(owner string, repo string, issue *GitIssue) (*GitIssue, error) HasIssues() bool AddPRComment(pr *GitPullRequest, comment string) error CreateIssueComment(owner string, repo string, number int, comment string) error UpdateRelease(owner string, repo string, tag string, releaseInfo *GitRelease) error ListReleases(org string, name string) ([]*GitRelease, error) GetContent(org string, name string, path string, ref string) (*GitFileContent, error) JenkinsWebHookPath(gitURL string, secret string) string // Label returns the Git service label or name Label() string // ServerURL returns the Git server URL ServerURL() string // BranchArchiveURL returns a URL to the ZIP archive for the git branch BranchArchiveURL(org string, name string, branch string) string // Returns the current username CurrentUsername() string // Returns the current user auth UserAuth() auth.UserAuth // Returns user info, if possible UserInfo(username string) *GitUser AddCollaborator(string, string, string) error // TODO Refactor to remove bespoke types when we implement another provider ListInvitations() ([]*github.RepositoryInvitation, *github.Response, error) // TODO Refactor to remove bespoke types when we implement another provider AcceptInvitation(int64) (*github.Response, error) // ShouldForkForPullReques treturns true if we should create a personal fork of this repository // before creating a pull request ShouldForkForPullRequest(originalOwner string, repoName string, username string) bool }
GitProvider is the interface for abstracting use of different git provider APIs
func CreateProvider ¶
func CreateProvider(server *auth.AuthServer, user *auth.UserAuth, git Gitter) (GitProvider, error)
func CreateProviderForURL ¶
func CreateProviderForURL(inCluster bool, authConfigSvc auth.ConfigService, gitKind string, hostUrl string, git Gitter, batchMode bool, in terminal.FileReader, out terminal.FileWriter, errOut io.Writer) (GitProvider, error)
CreateProviderForURL creates the Git provider for the given git kind and host URL
func NewBitbucketCloudProvider ¶
func NewBitbucketCloudProvider(server *auth.AuthServer, user *auth.UserAuth, git Gitter) (GitProvider, error)
func NewBitbucketServerProvider ¶
func NewBitbucketServerProvider(server *auth.AuthServer, user *auth.UserAuth, git Gitter) (GitProvider, error)
func NewGerritProvider ¶
func NewGerritProvider(server *auth.AuthServer, user *auth.UserAuth, git Gitter) (GitProvider, error)
func NewGitHubProvider ¶
func NewGitHubProvider(server *auth.AuthServer, user *auth.UserAuth, git Gitter) (GitProvider, error)
func NewGiteaProvider ¶
func NewGiteaProvider(server *auth.AuthServer, user *auth.UserAuth, git Gitter) (GitProvider, error)
func NewGitlabProvider ¶
func NewGitlabProvider(server *auth.AuthServer, user *auth.UserAuth, git Gitter) (GitProvider, error)
func WithGitlabClient ¶
func WithGitlabClient(server *auth.AuthServer, user *auth.UserAuth, client *gitlab.Client, git Gitter) (GitProvider, error)
Used by unit tests to inject a mocked client
type GitPullRequest ¶
type GitPullRequest struct { URL string Author *GitUser Owner string Repo string Number *int Mergeable *bool Merged *bool HeadRef *string State *string StatusesURL *string IssueURL *string DiffURL *string MergeCommitSHA *string ClosedAt *time.Time MergedAt *time.Time LastCommitSha string Title string Body string Assignees []*GitUser RequestedReviewers []*GitUser Labels []*Label UpdatedAt *time.Time }
func (*GitPullRequest) IsClosed ¶
func (pr *GitPullRequest) IsClosed() bool
IsClosed returns true if the PullRequest has been closed
func (*GitPullRequest) NumberString ¶
func (pr *GitPullRequest) NumberString() string
NumberString returns the string representation of the Pull Request number or blank if its missing
type GitPullRequestArguments ¶
type GitPullRequestArguments struct { Title string Body string Head string Base string GitRepository *GitRepository }
type GitRelease ¶
type GitReleaseAsset ¶
GitReleaseAsset represents a release stored in Git
type GitRepoStatus ¶
type GitRepoStatus struct { ID string Context string URL string // State is the current state of the repository. Possible values are: // pending, success, error, or failure. State string `json:"state,omitempty"` // TargetURL is the URL of the page representing this status TargetURL string `json:"target_url,omitempty"` // Description is a short high level summary of the status. Description string }
func (*GitRepoStatus) IsFailed ¶
func (s *GitRepoStatus) IsFailed() bool
func (*GitRepoStatus) IsSuccess ¶
func (s *GitRepoStatus) IsSuccess() bool
type GitRepository ¶
type GitRepository struct { Name string AllowMergeCommit bool HTMLURL string CloneURL string SSHURL string Language string Fork bool Stars int URL string Scheme string Host string Organisation string Project string Private bool }
func BitbucketRepositoryToGitRepository ¶
func BitbucketRepositoryToGitRepository(bRepo bitbucket.Repository) *GitRepository
func BitbucketServerRepositoryToGitRepository ¶
func BitbucketServerRepositoryToGitRepository(bRepo bitbucket.Repository) *GitRepository
func ParseGitURL ¶
func ParseGitURL(text string) (*GitRepository, error)
ParseGitURL attempts to parse the given text as a URL or git URL-like string to determine the protocol, host, organisation and name
func PickRepositories ¶
func PickRepositories(provider GitProvider, owner string, message string, selectAll bool, filter string, in terminal.FileReader, out terminal.FileWriter, errOut io.Writer) ([]*GitRepository, error)
func (*GitRepository) CreateProvider ¶
func (i *GitRepository) CreateProvider(inCluster bool, authConfigSvc auth.ConfigService, gitKind string, git Gitter, batchMode bool, in terminal.FileReader, out terminal.FileWriter, errOut io.Writer) (GitProvider, error)
func (*GitRepository) CreateProviderForUser ¶
func (i *GitRepository) CreateProviderForUser(server *auth.AuthServer, user *auth.UserAuth, gitKind string, git Gitter) (GitProvider, error)
func (*GitRepository) HostURL ¶
func (i *GitRepository) HostURL() string
HostURL returns the URL to the host
func (*GitRepository) HostURLWithoutUser ¶
func (i *GitRepository) HostURLWithoutUser() string
func (*GitRepository) HttpCloneURL ¶
func (i *GitRepository) HttpCloneURL() string
HttpCloneURL returns the HTTPS git URL this repository
func (*GitRepository) HttpURL ¶
func (i *GitRepository) HttpURL() string
HttpURL returns the URL to browse this repository in a web browser
func (*GitRepository) HttpsURL ¶
func (i *GitRepository) HttpsURL() string
HttpsURL returns the URL to browse this repository in a web browser
func (*GitRepository) IsGitHub ¶
func (i *GitRepository) IsGitHub() bool
func (*GitRepository) PickOrCreateProvider ¶
func (i *GitRepository) PickOrCreateProvider(authConfigSvc auth.ConfigService, message string, batchMode bool, gitKind string, git Gitter, in terminal.FileReader, out terminal.FileWriter, errOut io.Writer) (GitProvider, error)
func (*GitRepository) PipelinePath ¶
func (i *GitRepository) PipelinePath() string
PipelinePath returns the pipeline path for the master branch which can be used to query pipeline logs in `jx get build logs myPipelinePath`
func (*GitRepository) PullRequestURL ¶
func (i *GitRepository) PullRequestURL(prName string) string
PullRequestURL returns the URL of a pull request of the given name/number
type GitRepositoryOptions ¶
type GitWebHookArguments ¶
type GiteaProvider ¶
type GiteaProvider struct { Username string Client *gitea.Client Server auth.AuthServer User auth.UserAuth Git Gitter }
func (*GiteaProvider) AcceptInvitation ¶
func (p *GiteaProvider) AcceptInvitation(ID int64) (*github.Response, error)
func (*GiteaProvider) AddCollaborator ¶
func (p *GiteaProvider) AddCollaborator(user string, organisation string, repo string) error
func (*GiteaProvider) AddPRComment ¶
func (p *GiteaProvider) AddPRComment(pr *GitPullRequest, comment string) error
func (*GiteaProvider) BranchArchiveURL ¶
func (p *GiteaProvider) BranchArchiveURL(org string, name string, branch string) string
func (*GiteaProvider) CreateIssue ¶
func (*GiteaProvider) CreateIssueComment ¶
func (*GiteaProvider) CreatePullRequest ¶
func (p *GiteaProvider) CreatePullRequest(data *GitPullRequestArguments) (*GitPullRequest, error)
func (*GiteaProvider) CreateRepository ¶
func (p *GiteaProvider) CreateRepository(org string, name string, private bool) (*GitRepository, error)
func (*GiteaProvider) CreateWebHook ¶
func (p *GiteaProvider) CreateWebHook(data *GitWebHookArguments) error
func (*GiteaProvider) CurrentUsername ¶
func (p *GiteaProvider) CurrentUsername() string
func (*GiteaProvider) DeleteRepository ¶
func (p *GiteaProvider) DeleteRepository(org string, name string) error
func (*GiteaProvider) ForkRepository ¶
func (p *GiteaProvider) ForkRepository(originalOrg string, name string, destinationOrg string) (*GitRepository, error)
func (*GiteaProvider) GetContent ¶
func (p *GiteaProvider) GetContent(org string, name string, path string, ref string) (*GitFileContent, error)
func (*GiteaProvider) GetPullRequest ¶
func (p *GiteaProvider) GetPullRequest(owner string, repo *GitRepository, number int) (*GitPullRequest, error)
func (*GiteaProvider) GetPullRequestCommits ¶
func (p *GiteaProvider) GetPullRequestCommits(owner string, repository *GitRepository, number int) ([]*GitCommit, error)
func (*GiteaProvider) GetRepository ¶
func (p *GiteaProvider) GetRepository(org string, name string) (*GitRepository, error)
func (*GiteaProvider) HasIssues ¶
func (p *GiteaProvider) HasIssues() bool
func (*GiteaProvider) IsBitbucketCloud ¶
func (p *GiteaProvider) IsBitbucketCloud() bool
func (*GiteaProvider) IsBitbucketServer ¶
func (p *GiteaProvider) IsBitbucketServer() bool
func (*GiteaProvider) IsGerrit ¶
func (p *GiteaProvider) IsGerrit() bool
func (*GiteaProvider) IsGitHub ¶
func (p *GiteaProvider) IsGitHub() bool
func (*GiteaProvider) IsGitea ¶
func (p *GiteaProvider) IsGitea() bool
func (*GiteaProvider) JenkinsWebHookPath ¶
func (p *GiteaProvider) JenkinsWebHookPath(gitURL string, secret string) string
func (*GiteaProvider) Kind ¶
func (p *GiteaProvider) Kind() string
func (*GiteaProvider) Label ¶
func (p *GiteaProvider) Label() string
func (*GiteaProvider) ListCommitStatus ¶
func (p *GiteaProvider) ListCommitStatus(org string, repo string, sha string) ([]*GitRepoStatus, error)
func (*GiteaProvider) ListInvitations ¶
func (p *GiteaProvider) ListInvitations() ([]*github.RepositoryInvitation, *github.Response, error)
func (*GiteaProvider) ListOpenPullRequests ¶ added in v1.3.893
func (p *GiteaProvider) ListOpenPullRequests(owner string, repo string) ([]*GitPullRequest, error)
ListOpenPullRequests lists the open pull requests
func (*GiteaProvider) ListOrganisations ¶
func (p *GiteaProvider) ListOrganisations() ([]GitOrganisation, error)
func (*GiteaProvider) ListReleases ¶
func (p *GiteaProvider) ListReleases(org string, name string) ([]*GitRelease, error)
func (*GiteaProvider) ListRepositories ¶
func (p *GiteaProvider) ListRepositories(org string) ([]*GitRepository, error)
func (*GiteaProvider) ListWebHooks ¶
func (p *GiteaProvider) ListWebHooks(owner string, repo string) ([]*GitWebHookArguments, error)
func (*GiteaProvider) MergePullRequest ¶
func (p *GiteaProvider) MergePullRequest(pr *GitPullRequest, message string) error
func (*GiteaProvider) PullRequestLastCommitStatus ¶
func (p *GiteaProvider) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)
func (*GiteaProvider) RenameRepository ¶
func (p *GiteaProvider) RenameRepository(org string, name string, newName string) (*GitRepository, error)
func (*GiteaProvider) SearchIssues ¶
func (*GiteaProvider) SearchIssuesClosedSince ¶
func (*GiteaProvider) ServerURL ¶
func (p *GiteaProvider) ServerURL() string
func (*GiteaProvider) ShouldForkForPullRequest ¶ added in v1.3.962
func (p *GiteaProvider) ShouldForkForPullRequest(originalOwner string, repoName string, username string) bool
ShouldForkForPullReques treturns true if we should create a personal fork of this repository before creating a pull request
func (*GiteaProvider) UpdateCommitStatus ¶
func (b *GiteaProvider) UpdateCommitStatus(org string, repo string, sha string, status *GitRepoStatus) (*GitRepoStatus, error)
func (*GiteaProvider) UpdatePullRequestStatus ¶
func (p *GiteaProvider) UpdatePullRequestStatus(pr *GitPullRequest) error
func (*GiteaProvider) UpdateRelease ¶
func (p *GiteaProvider) UpdateRelease(owner string, repo string, tag string, releaseInfo *GitRelease) error
func (*GiteaProvider) UpdateWebHook ¶
func (p *GiteaProvider) UpdateWebHook(data *GitWebHookArguments) error
func (*GiteaProvider) UserAuth ¶
func (p *GiteaProvider) UserAuth() auth.UserAuth
func (*GiteaProvider) UserInfo ¶
func (p *GiteaProvider) UserInfo(username string) *GitUser
func (*GiteaProvider) ValidateRepositoryName ¶
func (p *GiteaProvider) ValidateRepositoryName(org string, name string) error
type GitlabProvider ¶
type GitlabProvider struct { Username string Client *gitlab.Client Context context.Context Server auth.AuthServer User auth.UserAuth Git Gitter }
func (*GitlabProvider) AcceptInvitation ¶
func (g *GitlabProvider) AcceptInvitation(ID int64) (*github.Response, error)
AcceptInvitation accepts an invitation
func (*GitlabProvider) AddCollaborator ¶
func (g *GitlabProvider) AddCollaborator(user string, organisation string, repo string) error
AddCollaborator adds a collaborator
func (*GitlabProvider) AddPRComment ¶
func (g *GitlabProvider) AddPRComment(pr *GitPullRequest, comment string) error
func (*GitlabProvider) BranchArchiveURL ¶
func (g *GitlabProvider) BranchArchiveURL(org string, name string, branch string) string
func (*GitlabProvider) CreateIssue ¶
func (*GitlabProvider) CreateIssueComment ¶
func (*GitlabProvider) CreatePullRequest ¶
func (g *GitlabProvider) CreatePullRequest(data *GitPullRequestArguments) (*GitPullRequest, error)
func (*GitlabProvider) CreateRepository ¶
func (g *GitlabProvider) CreateRepository(org string, name string, private bool) (*GitRepository, error)
func (*GitlabProvider) CreateWebHook ¶
func (g *GitlabProvider) CreateWebHook(data *GitWebHookArguments) error
func (*GitlabProvider) CurrentUsername ¶
func (g *GitlabProvider) CurrentUsername() string
func (*GitlabProvider) DeleteRepository ¶
func (g *GitlabProvider) DeleteRepository(org, name string) error
func (*GitlabProvider) ForkRepository ¶
func (g *GitlabProvider) ForkRepository(originalOrg, name, destinationOrg string) (*GitRepository, error)
func (*GitlabProvider) GetContent ¶
func (g *GitlabProvider) GetContent(org string, name string, path string, ref string) (*GitFileContent, error)
GetContent returns the content of a file
func (*GitlabProvider) GetIssue ¶
func (g *GitlabProvider) GetIssue(org, repo string, number int) (*GitIssue, error)
func (*GitlabProvider) GetPullRequest ¶
func (g *GitlabProvider) GetPullRequest(owner string, repo *GitRepository, number int) (*GitPullRequest, error)
GetPullRequest gets a PR
func (*GitlabProvider) GetPullRequestCommits ¶
func (g *GitlabProvider) GetPullRequestCommits(owner string, repository *GitRepository, number int) ([]*GitCommit, error)
GetPullRequestCommits gets the PR commits
func (*GitlabProvider) GetRepository ¶
func (g *GitlabProvider) GetRepository(org, name string) (*GitRepository, error)
func (*GitlabProvider) HasIssues ¶
func (g *GitlabProvider) HasIssues() bool
func (*GitlabProvider) IsBitbucketCloud ¶
func (g *GitlabProvider) IsBitbucketCloud() bool
func (*GitlabProvider) IsBitbucketServer ¶
func (g *GitlabProvider) IsBitbucketServer() bool
func (*GitlabProvider) IsGerrit ¶
func (g *GitlabProvider) IsGerrit() bool
func (*GitlabProvider) IsGitHub ¶
func (g *GitlabProvider) IsGitHub() bool
func (*GitlabProvider) IsGitea ¶
func (g *GitlabProvider) IsGitea() bool
func (*GitlabProvider) JenkinsWebHookPath ¶
func (g *GitlabProvider) JenkinsWebHookPath(gitURL string, secret string) string
func (*GitlabProvider) Kind ¶
func (g *GitlabProvider) Kind() string
func (*GitlabProvider) Label ¶
func (g *GitlabProvider) Label() string
func (*GitlabProvider) ListCommitStatus ¶
func (g *GitlabProvider) ListCommitStatus(org string, repo string, sha string) ([]*GitRepoStatus, error)
func (*GitlabProvider) ListInvitations ¶
func (g *GitlabProvider) ListInvitations() ([]*github.RepositoryInvitation, *github.Response, error)
ListInvitations lists pending invites
func (*GitlabProvider) ListOpenPullRequests ¶ added in v1.3.893
func (g *GitlabProvider) ListOpenPullRequests(owner string, repo string) ([]*GitPullRequest, error)
ListOpenPullRequests lists the open pull requests
func (*GitlabProvider) ListOrganisations ¶
func (g *GitlabProvider) ListOrganisations() ([]GitOrganisation, error)
func (*GitlabProvider) ListReleases ¶
func (g *GitlabProvider) ListReleases(org string, name string) ([]*GitRelease, error)
func (*GitlabProvider) ListRepositories ¶
func (g *GitlabProvider) ListRepositories(org string) ([]*GitRepository, error)
func (*GitlabProvider) ListWebHooks ¶
func (g *GitlabProvider) ListWebHooks(owner string, repo string) ([]*GitWebHookArguments, error)
ListWebHooks lists the webhooks
func (*GitlabProvider) MergePullRequest ¶
func (g *GitlabProvider) MergePullRequest(pr *GitPullRequest, message string) error
func (*GitlabProvider) PullRequestLastCommitStatus ¶
func (g *GitlabProvider) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)
func (*GitlabProvider) RenameRepository ¶
func (g *GitlabProvider) RenameRepository(org, name, newName string) (*GitRepository, error)
func (*GitlabProvider) SearchIssues ¶
func (g *GitlabProvider) SearchIssues(org, repo, query string) ([]*GitIssue, error)
func (*GitlabProvider) SearchIssuesClosedSince ¶
func (*GitlabProvider) ServerURL ¶
func (g *GitlabProvider) ServerURL() string
func (*GitlabProvider) ShouldForkForPullRequest ¶ added in v1.3.962
func (g *GitlabProvider) ShouldForkForPullRequest(originalOwner string, repoName string, username string) bool
ShouldForkForPullReques treturns true if we should create a personal fork of this repository before creating a pull request
func (*GitlabProvider) UpdateCommitStatus ¶
func (g *GitlabProvider) UpdateCommitStatus(org string, repo string, sha string, status *GitRepoStatus) (*GitRepoStatus, error)
UpdateCommitStatus updates the commit status
func (*GitlabProvider) UpdatePullRequestStatus ¶
func (g *GitlabProvider) UpdatePullRequestStatus(pr *GitPullRequest) error
func (*GitlabProvider) UpdateRelease ¶
func (g *GitlabProvider) UpdateRelease(owner string, repo string, tag string, releaseInfo *GitRelease) error
func (*GitlabProvider) UpdateWebHook ¶
func (g *GitlabProvider) UpdateWebHook(data *GitWebHookArguments) error
func (*GitlabProvider) UserAuth ¶
func (g *GitlabProvider) UserAuth() auth.UserAuth
func (*GitlabProvider) UserInfo ¶
func (g *GitlabProvider) UserInfo(username string) *GitUser
func (*GitlabProvider) ValidateRepositoryName ¶
func (g *GitlabProvider) ValidateRepositoryName(org, name string) error
type Gitter ¶
type Gitter interface { FindGitConfigDir(dir string) (string, string, error) PrintCreateRepositoryGenerateAccessToken(server *auth.AuthServer, username string, o io.Writer) Status(dir string) error Server(dir string) (string, error) Info(dir string) (*GitRepository, error) IsFork(dir string) (bool, error) Version() (string, error) RepoName(org, repoName string) string Username(dir string) (string, error) SetUsername(dir string, username string) error Email(dir string) (string, error) SetEmail(dir string, email string) error GetAuthorEmailForCommit(dir string, sha string) (string, error) Init(dir string) error Clone(url string, directory string) error ShallowCloneBranch(url string, branch string, directory string) error FetchUnshallow(dir string) error IsShallow(dir string) (bool, error) Push(dir string) error PushMaster(dir string) error PushTag(dir string, tag string) error CreatePushURL(cloneURL string, userAuth *auth.UserAuth) (string, error) ForcePushBranch(dir string, localBranch string, remoteBranch string) error CloneOrPull(url string, directory string) error Pull(dir string) error PullRemoteBranches(dir string) error PullUpstream(dir string) error // ResetToUpstream resets the given branch to the upstream version ResetToUpstream(dir string, branch string) error AddRemote(dir string, name string, url string) error SetRemoteURL(dir string, name string, gitURL string) error UpdateRemote(dir, url string) error DiscoverRemoteGitURL(gitConf string) (string, error) DiscoverUpstreamGitURL(gitConf string) (string, error) RemoteBranches(dir string) ([]string, error) RemoteBranchNames(dir string, prefix string) ([]string, error) GetRemoteUrl(config *gitcfg.Config, name string) string RemoteUpdate(dir string) error Branch(dir string) (string, error) CreateBranchFrom(dir string, branchName string, startPoint string) error CreateBranch(dir string, branch string) error CheckoutRemoteBranch(dir string, branch string) error Checkout(dir string, branch string) error CheckoutOrphan(dir string, branch string) error ConvertToValidBranchName(name string) string FetchBranch(dir string, repo string, refspec ...string) error FetchBranchUnshallow(dir string, repo string, refspec ...string) error Merge(dir string, commitish string) error ResetHard(dir string, commitish string) error Stash(dir string) error Remove(dir, fileName string) error RemoveForce(dir, fileName string) error CleanForce(dir, fileName string) error Add(dir string, args ...string) error CommitIfChanges(dir string, message string) error CommitDir(dir string, message string) error AddCommit(dir string, msg string) error HasChanges(dir string) (bool, error) Diff(dir string) (string, error) ListChangedFilesFromBranch(dir string, branch string) (string, error) LoadFileFromBranch(dir string, branch string, file string) (string, error) GetLatestCommitMessage(dir string) (string, error) GetPreviousGitTagSHA(dir string) (string, error) GetCurrentGitTagSHA(dir string) (string, error) FetchTags(dir string) error Tags(dir string) ([]string, error) CreateTag(dir string, tag string, msg string) error GetLatestCommitSha(dir string) (string, error) GetRevisionBeforeDate(dir string, t time.Time) (string, error) GetRevisionBeforeDateText(dir string, dateText string) (string, error) DeleteRemoteBranch(dir string, remoteName string, branch string) error }
Gitter defines common git actions used by Jenkins X via git cli
type GroupAndCommitInfos ¶
type GroupAndCommitInfos struct {
// contains filtered or unexported fields
}
type Label ¶
type Label struct { ID *int64 URL *string Name *string Color *string Description *string Default *bool }
Label represents a label on an Issue
type OrganisationChecker ¶
type OrganisationChecker interface {
IsUserInOrganisation(user string, organisation string) (bool, error)
}
OrganisationChecker verifies if an user is member of an organization
type OrganisationLister ¶
type OrganisationLister interface {
ListOrganisations() ([]GitOrganisation, error)
}
OrganisationLister returns a slice of GitOrganisation
type PullRequestInfo ¶
type PullRequestInfo struct { GitProvider GitProvider PullRequest *GitPullRequest PullRequestArguments *GitPullRequestArguments }
PullRequestInfo describes a pull request that has been created