Documentation ¶
Index ¶
- Constants
- type SCMClient
- func (f *SCMClient) AddLabel(owner, repo string, number int, label string, pr bool) error
- func (f *SCMClient) AssignIssue(owner, repo string, number int, assignees []string) error
- func (f *SCMClient) BotName() (string, error)
- func (f *SCMClient) ClearMilestone(org, repo string, issueNum int) error
- func (f *SCMClient) CreateComment(owner, repo string, number int, pr bool, comment string) error
- func (f *SCMClient) CreateCommentReaction(org, repo string, ID int, reaction string) error
- func (f *SCMClient) CreateIssueReaction(org, repo string, ID int, reaction string) error
- func (f *SCMClient) CreateReview(org, repo string, number int, r scmprovider.DraftReview) error
- func (f *SCMClient) CreateStatus(owner, repo, SHA string, s *scm.StatusInput) (*scm.Status, error)
- func (f *SCMClient) DeleteComment(owner, repo string, number, ID int, pr bool) error
- func (f *SCMClient) DeleteRef(owner, repo, ref string) error
- func (f *SCMClient) DeleteStaleComments(org, repo string, number int, comments []*scm.Comment, pr bool, ...) error
- func (f *SCMClient) FindIssues(query, sort string, asc bool) ([]scm.Issue, error)
- func (f *SCMClient) GetCombinedStatus(owner, repo, ref string) (*scm.CombinedStatus, error)
- func (f *SCMClient) GetFile(org, repo, file, commit string) ([]byte, error)
- func (f *SCMClient) GetIssueLabels(owner, repo string, number int, pr bool) ([]*scm.Label, error)
- func (f *SCMClient) GetPullRequest(owner, repo string, number int) (*scm.PullRequest, error)
- func (f *SCMClient) GetPullRequestChanges(org, repo string, number int) ([]*scm.Change, error)
- func (f *SCMClient) GetRef(owner, repo, ref string) (string, error)
- func (f *SCMClient) GetRepoLabels(owner, repo string) ([]*scm.Label, error)
- func (f *SCMClient) GetSingleCommit(org, repo, SHA string) (*scm.Commit, error)
- func (f *SCMClient) IsCollaborator(org, repo, login string) (bool, error)
- func (f *SCMClient) IsMember(org, user string) (bool, error)
- func (f *SCMClient) ListCollaborators(org, repo string) ([]scm.User, error)
- func (f *SCMClient) ListIssueComments(owner, repo string, number int) ([]*scm.Comment, error)
- func (f *SCMClient) ListIssueEvents(owner, repo string, number int) ([]*scm.ListedIssueEvent, error)
- func (f *SCMClient) ListMilestones(org, repo string) ([]scmprovider.Milestone, error)
- func (f *SCMClient) ListOrgMembers(org string) ([]*scm.TeamMember, error)
- func (f *SCMClient) ListPRCommits(org, repo string, prNumber int) ([]scm.Commit, error)
- func (f *SCMClient) ListPullRequestComments(owner, repo string, number int) ([]*scm.Comment, error)
- func (f *SCMClient) ListReviews(owner, repo string, number int) ([]*scm.Review, error)
- func (f *SCMClient) ListStatuses(org, repo, ref string) ([]*scm.Status, error)
- func (f *SCMClient) ListTeamMembers(teamID int, role string) ([]*scm.TeamMember, error)
- func (f *SCMClient) ListTeams(org string) ([]*scm.Team, error)
- func (f *SCMClient) PRRefFmt() string
- func (f *SCMClient) ProviderType() string
- func (f *SCMClient) QuoteAuthorForComment(author string) string
- func (f *SCMClient) RemoveLabel(owner, repo string, number int, label string, pr bool) error
- func (f *SCMClient) SetMilestone(org, repo string, issueNum, milestoneNum int) error
- func (f *SCMClient) SupportsGraphQL() bool
Constants ¶
const ( // Bot is the exported botName Bot = botName // TestRef is the ref returned when calling GetRef TestRef = "abcde" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SCMClient ¶
type SCMClient struct { Issues map[int][]*scm.Issue OrgMembers map[string][]string Collaborators []string IssueComments map[int][]*scm.Comment IssueCommentID int PullRequests map[int]*scm.PullRequest PullRequestChanges map[int][]*scm.Change PullRequestComments map[int][]*scm.Comment ReviewID int Reviews map[int][]*scm.Review CombinedStatuses map[string]*scm.CombinedStatus CreatedStatuses map[string][]*scm.StatusInput IssueEvents map[int][]*scm.ListedIssueEvent Commits map[string]*scm.Commit //All Labels That Exist In The Repo RepoLabelsExisting []string // org/repo#number:label IssueLabelsAdded []string IssueLabelsExisting []string IssueLabelsRemoved []string PullRequestLabelsAdded []string PullRequestLabelsExisting []string PullRequestLabelsRemoved []string // org/repo#number:body IssueCommentsAdded []string PullRequestCommentsAdded []string // org/repo#issuecommentid IssueCommentsDeleted []string PullRequestCommentsDeleted []string // org/repo#issuecommentid:reaction IssueReactionsAdded []string CommentReactionsAdded []string // org/repo#number:assignee AssigneesAdded []string // org/repo#number:milestone (represents the milestone for a specific issue) Milestone int MilestoneMap map[string]int // list of commits for each PR // org/repo#number:[]commit CommitMap map[string][]scm.Commit // Fake remote git storage. File name are keys // and values map SHA to content RemoteFiles map[string]map[string]string // A list of refs that got deleted via DeleteRef RefsDeleted []struct{ Org, Repo, Ref string } }
SCMClient is like client, but fake.
func (*SCMClient) AssignIssue ¶
AssignIssue adds assignees.
func (*SCMClient) ClearMilestone ¶
ClearMilestone removes the milestone
func (*SCMClient) CreateComment ¶
CreateComment adds a comment to a PR
func (*SCMClient) CreateCommentReaction ¶
CreateCommentReaction adds emoji to a comment.
func (*SCMClient) CreateIssueReaction ¶
CreateIssueReaction adds an emoji to an issue.
func (*SCMClient) CreateReview ¶
func (f *SCMClient) CreateReview(org, repo string, number int, r scmprovider.DraftReview) error
CreateReview adds a review to a PR
func (*SCMClient) CreateStatus ¶
CreateStatus adds a status context to a commit.
func (*SCMClient) DeleteComment ¶
DeleteComment deletes a comment.
func (*SCMClient) DeleteRef ¶
DeleteRef returns an error indicating if deletion of the given ref was successful
func (*SCMClient) DeleteStaleComments ¶
func (f *SCMClient) DeleteStaleComments(org, repo string, number int, comments []*scm.Comment, pr bool, isStale func(*scm.Comment) bool) error
DeleteStaleComments deletes comments flagged by isStale.
func (*SCMClient) FindIssues ¶
FindIssues returns f.Issues
func (*SCMClient) GetCombinedStatus ¶
func (f *SCMClient) GetCombinedStatus(owner, repo, ref string) (*scm.CombinedStatus, error)
GetCombinedStatus returns the overall status for a commit.
func (*SCMClient) GetIssueLabels ¶
GetIssueLabels gets labels on an issue
func (*SCMClient) GetPullRequest ¶
GetPullRequest returns details about the PR.
func (*SCMClient) GetPullRequestChanges ¶
GetPullRequestChanges returns the file modifications in a PR.
func (*SCMClient) GetRepoLabels ¶
GetRepoLabels gets labels in a repo.
func (*SCMClient) GetSingleCommit ¶
GetSingleCommit returns a single commit.
func (*SCMClient) IsCollaborator ¶
IsCollaborator returns true if the user is a collaborator of the repo.
func (*SCMClient) ListCollaborators ¶
ListCollaborators lists the collaborators.
func (*SCMClient) ListIssueComments ¶
ListIssueComments returns comments.
func (*SCMClient) ListIssueEvents ¶
func (f *SCMClient) ListIssueEvents(owner, repo string, number int) ([]*scm.ListedIssueEvent, error)
ListIssueEvents returns issue events
func (*SCMClient) ListMilestones ¶
func (f *SCMClient) ListMilestones(org, repo string) ([]scmprovider.Milestone, error)
ListMilestones lists milestones.
func (*SCMClient) ListOrgMembers ¶ added in v0.0.546
func (f *SCMClient) ListOrgMembers(org string) ([]*scm.TeamMember, error)
ListOrgMembers returns an empty list for now
func (*SCMClient) ListPRCommits ¶
ListPRCommits lists commits for a given PR.
func (*SCMClient) ListPullRequestComments ¶
ListPullRequestComments returns review comments.
func (*SCMClient) ListReviews ¶
ListReviews returns reviews.
func (*SCMClient) ListStatuses ¶
ListStatuses returns individual status contexts on a commit.
func (*SCMClient) ListTeamMembers ¶
ListTeamMembers return a fake team with a single "sig-lead" Github teammember
func (*SCMClient) ListTeams ¶
ListTeams return a list of fake teams that correspond to the fake team members returned by ListTeamMembers
func (*SCMClient) ProviderType ¶ added in v0.0.575
ProviderType returns the provider type
func (*SCMClient) QuoteAuthorForComment ¶ added in v0.0.632
QuoteAuthorForComment adds quotes around the author for @ usage if needed
func (*SCMClient) RemoveLabel ¶
RemoveLabel removes a label
func (*SCMClient) SetMilestone ¶
SetMilestone sets the milestone.
func (*SCMClient) SupportsGraphQL ¶ added in v0.0.575
SupportsGraphQL returns whether the provider supports GraphQL