bitbucket

package
v1.55.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClientFromEnv

func NewClientFromEnv(env []string) (*Client, error)

func (*Client) CreatePR

func (c *Client) CreatePR(ctx context.Context, repo RepoRef, sourceBranch, destBranch, title, body string) (*PullRequest, error)

func (*Client) FindOpenPRBySourceBranch

func (c *Client) FindOpenPRBySourceBranch(ctx context.Context, repo RepoRef, branch, destBranch string) (*PullRequest, error)

func (*Client) GetPR

func (c *Client) GetPR(ctx context.Context, repo RepoRef, prID int) (*PullRequest, error)

func (*Client) GetStepLog

func (c *Client) GetStepLog(ctx context.Context, repo RepoRef, pipelineUUID, stepUUID string) (string, error)

func (*Client) ListPRStatuses

func (c *Client) ListPRStatuses(ctx context.Context, repo RepoRef, prID int) ([]CommitStatus, error)

func (*Client) ListPipelineSteps

func (c *Client) ListPipelineSteps(ctx context.Context, repo RepoRef, pipelineUUID string) ([]PipelineStep, error)

func (*Client) ListPipelinesByCommit

func (c *Client) ListPipelinesByCommit(ctx context.Context, repo RepoRef, commitSHA string) ([]Pipeline, error)

func (*Client) UpdatePR

func (c *Client) UpdatePR(ctx context.Context, repo RepoRef, prID int, title, body string) (*PullRequest, error)

type CommitStatus

type CommitStatus struct {
	Name        string `json:"name"`
	Key         string `json:"key"`
	State       string `json:"state"`
	Description string `json:"description"`
	URL         string `json:"url"`
}

func LatestStatuses

func LatestStatuses(statuses []CommitStatus) []CommitStatus

LatestStatuses keeps only the newest status per unique key/name. Exported because legacy step code still calls it by name during the migration.

type Host

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

Host implements scm.Host for Bitbucket using the REST API client.

func NewHost

func NewHost(client *Client, repo RepoRef) *Host

NewHost builds a Host from an API client and a parsed repository reference.

func (*Host) Available

func (h *Host) Available(_ context.Context) error

func (*Host) Capabilities

func (h *Host) Capabilities() scm.Capabilities

Capabilities reports Bitbucket's feature matrix. Bitbucket's REST API does not expose a reliable merge-conflict probe, so MergeableState is off.

func (*Host) CreatePR

func (h *Host) CreatePR(ctx context.Context, branch, base string, content scm.PRContent) (*scm.PR, error)

func (*Host) FetchFailedCheckLogs

func (h *Host) FetchFailedCheckLogs(ctx context.Context, pr *scm.PR, _ string, headSHA string, failingNames []string) (string, error)

func (*Host) FindPR

func (h *Host) FindPR(ctx context.Context, branch, base string) (*scm.PR, error)

func (*Host) GetChecks

func (h *Host) GetChecks(ctx context.Context, pr *scm.PR) ([]scm.Check, error)

func (*Host) GetMergeableState

func (h *Host) GetMergeableState(_ context.Context, _ *scm.PR) (scm.MergeableState, error)

func (*Host) GetPRState

func (h *Host) GetPRState(ctx context.Context, pr *scm.PR) (scm.PRState, error)

func (*Host) Provider

func (h *Host) Provider() scm.Provider

func (*Host) UpdatePR

func (h *Host) UpdatePR(ctx context.Context, pr *scm.PR, content scm.PRContent) (*scm.PR, error)

type Pipeline

type Pipeline struct {
	UUID string `json:"uuid"`
}

type PipelineStep

type PipelineStep struct {
	UUID  string `json:"uuid"`
	State struct {
		Name   string `json:"name"`
		Result struct {
			Name string `json:"name"`
		} `json:"result"`
	} `json:"state"`
}

type PullRequest

type PullRequest struct {
	ID               int
	URL              string
	State            string
	SourceCommitHash string
}

type RepoRef

type RepoRef struct {
	Workspace string
	RepoSlug  string
}

func ParseRepoRef

func ParseRepoRef(raw string) (RepoRef, error)

Jump to

Keyboard shortcuts

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