bitbucket

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthTypeAPIToken              = "apiToken"
	AuthTypeWorkspaceAccessToken  = "workspaceAccessToken"
	AuthTypeRepositoryAccessToken = "repositoryAccessToken"
	AuthTypeForgeApp              = "forgeApp"
)
View Source
const (
	FindPullRequestFoundChannel    = "found"
	FindPullRequestNotFoundChannel = "notFound"
)
View Source
const (
	PullRequestStateOpen     = "OPEN"
	PullRequestStateMerged   = "MERGED"
	PullRequestStateDeclined = "DECLINED"
)
View Source
const (
	MergeabilityCheckState      = "pullrequest_state_check"
	MergeabilityCheckPermission = "current_user_permission_check"
	MergeabilityCheckGit        = "git_mergeability_check"
	MergeabilityCheckStandard   = "standard_merge_check"
	MergeabilityCheckPreMerge   = "custom_pre_merge_check"
	MergeabilityCheckOnMerge    = "custom_on_merge_check"
	MergeabilityCheckQueue      = "merge_queue_check"
)

Mergeability check types reported by Bitbucket.

View Source
const (
	CommitStatusSuccessful = "SUCCESSFUL"
	CommitStatusFailed     = "FAILED"
	CommitStatusInProgress = "INPROGRESS"
	CommitStatusStopped    = "STOPPED"
)

Commit build states reported by Bitbucket commit statuses.

View Source
const APIBaseURL = "https://api.bitbucket.org/2.0"
View Source
const BuildStatusCompleted = waitBuildsStatusCompleted

BuildStatusCompleted is the terminal passing-adjacent build status.

View Source
const PayloadTypePullRequest = "bitbucket.pullRequest"
View Source
const (
	WaitForBuildsName = "bitbucket.waitForBuilds"
)

Variables

This section is empty.

Functions

func BuildFailed

func BuildFailed(build BuildStatus) bool

BuildFailed reports whether a normalized build failed its required signal.

func ForgeBuildCommitSHA

func ForgeBuildCommitSHA(buildStatus map[string]any) string

ForgeBuildCommitSHA extracts the full commit hash from a Forge buildStatus object.

func ForgeBuildKey

func ForgeBuildKey(buildStatus map[string]any) string

ForgeBuildKey extracts the build key from a Forge buildStatus object.

func ForgeBuildStatusPayload

func ForgeBuildStatusPayload(timestamp, repositoryUUID, fullName string, buildStatus, actor map[string]any) map[string]any

ForgeBuildStatusPayload projects Forge's buildStatus object into the repository commit_status webhook contract the waiter already handles. Repository identity comes from the matched subscription metadata, not the Forge payload, so events route to the configured repository.

func ForgeEventKey

func ForgeEventKey(eventType string) string

ForgeEventKey maps the PR lifecycle and build-status events available to Forge to repository webhook keys.

func ForgePullRequestPayload

func ForgePullRequestPayload(eventType, timestamp, repositoryUUID, fullName string, pullRequest, actor map[string]any) map[string]any

ForgePullRequestPayload projects Forge's event-time fields into the repository webhook contract.

func IsForgeBuildEvent

func IsForgeBuildEvent(eventType string) bool

IsForgeBuildEvent reports whether a Forge event carries a build status.

func IsForgePullRequestEvent

func IsForgePullRequestEvent(eventType string) bool

IsForgePullRequestEvent reports whether a Forge event carries a pull request.

func IsValidFullCommitSHA

func IsValidFullCommitSHA(sha string) bool

IsValidFullCommitSHA reports whether a value is a 40-character hex commit SHA.

func NormalizeAccountID

func NormalizeAccountID(value string) (string, error)

NormalizeAccountID accepts a Bitbucket UUID with or without braces.

func PullRequestMergeStrategy

func PullRequestMergeStrategy(method string) string

PullRequestMergeStrategy maps a merge method name to the Bitbucket merge strategy. Unknown methods fall back to a merge commit.

func UseDirectory

func UseDirectory(directory Directory) func()

UseDirectory points repository listing at another Bitbucket API. The returned function restores the previous directory.

Types

type APIError

type APIError struct {
	StatusCode int
	Message    string
}

APIError carries the Bitbucket HTTP status with the response message so callers can distinguish conflicts and rate limits without parsing text.

func (*APIError) Error

func (e *APIError) Error() string

type Bitbucket

type Bitbucket struct{}

func (*Bitbucket) Actions

func (b *Bitbucket) Actions() []core.Action

func (*Bitbucket) Cleanup

func (*Bitbucket) Configuration

func (b *Bitbucket) Configuration() []configuration.Field

func (*Bitbucket) Description

func (b *Bitbucket) Description() string

func (*Bitbucket) HandleHook added in v0.18.0

func (b *Bitbucket) HandleHook(ctx core.IntegrationHookContext) error

func (*Bitbucket) HandleRequest

func (b *Bitbucket) HandleRequest(ctx core.HTTPRequestContext)

func (*Bitbucket) Hooks added in v0.18.0

func (b *Bitbucket) Hooks() []core.Hook

func (*Bitbucket) Icon

func (b *Bitbucket) Icon() string

func (*Bitbucket) Instructions

func (b *Bitbucket) Instructions() string

func (*Bitbucket) Label

func (b *Bitbucket) Label() string

func (*Bitbucket) ListResources

func (b *Bitbucket) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)

func (*Bitbucket) Name

func (b *Bitbucket) Name() string

func (*Bitbucket) ResolveSecrets

func (*Bitbucket) Sync

func (b *Bitbucket) Sync(ctx core.SyncContext) error

func (*Bitbucket) Triggers

func (b *Bitbucket) Triggers() []core.Trigger

type BitbucketHookRequest

type BitbucketHookRequest struct {
	Description string   `json:"description"`
	URL         string   `json:"url"`
	Active      bool     `json:"active"`
	Secret      string   `json:"secret,omitempty"`
	Events      []string `json:"events"`
}

type BitbucketHookResponse

type BitbucketHookResponse struct {
	UUID   string `json:"uuid"`
	URL    string `json:"url"`
	Active bool   `json:"active"`
}

type BitbucketPullRequest

type BitbucketPullRequest struct {
	ID                  int64  `json:"id"`
	State               string `json:"state"`
	Draft               bool   `json:"draft"`
	Title               string `json:"title"`
	HTMLURL             string
	SourceRepository    string
	SourceHash          string
	SourceBr            string
	DestBranch          string
	DestMergeStrategies []string
	MergeCommit         string
}

BitbucketPullRequest is the merge-relevant subset of a pull request.

type BitbucketWebhook

type BitbucketWebhook struct {
	UUID               string `json:"uuid"`
	RepositoryUUID     string `json:"repositoryUUID,omitempty"`
	RepositoryFullName string `json:"repositoryFullName,omitempty"`
}

type BitbucketWebhookHandler

type BitbucketWebhookHandler struct{}

func (*BitbucketWebhookHandler) Cleanup

func (*BitbucketWebhookHandler) CompareConfig

func (h *BitbucketWebhookHandler) CompareConfig(a, b any) (bool, error)

func (*BitbucketWebhookHandler) Merge

func (h *BitbucketWebhookHandler) Merge(current, requested any) (any, bool, error)

func (*BitbucketWebhookHandler) Setup

type Branch

type Branch struct {
	Name string `json:"name" mapstructure:"name"`
}

type BuildStatus

type BuildStatus struct {
	Key         string `json:"key"`
	Name        string `json:"name"`
	Status      string `json:"status"`
	Conclusion  string `json:"conclusion,omitempty"`
	Description string `json:"description,omitempty"`
	DetailsURL  string `json:"detailsUrl,omitempty"`
}

BuildStatus is one observed Bitbucket build, normalized like a check.

func NormalizeBuildStatuses

func NormalizeBuildStatuses(statuses []CommitStatus) []BuildStatus

NormalizeBuildStatuses exposes build normalization for factory mergeability.

type Client

type Client struct {
	AuthType string
	Email    string
	Token    string
	HTTP     core.HTTPContext
}

func NewClient

func NewClient(authType string, httpContext core.HTTPContext, integration core.IntegrationContext) (*Client, error)

func (*Client) CreatePullRequest

func (c *Client) CreatePullRequest(repository string, request CreatePullRequestRequest) (map[string]any, error)

func (*Client) CreatePullRequestComment

func (c *Client) CreatePullRequestComment(repository string, id int64, content string) (map[string]any, error)

func (*Client) CreatePullRequestCommentWithParent

func (c *Client) CreatePullRequestCommentWithParent(repository string, id int64, content, parentID string) (map[string]any, error)

CreatePullRequestCommentWithParent posts a comment, or a threaded reply when parentID names an existing comment.

func (*Client) CreateWebhook

func (c *Client) CreateWebhook(workspace, repoSlug, webhookURL, secret string, events []string) (*BitbucketHookResponse, error)

func (*Client) DeclinePullRequest

func (c *Client) DeclinePullRequest(repository string, id int64) (*BitbucketPullRequest, error)

DeclinePullRequest declines one open pull request.

func (*Client) DeleteWebhook

func (c *Client) DeleteWebhook(workspace, repoSlug, webhookUID string) error

func (*Client) GetBranchHead

func (c *Client) GetBranchHead(repository, branch string) (string, error)

GetBranchHead returns the head commit SHA of a branch.

func (*Client) GetCommitDate

func (c *Client) GetCommitDate(repository, sha string) (time.Time, error)

GetCommitDate reads one commit's author date.

func (*Client) GetMainBranch

func (c *Client) GetMainBranch(repository string) (string, error)

GetMainBranch returns the main branch name of a "workspace/repo" repository.

func (*Client) GetMergeCommit

func (c *Client) GetMergeCommit(repository, sha string) (*MergeCommit, error)

GetMergeCommit reads one commit's date and message for merge attribution.

func (*Client) GetPullRequest

func (c *Client) GetPullRequest(repository string, id int64) (*BitbucketPullRequest, error)

GetPullRequest reads one pull request by number.

func (*Client) GetPullRequestComment

func (c *Client) GetPullRequestComment(repository string, pullRequestID, commentID int64) (map[string]any, error)

func (*Client) GetRepository

func (c *Client) GetRepository(repository string) (*Repository, error)

func (*Client) GetWorkspace

func (c *Client) GetWorkspace(workspaceSlug string) (*Workspace, error)

func (*Client) ListCommitStatuses

func (c *Client) ListCommitStatuses(repository, sha string) ([]CommitStatus, error)

ListCommitStatuses returns every build status on a commit, following pagination. An empty list is not an error; callers wait it out.

func (*Client) ListMergeabilityChecks

func (c *Client) ListMergeabilityChecks(repository string, id int64) ([]MergeabilityCheck, error)

ListMergeabilityChecks returns the mergeability checks Bitbucket performs for a pull request, following pagination. A 500 means configured custom or queue checks are unretrievable, so the real merge would fail the same way.

func (*Client) ListMergedPullRequests

func (c *Client) ListMergedPullRequests(repository string, from, until time.Time, maxPages int) ([]MergedBitbucketPullRequest, bool, error)

ListMergedPullRequests returns merged pull requests, newest first, stopping once updated_on predates from. A non-zero until excludes pulls updated at or after that instant, so a later read can continue older history without repeating the newest pages. At most maxPages pages are read; truncated reports whether the page cap cut the walk short.

func (*Client) ListMergedPullRequestsThroughBoundary

func (c *Client) ListMergedPullRequestsThroughBoundary(
	repository string,
	from, until time.Time,
	maxPages, boundaryPages int,
) ([]MergedBitbucketPullRequest, bool, error)

ListMergedPullRequestsThroughBoundary is the velocity history read. After maxPages, it keeps reading until the oldest updated_on is fully consumed, or until boundaryPages more pages are read. A truncated result then ends on an instant that was fully read. An instant the caps split is left out, so the next slice can read it instead of skipping the unread pages.

func (*Client) ListPullRequests

func (c *Client) ListPullRequests(repository string, opts PullRequestListOptions) ([]map[string]any, error)

func (*Client) ListRepositories

func (c *Client) ListRepositories(workspace string) ([]Repository, error)

func (*Client) MergePullRequest

func (c *Client) MergePullRequest(repository string, id int64, strategy string) (*BitbucketPullRequest, error)

MergePullRequest merges one open pull request with the given strategy. Bitbucket has no head precondition, so callers compare the source hash first. A push between that read and this call can still change the merged commit. Only a synchronous MERGED response counts as merged; a 202 task response returns errBitbucketMergeAsync.

func (*Client) UpdatePullRequest

func (c *Client) UpdatePullRequest(repository string, id int64, request UpdatePullRequestRequest) (map[string]any, error)

func (*Client) UpdateWebhook

func (c *Client) UpdateWebhook(workspace, repoSlug, webhookUID, webhookURL, secret string, events []string) (*BitbucketHookResponse, error)

UpdateWebhook replaces the events on an existing repository webhook.

type CommitStatus

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

CommitStatus is one Bitbucket build status on a commit.

type Configuration

type Configuration struct {
	Workspace  string  `json:"workspace"`
	Repository string  `json:"repository"`
	AuthType   string  `json:"authType"`
	Token      *string `json:"token"`
	Email      *string `json:"email"`
}

type CreatePullRequest

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

func (CreatePullRequest) Cancel

func (CreatePullRequest) Cancel(ctx core.ExecutionContext) error

func (CreatePullRequest) Cleanup

func (CreatePullRequest) Cleanup(ctx core.SetupContext) error

func (CreatePullRequest) Color

func (CreatePullRequest) Color() string

func (*CreatePullRequest) Configuration

func (c *CreatePullRequest) Configuration() []configuration.Field

func (*CreatePullRequest) Description

func (c *CreatePullRequest) Description() string

func (*CreatePullRequest) Documentation

func (c *CreatePullRequest) Documentation() string

func (*CreatePullRequest) ExampleOutput

func (c *CreatePullRequest) ExampleOutput() map[string]any

func (*CreatePullRequest) Execute

func (c *CreatePullRequest) Execute(ctx core.ExecutionContext) error

func (CreatePullRequest) HandleHook

func (CreatePullRequest) HandleHook(ctx core.ActionHookContext) error

func (CreatePullRequest) HandleWebhook

func (CreatePullRequest) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)

func (CreatePullRequest) Hooks

func (CreatePullRequest) Hooks() []core.Hook

func (CreatePullRequest) Icon

func (CreatePullRequest) Icon() string

func (*CreatePullRequest) Label

func (c *CreatePullRequest) Label() string

func (*CreatePullRequest) Name

func (c *CreatePullRequest) Name() string

func (*CreatePullRequest) OutputChannels

func (c *CreatePullRequest) OutputChannels(configuration any) []core.OutputChannel

func (*CreatePullRequest) Setup

func (c *CreatePullRequest) Setup(ctx core.SetupContext) error

type CreatePullRequestComment

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

func (CreatePullRequestComment) Cancel

func (CreatePullRequestComment) Cancel(ctx core.ExecutionContext) error

func (CreatePullRequestComment) Cleanup

func (CreatePullRequestComment) Cleanup(ctx core.SetupContext) error

func (CreatePullRequestComment) Color

func (CreatePullRequestComment) Color() string

func (*CreatePullRequestComment) Configuration

func (c *CreatePullRequestComment) Configuration() []configuration.Field

func (*CreatePullRequestComment) Description

func (c *CreatePullRequestComment) Description() string

func (*CreatePullRequestComment) Documentation

func (c *CreatePullRequestComment) Documentation() string

func (*CreatePullRequestComment) ExampleOutput

func (c *CreatePullRequestComment) ExampleOutput() map[string]any

func (*CreatePullRequestComment) Execute

func (CreatePullRequestComment) HandleHook

func (CreatePullRequestComment) HandleHook(ctx core.ActionHookContext) error

func (CreatePullRequestComment) HandleWebhook

func (CreatePullRequestComment) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)

func (CreatePullRequestComment) Hooks

func (CreatePullRequestComment) Hooks() []core.Hook

func (CreatePullRequestComment) Icon

func (CreatePullRequestComment) Icon() string

func (*CreatePullRequestComment) Label

func (c *CreatePullRequestComment) Label() string

func (*CreatePullRequestComment) Name

func (c *CreatePullRequestComment) Name() string

func (*CreatePullRequestComment) OutputChannels

func (c *CreatePullRequestComment) OutputChannels(configuration any) []core.OutputChannel

func (*CreatePullRequestComment) Setup

type CreatePullRequestCommentConfiguration

type CreatePullRequestCommentConfiguration struct {
	Repository      string `mapstructure:"repository" json:"repository"`
	PullNumber      string `mapstructure:"pullNumber" json:"pullNumber"`
	Body            string `mapstructure:"body" json:"body"`
	ParentCommentID string `mapstructure:"parentCommentId" json:"parentCommentId"`
}

type CreatePullRequestConfiguration

type CreatePullRequestConfiguration struct {
	Repository string `mapstructure:"repository" json:"repository"`
	Head       string `mapstructure:"head" json:"head"`
	Base       string `mapstructure:"base" json:"base"`
	Title      string `mapstructure:"title" json:"title"`
	Body       string `mapstructure:"body" json:"body"`
	Draft      bool   `mapstructure:"draft" json:"draft"`
}

type CreatePullRequestRequest

type CreatePullRequestRequest struct {
	Title       string
	Description string
	Source      string
	Destination string
	Draft       bool
}

type Directory

type Directory struct {
	BaseURL string
	HTTP    httpDoer
}

Directory calls the Bitbucket REST API with a Forge system token.

func CurrentDirectory

func CurrentDirectory() Directory

func (Directory) CatalogVisibleTo

func (d Directory) CatalogVisibleTo(
	ctx context.Context,
	accountUUID string,
	installations []InstallationRef,
	tokenFor func(installationID string) (string, error),
) (VisibleCatalog, error)

CatalogVisibleTo checks workspace access independently from repository access. Token and API failures are returned when no installation could be checked. A confirmed workspace stays in the catalog when its repository list fails.

func (Directory) RepositoriesVisibleTo

func (d Directory) RepositoriesVisibleTo(ctx context.Context, accountUUID string, installations []InstallationRef, tokenFor func(string) (string, error)) ([]VisibleRepository, error)

RepositoriesVisibleTo lists repositories the account can push to.

type FindPullRequest

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

func (FindPullRequest) Cancel

func (FindPullRequest) Cancel(ctx core.ExecutionContext) error

func (FindPullRequest) Cleanup

func (FindPullRequest) Cleanup(ctx core.SetupContext) error

func (FindPullRequest) Color

func (FindPullRequest) Color() string

func (*FindPullRequest) Configuration

func (c *FindPullRequest) Configuration() []configuration.Field

func (*FindPullRequest) Description

func (c *FindPullRequest) Description() string

func (*FindPullRequest) Documentation

func (c *FindPullRequest) Documentation() string

func (*FindPullRequest) ExampleOutput

func (c *FindPullRequest) ExampleOutput() map[string]any

func (*FindPullRequest) Execute

func (c *FindPullRequest) Execute(ctx core.ExecutionContext) error

func (FindPullRequest) HandleHook

func (FindPullRequest) HandleHook(ctx core.ActionHookContext) error

func (FindPullRequest) HandleWebhook

func (FindPullRequest) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)

func (FindPullRequest) Hooks

func (FindPullRequest) Hooks() []core.Hook

func (FindPullRequest) Icon

func (FindPullRequest) Icon() string

func (*FindPullRequest) Label

func (c *FindPullRequest) Label() string

func (*FindPullRequest) Name

func (c *FindPullRequest) Name() string

func (*FindPullRequest) OutputChannels

func (c *FindPullRequest) OutputChannels(configuration any) []core.OutputChannel

func (*FindPullRequest) Setup

func (c *FindPullRequest) Setup(ctx core.SetupContext) error

type FindPullRequestConfiguration

type FindPullRequestConfiguration struct {
	Repository string `mapstructure:"repository" json:"repository"`
	Head       string `mapstructure:"head" json:"head"`
	Base       string `mapstructure:"base" json:"base"`
	State      string `mapstructure:"state" json:"state"`
}

type InstallationRef

type InstallationRef struct {
	ID            string
	WorkspaceUUID string
	WorkspaceSlug string
}

InstallationRef identifies one Forge install whose system token can list repositories. The token itself stays with the caller.

type MergeCommit

type MergeCommit struct {
	Hash    string
	Date    time.Time
	Message string
}

MergeCommit carries the merge timestamp and message of one commit.

type MergeabilityCheck

type MergeabilityCheck struct {
	Type     string `json:"type"`
	Status   string `json:"status"`
	Required bool   `json:"required"`
	Blocking bool   `json:"blocking"`
}

MergeabilityCheck is one Bitbucket mergeability check on a pull request. Blocking tells whether the check currently prevents merging; a failed check does not necessarily block.

type MergedBitbucketPullRequest

type MergedBitbucketPullRequest struct {
	ID           int64
	State        string
	Title        string
	AuthorType   string
	AuthorUUID   string
	AuthorNick   string
	AuthorName   string
	AuthorAvatar string
	SourceHash   string
	MergeHash    string
	UpdatedOn    time.Time
}

MergedBitbucketPullRequest is the velocity-relevant subset of a merged pull request.

type Metadata

type Metadata struct {
	AuthType            string              `json:"authType" mapstructure:"authType"`
	Workspace           *WorkspaceMetadata  `json:"workspace,omitempty" mapstructure:"workspace,omitempty"`
	Repository          *RepositoryMetadata `json:"repository,omitempty" mapstructure:"repository,omitempty"`
	HostedApp           bool                `json:"hostedApp,omitempty" mapstructure:"hostedApp,omitempty"`
	ForgeInstallationID string              `json:"forgeInstallationId,omitempty" mapstructure:"forgeInstallationId,omitempty"`
}

type NodeMetadata

type NodeMetadata struct {
	Repository *RepositoryMetadata `json:"repository" mapstructure:"repository"`
}

type OnPullRequest

type OnPullRequest struct{}

func (*OnPullRequest) Cleanup

func (p *OnPullRequest) Cleanup(ctx core.TriggerContext) error

func (*OnPullRequest) Color

func (p *OnPullRequest) Color() string

func (*OnPullRequest) Configuration

func (p *OnPullRequest) Configuration() []configuration.Field

func (*OnPullRequest) Description

func (p *OnPullRequest) Description() string

func (*OnPullRequest) Documentation

func (p *OnPullRequest) Documentation() string

func (*OnPullRequest) ExampleData

func (t *OnPullRequest) ExampleData() map[string]any

func (*OnPullRequest) HandleHook

func (p *OnPullRequest) HandleHook(ctx core.TriggerHookContext) (map[string]any, error)

func (*OnPullRequest) HandleWebhook

func (*OnPullRequest) Hooks

func (p *OnPullRequest) Hooks() []core.Hook

func (*OnPullRequest) Icon

func (p *OnPullRequest) Icon() string

func (*OnPullRequest) Label

func (p *OnPullRequest) Label() string

func (*OnPullRequest) Name

func (p *OnPullRequest) Name() string

func (*OnPullRequest) Setup

func (p *OnPullRequest) Setup(ctx core.TriggerContext) error

type OnPullRequestComment

type OnPullRequestComment struct{}

func (*OnPullRequestComment) Cleanup

func (*OnPullRequestComment) Color

func (p *OnPullRequestComment) Color() string

func (*OnPullRequestComment) Configuration

func (p *OnPullRequestComment) Configuration() []configuration.Field

func (*OnPullRequestComment) Description

func (p *OnPullRequestComment) Description() string

func (*OnPullRequestComment) Documentation

func (p *OnPullRequestComment) Documentation() string

func (*OnPullRequestComment) ExampleData

func (t *OnPullRequestComment) ExampleData() map[string]any

func (*OnPullRequestComment) HandleHook

func (p *OnPullRequestComment) HandleHook(ctx core.TriggerHookContext) (map[string]any, error)

func (*OnPullRequestComment) HandleWebhook

func (*OnPullRequestComment) Hooks

func (p *OnPullRequestComment) Hooks() []core.Hook

func (*OnPullRequestComment) Icon

func (p *OnPullRequestComment) Icon() string

func (*OnPullRequestComment) Label

func (p *OnPullRequestComment) Label() string

func (*OnPullRequestComment) Name

func (p *OnPullRequestComment) Name() string

func (*OnPullRequestComment) Setup

type OnPullRequestCommentConfiguration

type OnPullRequestCommentConfiguration struct {
	Repository              string   `json:"repository" mapstructure:"repository"`
	ContentFilter           string   `json:"contentFilter" mapstructure:"contentFilter"`
	AllowedBots             []string `json:"allowedBots" mapstructure:"allowedBots"`
	IgnoreBots              bool     `json:"ignoreBots" mapstructure:"ignoreBots"`
	AddressAllBots          bool     `json:"addressAllBots" mapstructure:"addressAllBots"`
	OnlyFactoryPullRequests bool     `json:"onlyFactoryPullRequests" mapstructure:"onlyFactoryPullRequests"`
}

type OnPullRequestConfiguration

type OnPullRequestConfiguration struct {
	Repository              string   `json:"repository" mapstructure:"repository"`
	Actions                 []string `json:"actions" mapstructure:"actions"`
	OnlyFactoryPullRequests bool     `json:"onlyFactoryPullRequests" mapstructure:"onlyFactoryPullRequests"`
}

type OnPush

type OnPush struct{}

func (*OnPush) Cleanup

func (p *OnPush) Cleanup(ctx core.TriggerContext) error

func (*OnPush) Color

func (p *OnPush) Color() string

func (*OnPush) Configuration

func (p *OnPush) Configuration() []configuration.Field

func (*OnPush) Description

func (p *OnPush) Description() string

func (*OnPush) Documentation

func (p *OnPush) Documentation() string

func (*OnPush) ExampleData

func (t *OnPush) ExampleData() map[string]any

func (*OnPush) HandleHook added in v0.18.0

func (p *OnPush) HandleHook(ctx core.TriggerHookContext) (map[string]any, error)

func (*OnPush) HandleWebhook

func (p *OnPush) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)

func (*OnPush) Hooks added in v0.18.0

func (p *OnPush) Hooks() []core.Hook

func (*OnPush) Icon

func (p *OnPush) Icon() string

func (*OnPush) Label

func (p *OnPush) Label() string

func (*OnPush) Name

func (p *OnPush) Name() string

func (*OnPush) Setup

func (p *OnPush) Setup(ctx core.TriggerContext) error

type OnPushConfiguration

type OnPushConfiguration struct {
	Repository string                    `json:"repository" mapstructure:"repository"`
	Refs       []configuration.Predicate `json:"refs" mapstructure:"refs"`
}

type PullRequestListOptions

type PullRequestListOptions struct {
	SourceBranch      string
	DestinationBranch string
	States            []string
	Sort              string
	Pagelen           int
}

type Repository

type Repository struct {
	UUID       string         `json:"uuid" mapstructure:"uuid"`
	Name       string         `json:"name" mapstructure:"name"`
	FullName   string         `json:"full_name" mapstructure:"full_name"`
	Slug       string         `json:"slug" mapstructure:"slug"`
	Mainbranch *Branch        `json:"mainbranch,omitempty" mapstructure:"mainbranch,omitempty"`
	Workspace  *Workspace     `json:"workspace,omitempty" mapstructure:"workspace,omitempty"`
	Links      RepositoryLink `json:"links" mapstructure:"links"`
}
type RepositoryLink struct {
	HTML struct {
		Href string `json:"href" mapstructure:"href"`
	} `json:"html" mapstructure:"html"`
}

type RepositoryMetadata

type RepositoryMetadata struct {
	UUID     string `json:"uuid" mapstructure:"uuid"`
	Name     string `json:"name" mapstructure:"name"`
	FullName string `json:"full_name" mapstructure:"full_name"`
	Slug     string `json:"slug" mapstructure:"slug"`
}

type RepositoryResponse

type RepositoryResponse struct {
	Values []Repository `json:"values"`
	Next   string       `json:"next"`
}

type UpdatePullRequest

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

func (UpdatePullRequest) Cancel

func (UpdatePullRequest) Cancel(ctx core.ExecutionContext) error

func (UpdatePullRequest) Cleanup

func (UpdatePullRequest) Cleanup(ctx core.SetupContext) error

func (UpdatePullRequest) Color

func (UpdatePullRequest) Color() string

func (*UpdatePullRequest) Configuration

func (c *UpdatePullRequest) Configuration() []configuration.Field

func (*UpdatePullRequest) Description

func (c *UpdatePullRequest) Description() string

func (*UpdatePullRequest) Documentation

func (c *UpdatePullRequest) Documentation() string

func (*UpdatePullRequest) ExampleOutput

func (c *UpdatePullRequest) ExampleOutput() map[string]any

func (*UpdatePullRequest) Execute

func (c *UpdatePullRequest) Execute(ctx core.ExecutionContext) error

func (UpdatePullRequest) HandleHook

func (UpdatePullRequest) HandleHook(ctx core.ActionHookContext) error

func (UpdatePullRequest) HandleWebhook

func (UpdatePullRequest) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)

func (UpdatePullRequest) Hooks

func (UpdatePullRequest) Hooks() []core.Hook

func (UpdatePullRequest) Icon

func (UpdatePullRequest) Icon() string

func (*UpdatePullRequest) Label

func (c *UpdatePullRequest) Label() string

func (*UpdatePullRequest) Name

func (c *UpdatePullRequest) Name() string

func (*UpdatePullRequest) OutputChannels

func (c *UpdatePullRequest) OutputChannels(configuration any) []core.OutputChannel

func (*UpdatePullRequest) Setup

func (c *UpdatePullRequest) Setup(ctx core.SetupContext) error

type UpdatePullRequestConfiguration

type UpdatePullRequestConfiguration struct {
	Repository string `mapstructure:"repository" json:"repository"`
	PullNumber string `mapstructure:"pullNumber" json:"pullNumber"`
	Title      string `mapstructure:"title" json:"title"`
	Body       string `mapstructure:"body" json:"body"`
}

type UpdatePullRequestRequest

type UpdatePullRequestRequest struct {
	Title       string
	Description string
}

type VisibleCatalog

type VisibleCatalog struct {
	Workspaces   []InstallationRef
	Repositories []VisibleRepository
}

VisibleCatalog separates installed workspaces from writable repositories.

type VisibleRepository

type VisibleRepository struct {
	InstallationID string
	WorkspaceSlug  string
	FullName       string
	UUID           string
	DefaultBranch  string
	Private        bool
}

VisibleRepository is a Bitbucket repository the linked account can use.

type WaitForBuilds

type WaitForBuilds struct{}

func (*WaitForBuilds) Cancel

func (c *WaitForBuilds) Cancel(ctx core.ExecutionContext) error

func (*WaitForBuilds) Cleanup

func (c *WaitForBuilds) Cleanup(ctx core.SetupContext) error

func (*WaitForBuilds) Color

func (c *WaitForBuilds) Color() string

func (*WaitForBuilds) Configuration

func (c *WaitForBuilds) Configuration() []configuration.Field

func (*WaitForBuilds) Description

func (c *WaitForBuilds) Description() string

func (*WaitForBuilds) Documentation

func (c *WaitForBuilds) Documentation() string

func (*WaitForBuilds) ExampleOutput

func (c *WaitForBuilds) ExampleOutput() map[string]any

func (*WaitForBuilds) Execute

func (c *WaitForBuilds) Execute(ctx core.ExecutionContext) error

func (*WaitForBuilds) HandleHook

func (c *WaitForBuilds) HandleHook(ctx core.ActionHookContext) error

func (*WaitForBuilds) HandleWebhook

func (*WaitForBuilds) Hooks

func (c *WaitForBuilds) Hooks() []core.Hook

func (*WaitForBuilds) Icon

func (c *WaitForBuilds) Icon() string

func (*WaitForBuilds) Label

func (c *WaitForBuilds) Label() string

func (*WaitForBuilds) Name

func (c *WaitForBuilds) Name() string

func (*WaitForBuilds) OutputChannels

func (c *WaitForBuilds) OutputChannels(configuration any) []core.OutputChannel

func (*WaitForBuilds) Setup

func (c *WaitForBuilds) Setup(ctx core.SetupContext) error

type WaitForBuildsConfiguration

type WaitForBuildsConfiguration struct {
	Repository     string   `json:"repository" mapstructure:"repository"`
	Ref            string   `json:"ref" mapstructure:"ref"`
	BuildKeys      []string `json:"buildKeys" mapstructure:"buildKeys"`
	TimeoutSeconds *int     `json:"timeoutSeconds" mapstructure:"timeoutSeconds"`
}

type WaitForBuildsMetadata

type WaitForBuildsMetadata struct {
	Repository     string        `json:"repository" mapstructure:"repository"`
	SHA            string        `json:"sha" mapstructure:"sha"`
	StartedAt      time.Time     `json:"startedAt" mapstructure:"startedAt"`
	LastChangeAt   time.Time     `json:"lastChangeAt" mapstructure:"lastChangeAt"`
	TimeoutAt      time.Time     `json:"timeoutAt" mapstructure:"timeoutAt"`
	CompletedAt    *time.Time    `json:"completedAt,omitempty" mapstructure:"completedAt,omitempty"`
	Fingerprint    string        `json:"fingerprint" mapstructure:"fingerprint"`
	Outcome        string        `json:"outcome" mapstructure:"outcome"`
	Builds         []BuildStatus `json:"builds" mapstructure:"builds"`
	SelectedBuilds []BuildStatus `json:"selectedBuilds" mapstructure:"selectedBuilds"`
	FailedBuilds   []BuildStatus `json:"failedBuilds" mapstructure:"failedBuilds"`
}

type WaitForBuildsOutput

type WaitForBuildsOutput struct {
	Repository     string        `json:"repository"`
	SHA            string        `json:"sha"`
	Builds         []BuildStatus `json:"builds"`
	SelectedBuilds []BuildStatus `json:"selectedBuilds"`
	FailedBuilds   []BuildStatus `json:"failedBuilds"`
	StartedAt      time.Time     `json:"startedAt"`
	CompletedAt    time.Time     `json:"completedAt"`
}

type WebhookConfiguration

type WebhookConfiguration struct {
	EventTypes     []string `json:"eventTypes"`
	RepositorySlug string   `json:"repositorySlug"`
}

type Workspace

type Workspace struct {
	UUID string `json:"uuid" mapstructure:"uuid"`
	Name string `json:"name" mapstructure:"name"`
	Slug string `json:"slug" mapstructure:"slug"`
}

type WorkspaceMetadata

type WorkspaceMetadata struct {
	UUID string `json:"uuid" mapstructure:"uuid"`
	Name string `json:"name" mapstructure:"name"`
	Slug string `json:"slug" mapstructure:"slug"`
}

Jump to

Keyboard shortcuts

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