Documentation
¶
Index ¶
- Constants
- func IsBuiltInCommand(command string) bool
- type CommandHandler
- type CommentedError
- type PRHandler
- func (h *PRHandler) CheckPRStatus(expectedState string) error
- func (h *PRHandler) ExecuteCommand(command string, args []string) error
- func (h *PRHandler) ExposedDetermineMergeMethod(args []string) string
- func (h *PRHandler) ExposedSelectAutoMergeMethod() string
- func (h *PRHandler) ExposedValidateRebaseMerge() error
- func (h *PRHandler) GetCommentsWithCache() ([]git.Comment, error)
- func (h *PRHandler) GetLGTMVotes(requiredPerms []string, debugMode bool, ignoreUserRemove ...string) (int, map[string]string, error)
- func (h *PRHandler) HandleAssign(users []string) error
- func (h *PRHandler) HandleBatch(args []string) error
- func (h *PRHandler) HandleCheck(args []string) error
- func (h *PRHandler) HandleCheckbox(args []string) error
- func (h *PRHandler) HandleCheckboxIssue(args []string) error
- func (h *PRHandler) HandleCherrypick(args []string) error
- func (h *PRHandler) HandleClose(args []string) error
- func (h *PRHandler) HandleHelp(_ []string) error
- func (h *PRHandler) HandleLGTM(_ []string) error
- func (h *PRHandler) HandleLabel(labels []string) error
- func (h *PRHandler) HandleMerge(args []string) error
- func (h *PRHandler) HandlePostMergeCherryPick() error
- func (h *PRHandler) HandleRebase(_ []string) error
- func (h *PRHandler) HandleRemoveLGTM(_ []string) error
- func (h *PRHandler) HandleRetest(args []string) error
- func (h *PRHandler) HandleUnassign(users []string) error
- func (h *PRHandler) HandleUnlabel(labels []string) error
- func (h *PRHandler) PostComment(message string) error
- type RemovalResult
- type SubCommand
Constants ¶
const (
// PostMergeCherryPickCommand is the built-in command for post-merge cherry-pick operations
PostMergeCherryPickCommand = "__post-merge-cherry-pick"
)
Built-in command constants
Variables ¶
This section is empty.
Functions ¶
func IsBuiltInCommand ¶
IsBuiltInCommand returns true if the command is a built-in command (starts with __)
Types ¶
type CommandHandler ¶
CommandHandler defines the interface for command handlers
type CommentedError ¶
type CommentedError struct {
Err error
}
CommentedError represents an error where a comment has already been posted to the PR
func (*CommentedError) Error ¶
func (e *CommentedError) Error() string
func (*CommentedError) Unwrap ¶
func (e *CommentedError) Unwrap() error
type PRHandler ¶
PRHandler encapsulates Git client and configuration for PR operations
func NewPRHandler ¶
NewPRHandler creates a new PR handler with Git client and configuration
func NewPRHandlerWithClient ¶
func NewPRHandlerWithClient(logger *logrus.Logger, cfg *config.Config, client git.GitClient, prSender string) (*PRHandler, error)
NewPRHandlerWithClient creates a new PR handler with a provided client (for testing)
func (*PRHandler) CheckPRStatus ¶
CheckPRStatus verifies if the PR is in the expected state
func (*PRHandler) ExecuteCommand ¶
ExecuteCommand executes a command with the given arguments This is the unified command execution method used by regular, sub-command, and built-in command flows
func (*PRHandler) ExposedDetermineMergeMethod ¶
ExposedDetermineMergeMethod exposes determineMergeMethod for testing
func (*PRHandler) ExposedSelectAutoMergeMethod ¶
ExposedSelectAutoMergeMethod exposes selectAutoMergeMethod for testing
func (*PRHandler) ExposedValidateRebaseMerge ¶
ExposedValidateRebaseMerge exposes validateRebaseMerge for testing
func (*PRHandler) GetCommentsWithCache ¶
GetCommentsWithCache retrieves all comments from the pull request with caching
func (*PRHandler) GetLGTMVotes ¶
func (h *PRHandler) GetLGTMVotes(requiredPerms []string, debugMode bool, ignoreUserRemove ...string) (int, map[string]string, error)
GetLGTMVotes retrieves and validates LGTM votes with optimized comments caching
func (*PRHandler) HandleAssign ¶
HandleAssign assigns users as reviewers to the PR
func (*PRHandler) HandleBatch ¶
HandleBatch executes multiple commands in batch mode
func (*PRHandler) HandleCheck ¶
HandleCheck displays current LGTM status or executes sub-commands
func (*PRHandler) HandleCheckbox ¶
HandleCheckbox updates unchecked checkboxes in the PR description.
func (*PRHandler) HandleCheckboxIssue ¶
HandleCheckboxIssue updates unchecked checkboxes in the specified or default GitHub issue.
func (*PRHandler) HandleCherrypick ¶
HandleCherrypick handles the cherrypick command to create a cherrypick PR to a different branch
func (*PRHandler) HandleClose ¶
HandleClose closes the PR without merging
func (*PRHandler) HandleHelp ¶
HandleHelp displays available commands in GitHub Markdown table format
func (*PRHandler) HandleLGTM ¶
HandleLGTM processes LGTM votes and approves PR if threshold is met
func (*PRHandler) HandleLabel ¶
HandleLabel adds labels to the PR
func (*PRHandler) HandleMerge ¶
HandleMerge merges the PR if conditions are met
func (*PRHandler) HandlePostMergeCherryPick ¶
HandlePostMergeCherryPick processes any cherry-pick commands found in PR comments after merge This is a public method that can be called independently for post-merge operations
func (*PRHandler) HandleRebase ¶
HandleRebase rebases the PR branch
func (*PRHandler) HandleRemoveLGTM ¶
HandleRemoveLGTM processes the removal of LGTM by dismissing approval if threshold was met
func (*PRHandler) HandleRetest ¶
HandleRetest reruns failed test jobs by commenting /test {pipeline-name}
func (*PRHandler) HandleUnassign ¶
HandleUnassign removes users from PR reviewers
func (*PRHandler) HandleUnlabel ¶
HandleUnlabel removes labels from the PR
func (*PRHandler) PostComment ¶
PostComment posts a comment to the pull request
type RemovalResult ¶
type RemovalResult struct {
CurrentUserHasVote bool
BeforeVotes int
AfterVotes int
UserPermission string
}
RemovalResult holds the result of LGTM removal processing
type SubCommand ¶
SubCommand represents a parsed sub-command with its arguments
Source Files
¶
- commands.go
- errors.go
- handle_assign.go
- handle_batch.go
- handle_check.go
- handle_checkbox.go
- handle_checkbox_issue.go
- handle_cherrypick.go
- handle_close.go
- handle_help.go
- handle_label.go
- handle_lgtm.go
- handle_merge.go
- handle_rebase.go
- handle_remove_lgtm.go
- handle_retest.go
- handle_unassign.go
- handle_unlabel.go
- pr_handler.go
- tekton.go
- test_helpers.go