gits

package
v1.1.39 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2018 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GitHubHost = "github.com"
	GitHubURL  = "https://github.com"
)

Variables

View Source
var (

	// ConventionalCommitTitles textual descriptions for
	// Conventional Commit types: https://conventionalcommits.org/
	ConventionalCommitTitles = map[string]*CommitGroup{
		"feat":     createCommitGroup("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(""),
	}
)

Functions

func ConvertToValidBranchName

func ConvertToValidBranchName(name string) string

ConvertToValidBranchName converts the given branch name into a valid git branch string replacing any dodgy characters

func DiscoverRemoteGitURL

func DiscoverRemoteGitURL(gitConf string) (string, error)

func DiscoverUpstreamGitURL

func DiscoverUpstreamGitURL(gitConf string) (string, error)

func FindGitConfigDir

func FindGitConfigDir(dir string) (string, string, error)

FindGitConfigDir tries to find the `.git` directory either in the current directory or in parent directories

func GenerateMarkdown

func GenerateMarkdown(releaseSpec *v1.ReleaseSpec, gitInfo *GitRepositoryInfo) (string, error)

GenerateMarkdown generates the markdown document for the commits

func GetCurrentGitTagSHA

func GetCurrentGitTagSHA(dir string) (string, error)

func GetGitServer

func GetGitServer(dir string) (string, error)

func GetPreviousGitTagSHA

func GetPreviousGitTagSHA(dir string) (string, error)

func GetRemoteUrl

func GetRemoteUrl(config *gitcfg.Config, name string) string

func GitAdd

func GitAdd(dir string, args ...string) error

func GitClone

func GitClone(url string, directory string) error

GitClone clones the given git URL into the given directory

func GitCloneOrPull

func GitCloneOrPull(url string, directory string) error

GitCloneOrPull will clone the given git URL or pull if it alreasy exists

func GitCmd

func GitCmd(dir string, args ...string) error

func GitCommit

func GitCommit(dir string, message string) error

func GitCommitIfChanges

func GitCommitIfChanges(dir string, message string) error

func GitCreatePushURL

func GitCreatePushURL(cloneURL string, userAuth *auth.UserAuth) (string, error)

GitCreatePushURL creates the git repository URL with the username and password encoded for HTTPS based URLs

func GitGetBranch

func GitGetBranch(dir string) (string, error)

func GitGetRemoteBranchNames

func GitGetRemoteBranchNames(dir string, prefix string) ([]string, error)

func GitHubAccessTokenURL

func GitHubAccessTokenURL(url string) string

func GitInit

func GitInit(dir string) error

func GitIsFork

func GitIsFork(gitProvider GitProvider, gitInfo *GitRepositoryInfo, dir string) (bool, error)

func GitPush

func GitPush(dir string) error

func GitRepoName

func GitRepoName(org, repoName string) string

func GitStatus

func GitStatus(dir string) error

func GiteaAccessTokenURL

func GiteaAccessTokenURL(url string) string

func HasChanges

func HasChanges(dir string) (bool, error)

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) (string, error)

PickOrganisation picks an organisations login if there is one available

func PrintCreateRepositoryGenerateAccessToken

func PrintCreateRepositoryGenerateAccessToken(server *auth.AuthServer, o io.Writer)

func ProviderAccessTokenURL

func ProviderAccessTokenURL(kind string, url string) string

func SetRemoteURL

func SetRemoteURL(dir string, name string, gitURL string) error

Types

type BitbucketProvider

type BitbucketProvider struct {
	Client   *bitbucket.APIClient
	Username string
	Context  context.Context

	Server auth.AuthServer
	User   auth.UserAuth
}

BitbucketProvider implements GitProvider interface for bitbucket.org

func (*BitbucketProvider) AddPRComment

func (b *BitbucketProvider) AddPRComment(pr *GitPullRequest, comment string) error

func (*BitbucketProvider) CreateIssue

func (b *BitbucketProvider) CreateIssue(owner string, repo string, issue *GitIssue) (*GitIssue, error)

func (*BitbucketProvider) CreateIssueComment

func (b *BitbucketProvider) CreateIssueComment(owner string, repo string, number int, comment string) error

func (*BitbucketProvider) CreatePullRequest

func (b *BitbucketProvider) CreatePullRequest(
	data *GitPullRequestArguments,
) (*GitPullRequest, error)

func (*BitbucketProvider) CreateRepository

func (b *BitbucketProvider) CreateRepository(
	org string,
	name string,
	private bool,
) (*GitRepository, error)

func (*BitbucketProvider) CreateWebHook

func (b *BitbucketProvider) CreateWebHook(data *GitWebHookArguments) error

func (*BitbucketProvider) DeleteRepository

func (b *BitbucketProvider) DeleteRepository(org string, name string) error

func (*BitbucketProvider) ForkRepository

func (b *BitbucketProvider) ForkRepository(
	originalOrg string,
	name string,
	destinationOrg string,
) (*GitRepository, error)

func (*BitbucketProvider) GetIssue

func (b *BitbucketProvider) GetIssue(org string, name string, number int) (*GitIssue, error)

func (*BitbucketProvider) GetRepository

func (b *BitbucketProvider) GetRepository(
	org string,
	name string,
) (*GitRepository, error)

func (*BitbucketProvider) HasIssues

func (b *BitbucketProvider) HasIssues() bool

func (*BitbucketProvider) IsBitbucket

func (b *BitbucketProvider) IsBitbucket() bool

func (*BitbucketProvider) IsGitHub

func (b *BitbucketProvider) IsGitHub() bool

func (*BitbucketProvider) IsGitea

func (b *BitbucketProvider) IsGitea() bool

func (*BitbucketProvider) IssueURL

func (p *BitbucketProvider) IssueURL(org string, name string, number int, isPull bool) string

func (*BitbucketProvider) JenkinsWebHookPath

func (b *BitbucketProvider) JenkinsWebHookPath(gitURL string, secret string) string

func (*BitbucketProvider) Kind

func (b *BitbucketProvider) Kind() string

func (*BitbucketProvider) Label

func (b *BitbucketProvider) Label() string

func (*BitbucketProvider) ListCommitStatus

func (b *BitbucketProvider) ListCommitStatus(org string, repo string, sha string) ([]*GitRepoStatus, error)

func (*BitbucketProvider) ListOrganisations

func (b *BitbucketProvider) ListOrganisations() ([]GitOrganisation, error)

func (*BitbucketProvider) ListRepositories

func (b *BitbucketProvider) ListRepositories(org string) ([]*GitRepository, error)

func (*BitbucketProvider) MergePullRequest

func (b *BitbucketProvider) MergePullRequest(pr *GitPullRequest, message string) error

func (*BitbucketProvider) PullRequestLastCommitStatus

func (b *BitbucketProvider) PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)

func (*BitbucketProvider) RenameRepository

func (b *BitbucketProvider) RenameRepository(
	org string,
	name string,
	newName string,
) (*GitRepository, error)

func (*BitbucketProvider) SearchIssues

func (b *BitbucketProvider) SearchIssues(org string, name string, query string) ([]*GitIssue, error)

func (*BitbucketProvider) UpdatePullRequestStatus

func (b *BitbucketProvider) UpdatePullRequestStatus(pr *GitPullRequest) error

func (*BitbucketProvider) UpdateRelease

func (b *BitbucketProvider) UpdateRelease(owner string, repo string, tag string, releaseInfo *GitRelease) error

func (*BitbucketProvider) ValidateRepositoryName

func (b *BitbucketProvider) ValidateRepositoryName(org string, name string) error

type CommitGroup

type CommitGroup struct {
	Title string
	Order int
}

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 CreateRepoData

type CreateRepoData struct {
	Organisation string
	RepoName     string
	FullName     string
	PrivateRepo  bool
	User         *auth.UserAuth
	GitProvider  GitProvider
}

func PickNewGitRepository

func PickNewGitRepository(out io.Writer, batchMode bool, authConfigSvc auth.AuthConfigService, defaultRepoName string, repoOptions GitRepositoryOptions, server *auth.AuthServer, userAuth *auth.UserAuth) (*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 GitHubProvider

type GitHubProvider struct {
	Username string
	Client   *github.Client
	Context  context.Context

	Server auth.AuthServer
	User   auth.UserAuth
}

func (*GitHubProvider) AddPRComment

func (p *GitHubProvider) AddPRComment(pr *GitPullRequest, comment string) error

func (*GitHubProvider) CreateIssue

func (p *GitHubProvider) CreateIssue(owner string, repo string, issue *GitIssue) (*GitIssue, error)

func (*GitHubProvider) CreateIssueComment

func (p *GitHubProvider) CreateIssueComment(owner string, repo string, number int, comment string) error

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) 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) GetIssue

func (p *GitHubProvider) GetIssue(org string, name string, number int) (*GitIssue, error)

func (*GitHubProvider) GetRepository

func (p *GitHubProvider) GetRepository(org string, name string) (*GitRepository, error)

func (*GitHubProvider) HasIssues

func (p *GitHubProvider) HasIssues() bool

func (*GitHubProvider) IsGitHub

func (p *GitHubProvider) IsGitHub() bool

func (*GitHubProvider) IsGitea

func (p *GitHubProvider) IsGitea() bool

func (*GitHubProvider) IssueURL

func (p *GitHubProvider) IssueURL(org string, name string, number int, isPull bool) string

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) ListOrganisations

func (p *GitHubProvider) ListOrganisations() ([]GitOrganisation, error)

func (*GitHubProvider) ListRepositories

func (p *GitHubProvider) ListRepositories(org string) ([]*GitRepository, 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 (p *GitHubProvider) SearchIssues(org string, name string, filter string) ([]*GitIssue, 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) 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
	ClosedAt      *time.Time
	IsPullRequest bool
	User          *GitUser
	ClosedBy      *GitUser
	Assignees     []GitUser
}

func (*GitIssue) Name

func (i *GitIssue) Name() string

Name returns the textual name of the issue

type GitLabel

type GitLabel struct {
	URL   string
	Name  string
	Color string
}

func ToGitLabels

func ToGitLabels(names []string) []GitLabel

ToGitLabels converts the list of label names into an array of GitLabels

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

	PullRequestLastCommitStatus(pr *GitPullRequest) (string, error)

	ListCommitStatus(org string, repo string, sha string) ([]*GitRepoStatus, error)

	MergePullRequest(pr *GitPullRequest, message string) error

	CreateWebHook(data *GitWebHookArguments) error

	IsGitHub() bool

	IsGitea() 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)

	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

	JenkinsWebHookPath(gitURL string, secret string) string

	Label() string
}

func CreateProvider

func CreateProvider(server *auth.AuthServer, user *auth.UserAuth) (GitProvider, error)

func NewBitbucketProvider

func NewBitbucketProvider(server *auth.AuthServer, user *auth.UserAuth) (GitProvider, error)

func NewGitHubProvider

func NewGitHubProvider(server *auth.AuthServer, user *auth.UserAuth) (GitProvider, error)

func NewGiteaProvider

func NewGiteaProvider(server *auth.AuthServer, user *auth.UserAuth) (GitProvider, error)

func NewGitlabProvider

func NewGitlabProvider(server *auth.AuthServer, user *auth.UserAuth) (GitProvider, error)

type GitPullRequest

type GitPullRequest struct {
	URL            string
	Owner          string
	Repo           string
	Number         *int
	Mergeable      *bool
	Merged         *bool
	State          *string
	StatusesURL    *string
	IssueURL       *string
	DiffURL        *string
	MergeCommitSHA *string
	ClosedAt       *time.Time
	MergedAt       *time.Time
	LastCommitSha  string
}

func (*GitPullRequest) IsClosed

func (pr *GitPullRequest) IsClosed() bool

IsClosed returns true if the PullRequest has been closed

type GitPullRequestArguments

type GitPullRequestArguments struct {
	Owner string
	Repo  string
	Title string
	Body  string
	Head  string
	Base  string
}

type GitRelease

type GitRelease struct {
	Name    string
	TagName string
	Body    string
	URL     string
	HTMLURL string
}

type GitRepoStatus

type GitRepoStatus struct {
	ID      int64
	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
}

func PickRepositories

func PickRepositories(provider GitProvider, owner string, message string, selectAll bool, filter string) ([]*GitRepository, error)

type GitRepositoryInfo

type GitRepositoryInfo struct {
	URL          string
	Scheme       string
	Host         string
	Organisation string
	Name         string
}

func GetGitInfo

func GetGitInfo(dir string) (*GitRepositoryInfo, error)

func ParseGitURL

func ParseGitURL(text string) (*GitRepositoryInfo, 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 (*GitRepositoryInfo) CreateProvider

func (i *GitRepositoryInfo) CreateProvider(authConfigSvc auth.AuthConfigService, gitKind string) (GitProvider, error)

func (*GitRepositoryInfo) CreateProviderForUser

func (i *GitRepositoryInfo) CreateProviderForUser(server *auth.AuthServer, user *auth.UserAuth, gitKind string) (GitProvider, error)

func (*GitRepositoryInfo) HostURL

func (i *GitRepositoryInfo) HostURL() string

HostURL returns the URL to the host

func (*GitRepositoryInfo) HostURLWithoutUser

func (i *GitRepositoryInfo) HostURLWithoutUser() string

func (*GitRepositoryInfo) HttpCloneURL

func (i *GitRepositoryInfo) HttpCloneURL() string

HttpCloneURL returns the HTTPS git URL this repository

func (*GitRepositoryInfo) HttpURL

func (i *GitRepositoryInfo) HttpURL() string

HttpURL returns the URL to browse this repository in a web browser

func (*GitRepositoryInfo) HttpsURL

func (i *GitRepositoryInfo) HttpsURL() string

HttpsURL returns the URL to browse this repository in a web browser

func (*GitRepositoryInfo) IsGitHub

func (i *GitRepositoryInfo) IsGitHub() bool

func (*GitRepositoryInfo) PickOrCreateProvider

func (i *GitRepositoryInfo) PickOrCreateProvider(authConfigSvc auth.AuthConfigService, message string, batchMode bool, gitKind string) (GitProvider, error)

func (*GitRepositoryInfo) PipelinePath

func (i *GitRepositoryInfo) 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 (*GitRepositoryInfo) PullRequestURL

func (i *GitRepositoryInfo) PullRequestURL(prName string) string

PullRequestURL returns the URL of a pull request of the given name/number

type GitRepositoryOptions

type GitRepositoryOptions struct {
	ServerURL string
	Username  string
	ApiToken  string
}

type GitUser

type GitUser struct {
	URL       string
	Login     string
	Name      string
	Email     string
	AvatarURL string
}

type GitWebHookArguments

type GitWebHookArguments struct {
	Owner  string
	Repo   string
	URL    string
	Secret string
}

type GiteaProvider

type GiteaProvider struct {
	Username string
	Client   *gitea.Client

	Server auth.AuthServer
	User   auth.UserAuth
}

func (*GiteaProvider) AddPRComment

func (p *GiteaProvider) AddPRComment(pr *GitPullRequest, comment string) error

func (*GiteaProvider) CreateIssue

func (p *GiteaProvider) CreateIssue(owner string, repo string, issue *GitIssue) (*GitIssue, error)

func (*GiteaProvider) CreateIssueComment

func (p *GiteaProvider) CreateIssueComment(owner string, repo string, number int, comment string) error

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) 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) GetIssue

func (p *GiteaProvider) GetIssue(org string, name string, number int) (*GitIssue, error)

func (*GiteaProvider) GetRepository

func (p *GiteaProvider) GetRepository(org string, name string) (*GitRepository, error)

func (*GiteaProvider) HasIssues

func (p *GiteaProvider) HasIssues() bool

func (*GiteaProvider) IsGitHub

func (p *GiteaProvider) IsGitHub() bool

func (*GiteaProvider) IsGitea

func (p *GiteaProvider) IsGitea() bool

func (*GiteaProvider) IssueURL

func (p *GiteaProvider) IssueURL(org string, name string, number int, isPull bool) string

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) ListOrganisations

func (p *GiteaProvider) ListOrganisations() ([]GitOrganisation, error)

func (*GiteaProvider) ListRepositories

func (p *GiteaProvider) ListRepositories(org string) ([]*GitRepository, 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 (p *GiteaProvider) SearchIssues(org string, name string, filter string) ([]*GitIssue, 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) 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
}

func (*GitlabProvider) AddPRComment

func (g *GitlabProvider) AddPRComment(pr *GitPullRequest, comment string) error

func (*GitlabProvider) CreateIssue

func (g *GitlabProvider) CreateIssue(owner string, repo string, issue *GitIssue) (*GitIssue, error)

func (*GitlabProvider) CreateIssueComment

func (g *GitlabProvider) CreateIssueComment(owner string, repo string, number int, comment string) error

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) DeleteRepository

func (g *GitlabProvider) DeleteRepository(org, name string) error

func (*GitlabProvider) ForkRepository

func (g *GitlabProvider) ForkRepository(originalOrg, name, destinationOrg string) (*GitRepository, error)

func (*GitlabProvider) GetIssue

func (g *GitlabProvider) GetIssue(org, repo string, number int) (*GitIssue, error)

func (*GitlabProvider) GetRepository

func (g *GitlabProvider) GetRepository(org, name string) (*GitRepository, error)

func (*GitlabProvider) HasIssues

func (g *GitlabProvider) HasIssues() bool

func (*GitlabProvider) IsBitbucket

func (g *GitlabProvider) IsBitbucket() bool

func (*GitlabProvider) IsGitHub

func (g *GitlabProvider) IsGitHub() bool

func (*GitlabProvider) IsGitea

func (g *GitlabProvider) IsGitea() bool

func (*GitlabProvider) IssueURL

func (p *GitlabProvider) IssueURL(org string, name string, number int, isPull bool) string

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) ListOrganisations

func (g *GitlabProvider) ListOrganisations() ([]GitOrganisation, error)

func (*GitlabProvider) ListRepositories

func (g *GitlabProvider) ListRepositories(org string) ([]*GitRepository, error)

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) 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) ValidateRepositoryName

func (g *GitlabProvider) ValidateRepositoryName(org, name string) error

type GroupAndCommitInfos

type GroupAndCommitInfos struct {
	// contains filtered or unexported fields
}

type OrganisationLister

type OrganisationLister interface {
	ListOrganisations() ([]GitOrganisation, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL