# README
Source Control Managers
This folder contains all Source Control Managers. They do all implement the VersionController
interface described below.
type VersionController interface {
// Should get repositories based on the scm configuration
GetRepositories(ctx context.Context) ([]scm.Repository, error)
// Creates a pull request. The repo parameter will always originate from the same package
CreatePullRequest(ctx context.Context, repo scm.Repository, prRepo scm.Repository, newPR scm.NewPullRequest) (scm.PullRequest, error)
// Gets the latest pull requests from repositories based on the scm configuration
GetPullRequests(ctx context.Context, branchName string) ([]scm.PullRequest, error)
// Merges a pull request, the pr parameter will always originate from the same package
MergePullRequest(ctx context.Context, pr scm.PullRequest) error
// Close a pull request, the pr parameter will always originate from the same package
ClosePullRequest(ctx context.Context, pr scm.PullRequest) error
// ForkRepository forks a repository. If newOwner is set, use it, otherwise fork to the current user
ForkRepository(ctx context.Context, repo scm.Repository, newOwner string) (scm.Repository, error)
}
Autocompletion
The version controller can also implement additional functions to support features such as shell-autocompletion. The following functions can be implemented independently and will automatically be used for tab completions when the user has activated it.
func GetAutocompleteOrganizations(ctx context.Context, search string) ([]string, error)
func GetAutocompleteUsers(ctx context.Context, search string) ([]string, error)
func GetAutocompleteRepositories(ctx context.Context, search string) ([]string, error)
# Packages
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Functions
Diff two slices and get the added and removed items compared to s1.
Map runs a function for each value in a slice and returns a slice of all function returns.
MergeTypeIntersection calculates the intersection of two merge type slices, The order of the first slice will be preserved.
ParseMergeType parses a merge type.
No description provided by the author
# Constants
All MergeTypes.
All MergeTypes.
All MergeTypes.
All MergeTypes.
All PullRequestStatuses.
All PullRequestStatuses.
All PullRequestStatuses.
All PullRequestStatuses.
All PullRequestStatuses.
All PullRequestStatuses.
# Structs
NewPullRequest is the data needed to create a new pull request.
# Interfaces
ChangePusher makes a commit through the API.
PullRequest represents a pull request.
Repository provides all the information needed about a git repository.
# Type aliases
MergeType is the way a pull request is "merged" into the base branch.
PullRequestStatus is the status of a pull request, including statuses of the last commit.