Documentation
¶
Index ¶
- Constants
- func BuildFailed(build BuildStatus) bool
- func ForgeBuildCommitSHA(buildStatus map[string]any) string
- func ForgeBuildKey(buildStatus map[string]any) string
- func ForgeBuildStatusPayload(timestamp, repositoryUUID, fullName string, buildStatus, actor map[string]any) map[string]any
- func ForgeEventKey(eventType string) string
- func ForgePullRequestPayload(eventType, timestamp, repositoryUUID, fullName string, ...) map[string]any
- func IsForgeBuildEvent(eventType string) bool
- func IsForgePullRequestEvent(eventType string) bool
- func IsValidFullCommitSHA(sha string) bool
- func NormalizeAccountID(value string) (string, error)
- func PullRequestMergeStrategy(method string) string
- func UseDirectory(directory Directory) func()
- type APIError
- type Bitbucket
- func (b *Bitbucket) Actions() []core.Action
- func (b *Bitbucket) Cleanup(ctx core.IntegrationCleanupContext) error
- func (b *Bitbucket) Configuration() []configuration.Field
- func (b *Bitbucket) Description() string
- func (b *Bitbucket) HandleHook(ctx core.IntegrationHookContext) error
- func (b *Bitbucket) HandleRequest(ctx core.HTTPRequestContext)
- func (b *Bitbucket) Hooks() []core.Hook
- func (b *Bitbucket) Icon() string
- func (b *Bitbucket) Instructions() string
- func (b *Bitbucket) Label() string
- func (b *Bitbucket) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)
- func (b *Bitbucket) Name() string
- func (b *Bitbucket) ResolveSecrets(ctx core.IntegrationSecretContext) (core.IntegrationSecrets, error)
- func (b *Bitbucket) Sync(ctx core.SyncContext) error
- func (b *Bitbucket) Triggers() []core.Trigger
- type BitbucketHookRequest
- type BitbucketHookResponse
- type BitbucketPullRequest
- type BitbucketWebhook
- type BitbucketWebhookHandler
- func (h *BitbucketWebhookHandler) Cleanup(ctx core.WebhookHandlerContext) error
- func (h *BitbucketWebhookHandler) CompareConfig(a, b any) (bool, error)
- func (h *BitbucketWebhookHandler) Merge(current, requested any) (any, bool, error)
- func (h *BitbucketWebhookHandler) Setup(ctx core.WebhookHandlerContext) (any, error)
- type Branch
- type BuildStatus
- type Client
- func (c *Client) CreatePullRequest(repository string, request CreatePullRequestRequest) (map[string]any, error)
- func (c *Client) CreatePullRequestComment(repository string, id int64, content string) (map[string]any, error)
- func (c *Client) CreatePullRequestCommentWithParent(repository string, id int64, content, parentID string) (map[string]any, error)
- func (c *Client) CreateWebhook(workspace, repoSlug, webhookURL, secret string, events []string) (*BitbucketHookResponse, error)
- func (c *Client) DeclinePullRequest(repository string, id int64) (*BitbucketPullRequest, error)
- func (c *Client) DeleteWebhook(workspace, repoSlug, webhookUID string) error
- func (c *Client) GetBranchHead(repository, branch string) (string, error)
- func (c *Client) GetCommitDate(repository, sha string) (time.Time, error)
- func (c *Client) GetMainBranch(repository string) (string, error)
- func (c *Client) GetMergeCommit(repository, sha string) (*MergeCommit, error)
- func (c *Client) GetPullRequest(repository string, id int64) (*BitbucketPullRequest, error)
- func (c *Client) GetPullRequestComment(repository string, pullRequestID, commentID int64) (map[string]any, error)
- func (c *Client) GetRepository(repository string) (*Repository, error)
- func (c *Client) GetWorkspace(workspaceSlug string) (*Workspace, error)
- func (c *Client) ListCommitStatuses(repository, sha string) ([]CommitStatus, error)
- func (c *Client) ListMergeabilityChecks(repository string, id int64) ([]MergeabilityCheck, error)
- func (c *Client) ListMergedPullRequests(repository string, from, until time.Time, maxPages int) ([]MergedBitbucketPullRequest, bool, error)
- func (c *Client) ListMergedPullRequestsThroughBoundary(repository string, from, until time.Time, maxPages, boundaryPages int) ([]MergedBitbucketPullRequest, bool, error)
- func (c *Client) ListPullRequests(repository string, opts PullRequestListOptions) ([]map[string]any, error)
- func (c *Client) ListRepositories(workspace string) ([]Repository, error)
- func (c *Client) MergePullRequest(repository string, id int64, strategy string) (*BitbucketPullRequest, error)
- func (c *Client) UpdatePullRequest(repository string, id int64, request UpdatePullRequestRequest) (map[string]any, error)
- func (c *Client) UpdateWebhook(workspace, repoSlug, webhookUID, webhookURL, secret string, events []string) (*BitbucketHookResponse, error)
- type CommitStatus
- type Configuration
- type CreatePullRequest
- func (CreatePullRequest) Cancel(ctx core.ExecutionContext) error
- func (CreatePullRequest) Cleanup(ctx core.SetupContext) error
- func (CreatePullRequest) Color() string
- func (c *CreatePullRequest) Configuration() []configuration.Field
- func (c *CreatePullRequest) Description() string
- func (c *CreatePullRequest) Documentation() string
- func (c *CreatePullRequest) ExampleOutput() map[string]any
- func (c *CreatePullRequest) Execute(ctx core.ExecutionContext) error
- func (CreatePullRequest) HandleHook(ctx core.ActionHookContext) error
- func (CreatePullRequest) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (CreatePullRequest) Hooks() []core.Hook
- func (CreatePullRequest) Icon() string
- func (c *CreatePullRequest) Label() string
- func (c *CreatePullRequest) Name() string
- func (c *CreatePullRequest) OutputChannels(configuration any) []core.OutputChannel
- func (c *CreatePullRequest) Setup(ctx core.SetupContext) error
- type CreatePullRequestComment
- func (CreatePullRequestComment) Cancel(ctx core.ExecutionContext) error
- func (CreatePullRequestComment) Cleanup(ctx core.SetupContext) error
- func (CreatePullRequestComment) Color() string
- func (c *CreatePullRequestComment) Configuration() []configuration.Field
- func (c *CreatePullRequestComment) Description() string
- func (c *CreatePullRequestComment) Documentation() string
- func (c *CreatePullRequestComment) ExampleOutput() map[string]any
- func (c *CreatePullRequestComment) Execute(ctx core.ExecutionContext) error
- func (CreatePullRequestComment) HandleHook(ctx core.ActionHookContext) error
- func (CreatePullRequestComment) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (CreatePullRequestComment) Hooks() []core.Hook
- func (CreatePullRequestComment) Icon() string
- func (c *CreatePullRequestComment) Label() string
- func (c *CreatePullRequestComment) Name() string
- func (c *CreatePullRequestComment) OutputChannels(configuration any) []core.OutputChannel
- func (c *CreatePullRequestComment) Setup(ctx core.SetupContext) error
- type CreatePullRequestCommentConfiguration
- type CreatePullRequestConfiguration
- type CreatePullRequestRequest
- type Directory
- type FindPullRequest
- func (FindPullRequest) Cancel(ctx core.ExecutionContext) error
- func (FindPullRequest) Cleanup(ctx core.SetupContext) error
- func (FindPullRequest) Color() string
- func (c *FindPullRequest) Configuration() []configuration.Field
- func (c *FindPullRequest) Description() string
- func (c *FindPullRequest) Documentation() string
- func (c *FindPullRequest) ExampleOutput() map[string]any
- func (c *FindPullRequest) Execute(ctx core.ExecutionContext) error
- func (FindPullRequest) HandleHook(ctx core.ActionHookContext) error
- func (FindPullRequest) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (FindPullRequest) Hooks() []core.Hook
- func (FindPullRequest) Icon() string
- func (c *FindPullRequest) Label() string
- func (c *FindPullRequest) Name() string
- func (c *FindPullRequest) OutputChannels(configuration any) []core.OutputChannel
- func (c *FindPullRequest) Setup(ctx core.SetupContext) error
- type FindPullRequestConfiguration
- type InstallationRef
- type MergeCommit
- type MergeabilityCheck
- type MergedBitbucketPullRequest
- type Metadata
- type NodeMetadata
- type OnPullRequest
- func (p *OnPullRequest) Cleanup(ctx core.TriggerContext) error
- func (p *OnPullRequest) Color() string
- func (p *OnPullRequest) Configuration() []configuration.Field
- func (p *OnPullRequest) Description() string
- func (p *OnPullRequest) Documentation() string
- func (t *OnPullRequest) ExampleData() map[string]any
- func (p *OnPullRequest) HandleHook(ctx core.TriggerHookContext) (map[string]any, error)
- func (p *OnPullRequest) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (p *OnPullRequest) Hooks() []core.Hook
- func (p *OnPullRequest) Icon() string
- func (p *OnPullRequest) Label() string
- func (p *OnPullRequest) Name() string
- func (p *OnPullRequest) Setup(ctx core.TriggerContext) error
- type OnPullRequestComment
- func (p *OnPullRequestComment) Cleanup(ctx core.TriggerContext) error
- func (p *OnPullRequestComment) Color() string
- func (p *OnPullRequestComment) Configuration() []configuration.Field
- func (p *OnPullRequestComment) Description() string
- func (p *OnPullRequestComment) Documentation() string
- func (t *OnPullRequestComment) ExampleData() map[string]any
- func (p *OnPullRequestComment) HandleHook(ctx core.TriggerHookContext) (map[string]any, error)
- func (p *OnPullRequestComment) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (p *OnPullRequestComment) Hooks() []core.Hook
- func (p *OnPullRequestComment) Icon() string
- func (p *OnPullRequestComment) Label() string
- func (p *OnPullRequestComment) Name() string
- func (p *OnPullRequestComment) Setup(ctx core.TriggerContext) error
- type OnPullRequestCommentConfiguration
- type OnPullRequestConfiguration
- type OnPush
- func (p *OnPush) Cleanup(ctx core.TriggerContext) error
- func (p *OnPush) Color() string
- func (p *OnPush) Configuration() []configuration.Field
- func (p *OnPush) Description() string
- func (p *OnPush) Documentation() string
- func (t *OnPush) ExampleData() map[string]any
- func (p *OnPush) HandleHook(ctx core.TriggerHookContext) (map[string]any, error)
- func (p *OnPush) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (p *OnPush) Hooks() []core.Hook
- func (p *OnPush) Icon() string
- func (p *OnPush) Label() string
- func (p *OnPush) Name() string
- func (p *OnPush) Setup(ctx core.TriggerContext) error
- type OnPushConfiguration
- type PullRequestListOptions
- type Repository
- type RepositoryLink
- type RepositoryMetadata
- type RepositoryResponse
- type UpdatePullRequest
- func (UpdatePullRequest) Cancel(ctx core.ExecutionContext) error
- func (UpdatePullRequest) Cleanup(ctx core.SetupContext) error
- func (UpdatePullRequest) Color() string
- func (c *UpdatePullRequest) Configuration() []configuration.Field
- func (c *UpdatePullRequest) Description() string
- func (c *UpdatePullRequest) Documentation() string
- func (c *UpdatePullRequest) ExampleOutput() map[string]any
- func (c *UpdatePullRequest) Execute(ctx core.ExecutionContext) error
- func (UpdatePullRequest) HandleHook(ctx core.ActionHookContext) error
- func (UpdatePullRequest) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (UpdatePullRequest) Hooks() []core.Hook
- func (UpdatePullRequest) Icon() string
- func (c *UpdatePullRequest) Label() string
- func (c *UpdatePullRequest) Name() string
- func (c *UpdatePullRequest) OutputChannels(configuration any) []core.OutputChannel
- func (c *UpdatePullRequest) Setup(ctx core.SetupContext) error
- type UpdatePullRequestConfiguration
- type UpdatePullRequestRequest
- type VisibleCatalog
- type VisibleRepository
- type WaitForBuilds
- func (c *WaitForBuilds) Cancel(ctx core.ExecutionContext) error
- func (c *WaitForBuilds) Cleanup(ctx core.SetupContext) error
- func (c *WaitForBuilds) Color() string
- func (c *WaitForBuilds) Configuration() []configuration.Field
- func (c *WaitForBuilds) Description() string
- func (c *WaitForBuilds) Documentation() string
- func (c *WaitForBuilds) ExampleOutput() map[string]any
- func (c *WaitForBuilds) Execute(ctx core.ExecutionContext) error
- func (c *WaitForBuilds) HandleHook(ctx core.ActionHookContext) error
- func (c *WaitForBuilds) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (c *WaitForBuilds) Hooks() []core.Hook
- func (c *WaitForBuilds) Icon() string
- func (c *WaitForBuilds) Label() string
- func (c *WaitForBuilds) Name() string
- func (c *WaitForBuilds) OutputChannels(configuration any) []core.OutputChannel
- func (c *WaitForBuilds) Setup(ctx core.SetupContext) error
- type WaitForBuildsConfiguration
- type WaitForBuildsMetadata
- type WaitForBuildsOutput
- type WebhookConfiguration
- type Workspace
- type WorkspaceMetadata
Constants ¶
const ( AuthTypeAPIToken = "apiToken" AuthTypeWorkspaceAccessToken = "workspaceAccessToken" AuthTypeRepositoryAccessToken = "repositoryAccessToken" AuthTypeForgeApp = "forgeApp" )
const ( FindPullRequestFoundChannel = "found" FindPullRequestNotFoundChannel = "notFound" )
const ( PullRequestStateOpen = "OPEN" PullRequestStateMerged = "MERGED" PullRequestStateDeclined = "DECLINED" )
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.
const ( CommitStatusSuccessful = "SUCCESSFUL" CommitStatusFailed = "FAILED" CommitStatusInProgress = "INPROGRESS" CommitStatusStopped = "STOPPED" )
Commit build states reported by Bitbucket commit statuses.
const APIBaseURL = "https://api.bitbucket.org/2.0"
const BuildStatusCompleted = waitBuildsStatusCompleted
BuildStatusCompleted is the terminal passing-adjacent build status.
const PayloadTypePullRequest = "bitbucket.pullRequest"
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 ¶
ForgeBuildCommitSHA extracts the full commit hash from a Forge buildStatus object.
func ForgeBuildKey ¶
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 ¶
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 ¶
IsForgeBuildEvent reports whether a Forge event carries a build status.
func IsForgePullRequestEvent ¶
IsForgePullRequestEvent reports whether a Forge event carries a pull request.
func IsValidFullCommitSHA ¶
IsValidFullCommitSHA reports whether a value is a 40-character hex commit SHA.
func NormalizeAccountID ¶
NormalizeAccountID accepts a Bitbucket UUID with or without braces.
func PullRequestMergeStrategy ¶
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 ¶
APIError carries the Bitbucket HTTP status with the response message so callers can distinguish conflicts and rate limits without parsing text.
type Bitbucket ¶
type Bitbucket struct{}
func (*Bitbucket) Configuration ¶
func (b *Bitbucket) Configuration() []configuration.Field
func (*Bitbucket) Description ¶
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) Instructions ¶
func (*Bitbucket) ListResources ¶
func (b *Bitbucket) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)
func (*Bitbucket) ResolveSecrets ¶
func (b *Bitbucket) ResolveSecrets(ctx core.IntegrationSecretContext) (core.IntegrationSecrets, error)
type BitbucketHookRequest ¶
type BitbucketHookResponse ¶
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 BitbucketWebhookHandler ¶
type BitbucketWebhookHandler struct{}
func (*BitbucketWebhookHandler) Cleanup ¶
func (h *BitbucketWebhookHandler) Cleanup(ctx core.WebhookHandlerContext) error
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 ¶
func (h *BitbucketWebhookHandler) Setup(ctx core.WebhookHandlerContext) (any, error)
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 (*Client) CreatePullRequestComment ¶
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 (*Client) GetBranchHead ¶
GetBranchHead returns the head commit SHA of a branch.
func (*Client) GetCommitDate ¶
GetCommitDate reads one commit's author date.
func (*Client) GetMainBranch ¶
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 (*Client) GetRepository ¶
func (c *Client) GetRepository(repository string) (*Repository, error)
func (*Client) GetWorkspace ¶
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 (*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 (*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 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) 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) 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) 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 (c *CreatePullRequestComment) Execute(ctx core.ExecutionContext) error
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) 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 ¶
func (c *CreatePullRequestComment) Setup(ctx core.SetupContext) error
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 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) 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) 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 InstallationRef ¶
InstallationRef identifies one Forge install whose system token can list repositories. The token itself stays with the caller.
type MergeCommit ¶
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 (p *OnPullRequest) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
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 (p *OnPullRequestComment) Cleanup(ctx core.TriggerContext) error
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 (p *OnPullRequestComment) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
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 ¶
func (p *OnPullRequestComment) Setup(ctx core.TriggerContext) error
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 OnPush ¶
type OnPush struct{}
func (*OnPush) Configuration ¶
func (p *OnPush) Configuration() []configuration.Field
func (*OnPush) Description ¶
func (*OnPush) Documentation ¶
func (*OnPush) ExampleData ¶
func (*OnPush) HandleHook ¶ added in v0.18.0
func (*OnPush) HandleWebhook ¶
func (p *OnPush) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
type OnPushConfiguration ¶
type OnPushConfiguration struct {
Repository string `json:"repository" mapstructure:"repository"`
Refs []configuration.Predicate `json:"refs" mapstructure:"refs"`
}
type PullRequestListOptions ¶
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 ¶
type RepositoryLink struct {
HTML struct {
Href string `json:"href" mapstructure:"href"`
} `json:"html" mapstructure:"html"`
}
type RepositoryMetadata ¶
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) 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) 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 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 (c *WaitForBuilds) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
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 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 WorkspaceMetadata ¶
Source Files
¶
- bitbucket.go
- client.go
- common.go
- create_pull_request.go
- create_pull_request_comment.go
- example.go
- find_pull_request.go
- forge_directory.go
- forge_event.go
- integration_secrets.go
- list_resources.go
- list_status_checks.go
- on_pull_request.go
- on_pull_request_comment.go
- on_push.go
- pull_request_client.go
- pull_request_common.go
- pull_request_event.go
- update_pull_request.go
- wait_for_builds.go
- webhook_handler.go