Documentation ¶
Index ¶
- Constants
- func CleanMarkdownComments(body string) string
- func FormatResponse(to, message, reason string) string
- func FormatResponseRaw(body, bodyURL, login, reply string) string
- func RegisterGitCommentPlugin(name string, builder GitCommentPluginBuilder)
- func RegisterGitPRPlugin(name string, builder GitPRPluginBuilder)
- type ClientSets
- type Configuration
- type GitBranch
- type GitCheckConclusion
- type GitCheckStatus
- type GitComment
- type GitCommentEvent
- type GitCommentEventAction
- type GitCommentPlugin
- type GitCommentPluginBuilder
- type GitCommit
- type GitCommitCheck
- type GitCommitFile
- type GitCommitStatus
- type GitIssue
- type GitIssueClient
- type GitIssueComment
- type GitIssueCommentEvent
- type GitMergeableState
- type GitPRClient
- type GitPREvent
- type GitPREventAction
- type GitPRPlugin
- type GitPRPluginBuilder
- type GitPullRequest
- type GitPullRequestSearchResult
- type GitPullRequestState
- type GitRepo
- type GitRepoClient
- type GitSearchClient
- type GitStatusState
- type GitUser
- type Label
- type LoggerClient
- type OwnersClient
- type OwnersConfiguration
- type Plugin
- type PluginConfigClient
- type PluginConfiguration
Constants ¶
const AboutThisBotWithoutCommands = "" /* 299-byte string literal not displayed */
AboutThisBotWithoutCommands contains the message that explains how to interact with the bot.
Variables ¶
This section is empty.
Functions ¶
func CleanMarkdownComments ¶
func FormatResponse ¶
FormatResponse nicely formats a response to a generic reason.
func FormatResponseRaw ¶
FormatResponseRaw nicely formats a response for one does not have an issue comment
func RegisterGitCommentPlugin ¶
func RegisterGitCommentPlugin(name string, builder GitCommentPluginBuilder)
func RegisterGitPRPlugin ¶
func RegisterGitPRPlugin(name string, builder GitPRPluginBuilder)
Types ¶
type ClientSets ¶
type ClientSets struct { GitIssueClient GitPRClient GitRepoClient GitSearchClient PluginConfigClient OwnersClient LoggerClient }
type Configuration ¶
type Configuration struct { Owner string `json:"owner"` Repo string `json:"repo"` Plugins []PluginConfiguration `json:"plugins"` }
Config
plugins: label: - --known-values=aaa,bbb,ccc
type GitCheckConclusion ¶
type GitCheckConclusion = string
const ( GitCheckConclusionStateActionRequired GitCheckConclusion = "ACTION_REQUIRED" // The check suite or run requires action. GitCheckConclusionStateCancelled GitCheckConclusion = "CANCELLED" // The check suite or run has been cancelled. GitCheckConclusionStateFailure GitCheckConclusion = "FAILURE" // The check suite or run has failed. GitCheckConclusionStateNeutral GitCheckConclusion = "NEUTRAL" // The check suite or run was neutral. GitCheckConclusionStateSuccess GitCheckConclusion = "SUCCESS" // The check suite or run has succeeded. GitCheckConclusionStateSkipped GitCheckConclusion = "SKIPPED" // The check suite or run was skipped. GitCheckConclusionStateStale GitCheckConclusion = "STALE" // The check suite or run was marked stale by GitHub. Only GitHub can use this conclusion. GitCheckConclusionStateTimedOut GitCheckConclusion = "TIMED_OUT" // The check suite or run has timed out. )
The possible states for a check suite or run conclusion.
type GitCheckStatus ¶
type GitCheckStatus = string
const ( GitCheckStatusCompleted GitCheckStatus = "COMPLETED" // The check run has been completed. GitCheckStatusInProgress GitCheckStatus = "IN_PROGRESS" // The check run is in progress. GitCheckStatusQueued GitCheckStatus = "QUEUED" // The check run has been queued. )
The possible states of a check run in a status rollup.
type GitComment ¶
type GitCommentEvent ¶
type GitCommentEvent struct { GitComment Action GitCommentEventAction Repo GitRepo }
GitCommentEvent is a fake event type that is instantiated for any git event that contains comment like content. The specific events that are also handled as GenericCommentEvents are: - issue_comment events - pull_request_review events - pull_request_review_comment events - pull_request events with action in ["opened", "edited"] - issue events with action in ["opened", "edited"]
Issue and PR "closed" events are not coerced to the "deleted" Action and do not trigger a GenericCommentEvent because these events don't actually remove the comment content from GH.
type GitCommentEventAction ¶
type GitCommentEventAction string
GitCommentEventAction coerces multiple actions into its generic equivalent.
const ( // GitCommentActionCreated means something was created/opened/submitted GitCommentActionCreated GitCommentEventAction = "created" // "opened", "submitted" // GitCommentActionEdited means something was edited. GitCommentActionEdited GitCommentEventAction = "edited" // GitCommentActionDeleted means something was deleted/dismissed. GitCommentActionDeleted GitCommentEventAction = "deleted" // "dismissed" )
Comments indicate values that are coerced to the specified value.
type GitCommentPlugin ¶
type GitCommentPlugin interface { Plugin Do(context.Context, GitCommentEvent) error }
func GetGitCommentPlugin ¶
func GetGitCommentPlugin(name string, clientSets ClientSets, args ...string) GitCommentPlugin
type GitCommentPluginBuilder ¶
type GitCommentPluginBuilder func(ClientSets) GitCommentPlugin
GitComment plugin
type GitCommit ¶
type GitCommit struct { Sha string Statuses []GitCommitStatus Checks []GitCommitCheck }
type GitCommitCheck ¶
type GitCommitCheck struct { Name string Status GitCheckStatus Conclusion GitCheckConclusion }
type GitCommitFile ¶
type GitCommitFile struct {
Path string
}
type GitCommitStatus ¶
type GitCommitStatus struct { Context string State GitStatusState TargetURL string Description string }
type GitIssueClient ¶
type GitIssueCommentEvent ¶
type GitIssueCommentEvent struct { GitIssueComment Action GitCommentEventAction Issue GitIssue Repo GitRepo }
type GitMergeableState ¶
type GitMergeableState = string
const ( GitMergeableStateMergeable GitMergeableState = "MERGEABLE" // The pull request can be merged. GitMergeableStateConflicting GitMergeableState = "CONFLICTING" // The pull request cannot be merged due to merge conflicts. GitMergeableStateUnknown GitMergeableState = "UNKNOWN" // The mergeability of the pull request is still being calculated. )
Whether or not a PullRequest can be merged.
type GitPRClient ¶
type GitPREvent ¶
type GitPREvent struct { GitPullRequest Action GitPREventAction Repo GitRepo }
type GitPREventAction ¶
type GitPREventAction string
GitPREventAction coerces multiple actions into its generic equivalent.
const ( // GitPRActionCreated means something was created/opened/submitted GitPRActionCreated GitPREventAction = "created" // "opened", "submitted" // GitPRActionEdited means something was edited. GitPRActionEdited GitPREventAction = "edited" // v means something was deleted/dismissed. GitPRActionDeleted GitPREventAction = "deleted" // "dismissed" )
type GitPRPlugin ¶
type GitPRPlugin interface { Plugin Do(context.Context, GitPREvent) error }
func GetGitPRPlugin ¶
func GetGitPRPlugin(name string, clientSets ClientSets, args ...string) GitPRPlugin
type GitPullRequest ¶
type GitPullRequestSearchResult ¶
type GitPullRequestSearchResult struct { GitPullRequest Commits []GitCommit }
type GitPullRequestState ¶
type GitPullRequestState = string
const ( PullRequestStateOpen GitPullRequestState = "OPEN" PullRequestStateClosed GitPullRequestState = "CLOSED" PullRequestStateMerged GitPullRequestState = "MERGED" )
type GitRepoClient ¶
type GitSearchClient ¶
type GitStatusState ¶
type GitStatusState = string
const ( GitStatusStateExpected GitStatusState = "EXPECTED" // Status is expected. GitStatusStateError GitStatusState = "ERROR" // Status is errored. GitStatusStateFailure GitStatusState = "FAILURE" // Status is failing. GitStatusStatePending GitStatusState = "PENDING" // Status is pending. GitStatusStateSuccess GitStatusState = "SUCCESS" // Status is successful. )
type LoggerClient ¶
type OwnersClient ¶
type OwnersClient interface {
GetOwners(owner, repo, file string) (OwnersConfiguration, error)
}
type OwnersConfiguration ¶
type PluginConfigClient ¶
type PluginConfigClient interface {
GetConfig(owner, repo string) (Configuration, error)
}