Documentation
¶
Index ¶
- Constants
- func BuildCheckRunsStatusSection(allPassed bool, failedChecks []CheckStatus) string
- func BuildCheckStatusTable(failedChecks []CheckStatus) string
- func BuildLGTMStatusMessage(opts LGTMStatusOptions) string
- func BuildLGTMUsersTable(lgtmUsers map[string]string, lgtmPermissions []string, ...) string
- func BuildUsersTable(lgtmUsers map[string]string, robotUsers map[string]bool) string
- func FormatUserMentions(users []string) []string
- func HelpMessage(lgtmThreshold int, lgtmPermissions []string, mergeMethod string) string
- type CheckStatus
- type LGTMStatusOptions
- type MessageTemplate
- type TemplateData
Constants ¶
View Source
const ( LGTMApprovalTemplate = `✅ **LGTM from @%s** (Permission: ` + "`%s`" + `) Approving this PR...` LGTMPermissionDeniedTemplate = `❌ **LGTM Permission Denied** @%s, you don't have sufficient permissions to approve this PR. **Your permission:** ` + "`%s`" + ` **Required permissions:** %s Only users with the required permissions can use the /lgtm command.` LGTMSelfApprovalTemplate = `` /* 154-byte string literal not displayed */ )
LGTM Messages
View Source
const ( CommandErrorTemplate = `❌ **Command Failed** Command: ` + "`%s`" + ` Error: %s Please check the command usage or contact support if the issue persists.` CheckboxDescriptionNotFoundTemplate = `❌ **Checkbox Update Failed** Could not locate a pull request description with unchecked checkboxes.` CheckboxAlreadyCheckedTemplate = `ℹ️ **No Unchecked Checkboxes Found** The targeted content%s already has all checkboxes checked.` CheckboxUpdateSuccessTemplate = `✅ **Checkboxes Updated** @%s has checked all checkboxes in %s.` CheckboxIssueNotFoundTemplate = `❌ **Checkbox Update Failed** No matching issue was found for checkbox processing.` CheckboxIssueBodyMissingTemplate = `❌ **Checkbox Update Failed** Could not update the content%s because the issue description is empty.` CheckboxIssueInvalidNumberTemplate = `❌ **Checkbox Update Failed** Issue identifier ` + "`%s`" + ` is invalid. Please provide a numeric issue number.` CheckboxIssueInvalidOptionTemplate = `❌ **Checkbox Update Failed** Unable to parse issue option ` + "`%s`" + `. Use an issue number or --title/--author parameters.` )
Error Messages
View Source
const ( MergeInsufficientPermissionsTemplate = `` /* 259-byte string literal not displayed */ MergeChecksNotPassingTemplate = `⚠️ **Cannot merge PR: Some checks are not passing** %s Please wait for all checks to pass before merging.` MergeNotEnoughLGTMTemplate = `` /* 187-byte string literal not displayed */ MergeFailedTemplate = `❌ **Merge failed** Failed to merge PR #%d: %v Please check the PR status and try again.` MergeMultipleCommitsRebaseTemplate = `❌ **Cannot rebase merge: Multiple commits detected** This PR contains **%d commits**. Rebase merge is only allowed for PRs with a single commit to maintain clean history. **Options:** - Use ` + "`/merge squash`" + ` to squash all commits into one before merging - Use ` + "`/merge merge`" + ` to create a merge commit - Squash your commits locally to a single commit and push **Current commits:** %s Please choose an alternative merge method or modify your PR to have only one commit.` MergeSuccessTemplate = `` /* 167-byte string literal not displayed */ )
Merge Messages
View Source
const ( AssignmentGreetingTemplate = `%s @%s has requested your review on this pull request. Please take a look when you have a moment. Thanks! 🙏` UnassignmentTemplate = `♻️ Removed %s from the review list. Thanks for your time!` )
Assignment Messages
View Source
const ( RemoveLGTMPermissionDeniedTemplate = `❌ **Remove LGTM Permission Denied** @%s, you don't have sufficient permissions to dismiss approvals on this PR. **Your permission:** ` + "`%s`" + ` **Required permissions:** %s Only users with the required permissions can use the /remove-lgtm command.` RemoveLGTMDismissTemplate = `❌ **LGTM Removed** by @%s Dismissing previous approval...` RemoveLGTMNoApprovalTemplate = `ℹ️ **No Approval to Remove** @%s, you don't have any active approval review to dismiss on this PR. **Your permission:** ` + "`%s`" + ` Use ` + "`/lgtm`" + ` first to approve the PR before you can remove your approval.` RemoveLGTMSuccessTemplate = `✅ **Approval Dismissed** @%s has successfully dismissed their approval review. **Permission:** ` + "`%s`" + ` Use ` + "`/lgtm`" + ` again to re-approve this PR if needed.` RemoveLGTMStatusTemplate = `` /* 173-byte string literal not displayed */ )
Remove LGTM Messages
View Source
const ( RebaseFailedTemplate = `❌ **Rebase failed**: %v` RebaseSuccessTemplate = `✅ **PR rebased successfully** on the base branch.` )
Rebase Messages
View Source
const ( CherryPickInvalidCommandTemplate = `❌ **Invalid cherrypick command** Usage: ` + "`/cherrypick <target-branch>`" + ` Examples: - ` + "`/cherrypick release-3.9`" + ` - ` + "`/cherrypick release-1.15`" + ` Please specify the target branch for the cherrypick.` CherryPickInsufficientPermissionsTemplate = `` /* 268-byte string literal not displayed */ CherryPickClosedPRTemplate = `` /* 275-byte string literal not displayed */ CherryPickErrorTemplate = `❌ **Cherry Pick Failed** Failed to cherry-pick changes from PR #%d to branch ` + "`%s`" + `: * Requested by: @%s * Error: ` + "`%s`" + ` *Possible causes:* * **🔀 Merge conflicts** - Changes conflict with target branch * **🍴 Fork PR** - Commits may not be available in target repository * **🔒 Branch protection rules** - Target branch has restrictions * **📁 Binary file conflicts** - Binary files cannot be auto-merged * **🔗 Missing dependencies** - Required commits not present in target branch * **❌ Invalid branch name** - Target branch doesn't exist *Manual resolution options:* * Create the cherry-pick PR manually using git commands * Resolve conflicts locally and create PR * For fork PRs, ensure commits are accessible in target repository Please resolve any issues and try again.` CherryPickSuccessTemplate = `✅ **Cherry Pick Successful** Successfully cherry-picked changes from PR #%d to branch ` + "`%s`" + `. *Details:* * Source PR: #%d * Cherry-pick PR: #%d * Target Branch: ` + "`%s`" + ` * Cherry-picked by: @%s * Latest commit SHA: ` + "`%s`" + `` CherryPickScheduledTemplate = `✅ We will cherry-pick this PR to the branch ` + "`%s`" + ` upon merge.` CherryPickBranchNotFoundTemplate = `❌ **Cherry Pick Failed** Target branch ` + "`%s`" + ` does not exist in this repository. **Please ensure:** - The branch name is spelled correctly - The branch exists in the remote repository - You have access to view the branch **Usage:** ` + "`/cherrypick <existing-branch>`" + ` **Example:** ` + "`/cherrypick release/v1.0`" + `` )
Cherry-pick Messages
View Source
const ( LGTMStatusReadyTemplate = `` /* 182-byte string literal not displayed */ LGTMStatusPendingTemplate = `` /* 186-byte string literal not displayed */ LGTMStatusTipTemplate = ` > **Tip:** Use ` + "`/lgtm`" + ` to approve this PR if you have the required permissions.` CheckRunsFailedHeaderTemplate = ` ⚠️ **Check Runs Status - Some checks are not passing** | Check Name | Status | |------------|--------|` > **Note:** All checks must pass before this PR can be merged.` CheckRunsPassedTemplate = ` ✅ **Check Runs Status - All checks are passing** This PR is ready for merge from a technical perspective!` )
LGTM Status Messages
View Source
const (
CloseSuccessTemplate = `🔒 **PR #%d has been closed**
The pull request has been successfully closed without merging.`
)
Close Messages
Variables ¶
This section is empty.
Functions ¶
func BuildCheckRunsStatusSection ¶
func BuildCheckRunsStatusSection(allPassed bool, failedChecks []CheckStatus) string
func BuildCheckStatusTable ¶
func BuildCheckStatusTable(failedChecks []CheckStatus) string
func BuildLGTMStatusMessage ¶
func BuildLGTMStatusMessage(opts LGTMStatusOptions) string
BuildLGTMStatusMessage generates a formatted LGTM status message with check runs status
func BuildLGTMUsersTable ¶
func BuildUsersTable ¶
func FormatUserMentions ¶
Utility functions for creating user mentions and tables
Types ¶
type CheckStatus ¶
CheckStatus represents the status of a check run
type LGTMStatusOptions ¶
type LGTMStatusOptions struct {
ValidVotes int
LGTMUsers map[string]string
LGTMThreshold int
LGTMPermissions []string
RobotAccounts []string
IncludeThreshold bool
ChecksPassed bool
FailedChecks []CheckStatus
}
LGTMStatusOptions contains options for generating LGTM status message
type MessageTemplate ¶
MessageTemplate defines the structure for message templates
type TemplateData ¶
type TemplateData map[string]interface{}
TemplateData holds the data for template substitution
Click to show internal directories.
Click to hide internal directories.