Documentation
¶
Index ¶
- func NewCollaboratorFetcher(baseURL string, token string, project string, repo string, ...) git.CollaboratorFetcher
- func NewPRCreator(baseURL string, token string, project string, repo string, ...) git.PRCreator
- func NewPRMerger(baseURL string, token string, project string, repo string, ...) git.PRMerger
- type CurrentUserFetcher
- type RemoteCoords
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCollaboratorFetcher ¶
func NewCollaboratorFetcher( baseURL string, token string, project string, repo string, defaultBranch string, currentUserFetcher CurrentUserFetcher, allowedReviewers []string, ) git.CollaboratorFetcher
NewCollaboratorFetcher creates a git.CollaboratorFetcher backed by the Bitbucket Server default-reviewers plugin. currentUserFetcher is called lazily to exclude the current user from results. If allowedReviewers is non-empty, it is returned directly without any HTTP calls.
func NewPRCreator ¶
func NewPRCreator( baseURL string, token string, project string, repo string, defaultBranch string, reviewerFetcher git.CollaboratorFetcher, ) git.PRCreator
NewPRCreator creates a git.PRCreator backed by the Bitbucket Server REST API. reviewerFetcher is called lazily at PR creation time to resolve the reviewer list.
func NewPRMerger ¶
func NewPRMerger( baseURL string, token string, project string, repo string, currentDateTimeGetter libtime.CurrentDateTimeGetter, ) git.PRMerger
NewPRMerger creates a git.PRMerger backed by the Bitbucket Server REST API.
Types ¶
type CurrentUserFetcher ¶
CurrentUserFetcher fetches the current authenticated Bitbucket user.
func NewCurrentUserFetcher ¶
func NewCurrentUserFetcher(baseURL, token string) CurrentUserFetcher
NewCurrentUserFetcher creates a CurrentUserFetcher for the given base URL and token.
type RemoteCoords ¶
type RemoteCoords struct {
// Project is the Bitbucket project key (uppercased, e.g. "BRO").
Project string
// Repo is the repository slug (lowercased, e.g. "sentinel").
Repo string
}
RemoteCoords holds the project key and repo slug parsed from a Bitbucket Server remote URL.
func ParseRemoteFromGit ¶
func ParseRemoteFromGit( ctx context.Context, runner subproc.Runner, remoteName string, ) (*RemoteCoords, error)
ParseRemoteFromGit reads the git remote URL for the given remote name and parses it. Uses `git remote get-url <remoteName>` to fetch the URL.
func ParseRemoteURL ¶
func ParseRemoteURL( ctx context.Context, remoteURL string, ) (*RemoteCoords, error)
ParseRemoteURL parses a Bitbucket Server git remote URL and returns project key and repo slug.
Supported formats:
- SSH: ssh://bitbucket.example.com:7999/bro/sentinel.git
- HTTPS: https://bitbucket.example.com/scm/bro/sentinel.git
The project key is uppercased and the repo slug is lowercased (matching Bitbucket Server conventions).