issues

package
v0.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2016 License: MIT Imports: 11 Imported by: 4

Documentation

Index

Constants

View Source
const (
	TagIssueTracker = "SF-Issue-Tracker"
	TagStoryKey     = "SF-Story-Key"
)

Variables

This section is empty.

Functions

func CloseMilestone added in v0.16.0

func CloseMilestone(
	client *github.Client,
	owner string,
	repo string,
	milestone *github.Milestone,
) (*github.Milestone, action.Action, error)

func CreateMilestone added in v0.16.0

func CreateMilestone(
	client *github.Client,
	owner string,
	repo string,
	title string,
) (*github.Milestone, action.Action, error)

func FindMilestoneByTitle added in v0.16.0

func FindMilestoneByTitle(
	client *github.Client,
	owner string,
	repo string,
	title string,
) (*github.Milestone, error)

func FindReviewIssueByCommitItem added in v0.12.0

func FindReviewIssueByCommitItem(
	client *github.Client,
	owner string,
	repo string,
	commitSHA string,
) (*github.Issue, error)

FindReviewIssueByCommitItem searches review issues for the one that contains the given commit in its commit checklist.

func FindReviewIssueForCommit

func FindReviewIssueForCommit(
	client *github.Client,
	owner string,
	repo string,
	commitSHA string,
) (*github.Issue, error)

FindReviewIssueForCommit returns the review issue associated with the given commit.

func FindReviewIssueForStory

func FindReviewIssueForStory(
	client *github.Client,
	owner string,
	repo string,
	storyId string,
) (*github.Issue, error)

FindReviewIssueForStory returns the review issue associated with the given story.

func GetOrCreateMilestoneForTitle added in v0.16.0

func GetOrCreateMilestoneForTitle(
	client *github.Client,
	owner string,
	repo string,
	title string,
) (*github.Milestone, action.Action, error)

Types

type CommitItem

type CommitItem struct {
	Reviewed    bool
	CommitSHA   string
	CommitTitle string
}

CommitItem represents a line in the commit checklist.

type CommitList

type CommitList struct {
	// contains filtered or unexported fields
}

CommitList is a placeholder for multiple commit items.

func NewCommitList added in v0.13.0

func NewCommitList(items []*CommitItem) *CommitList

func (*CommitList) AddCommit

func (list *CommitList) AddCommit(reviewed bool, commitSHA, commitTitle string) bool

AddCommit adds the commit to the list unless the commit is already there.

func (*CommitList) CommitItems

func (list *CommitList) CommitItems() []*CommitItem

type CommitReviewIssue

type CommitReviewIssue struct {
	// Title
	CommitSHA   string
	CommitTitle string

	// Body
	*ReviewIssueCommonBody
}

CommitReviewIssue represents a review issue associated with a commit.

func NewCommitReviewIssue

func NewCommitReviewIssue(commitSHA, commitTitle string) *CommitReviewIssue

func (*CommitReviewIssue) FormatBody

func (ctx *CommitReviewIssue) FormatBody() string

func (*CommitReviewIssue) FormatTitle

func (ctx *CommitReviewIssue) FormatTitle() string

type ErrInvalidBody

type ErrInvalidBody struct {
	// contains filtered or unexported fields
}

ErrInvalidBody is returned when the issue body is malformed.

func (*ErrInvalidBody) Error

func (err *ErrInvalidBody) Error() string

type ErrInvalidTitle

type ErrInvalidTitle struct {
	// contains filtered or unexported fields
}

ErrInvalidTitle is returned when the issue title is malformed.

func (*ErrInvalidTitle) Error

func (err *ErrInvalidTitle) Error() string

type ErrScanning

type ErrScanning struct {
	// contains filtered or unexported fields
}

ErrScanning is returned from bodyScanner.ReadLine when the internal scanner returns an error.

func (*ErrScanning) Error

func (err *ErrScanning) Error() string

type ErrTagNotFound

type ErrTagNotFound struct {
	// contains filtered or unexported fields
}

ErrTagNotFound is returned when there is a SalsaFlow metadata tag missing in the body.

func (*ErrTagNotFound) Error

func (err *ErrTagNotFound) Error() string

type ErrUnknownReviewIssueType

type ErrUnknownReviewIssueType struct {
	// contains filtered or unexported fields
}

ErrUnknownReviewIssueType is returned when the issue type cannot be recognized.

func (*ErrUnknownReviewIssueType) Error

func (err *ErrUnknownReviewIssueType) Error() string

type ReviewBlockerItem

type ReviewBlockerItem struct {
	Fixed          bool
	CommentURL     string
	CommitSHA      string
	BlockerNumber  int
	BlockerSummary string
}

ReviewBlockerItem represents a line in the review blocker checkbox.

type ReviewBlockerList

type ReviewBlockerList struct {
	// contains filtered or unexported fields
}

ReviewBlockerList is a placeholder for multiple review blockers.

func NewReviewBlockerList added in v0.13.0

func NewReviewBlockerList(items []*ReviewBlockerItem) *ReviewBlockerList

func (*ReviewBlockerList) AddReviewBlocker

func (list *ReviewBlockerList) AddReviewBlocker(
	fixed bool,
	commentURL string,
	commitSHA string,
	blockerSummary string,
) bool

AddReviewBlocker adds the blocker to the list unless the blocker is already there. The field that is check and must be unique is the comment URL.

func (*ReviewBlockerList) ReviewBlockerItems

func (list *ReviewBlockerList) ReviewBlockerItems() []*ReviewBlockerItem

type ReviewIssue

type ReviewIssue interface {

	// AddCommit adds the commit to the commit checklist.
	AddCommit(reviewed bool, commitSHA, commitTitle string) (added bool)

	// CommitItems returns the list of commits contained in the commit checklist.
	CommitItems() []*CommitItem

	// AddReviewBlocker adds the review blocker to the blocker checkbox.
	AddReviewBlocker(fixed bool, commentURL, commitSHA, blockerSummary string) (added bool)

	// ReviewBlockerItems returns the list of blockers contained in the blocker checklist.
	ReviewBlockerItems() []*ReviewBlockerItem

	// FormatTitle returns the review issue title for the given issue type.
	FormatTitle() string

	// FormatBody returns the review issue body for the given issue type.
	FormatBody() string
}

ReviewIssue represents the common interface for all review issue types.

func ParseReviewIssue

func ParseReviewIssue(issue *github.Issue) (ReviewIssue, error)

ParseReviewIssue parses the given GitHub review issue and returns a *StoryReviewIssue or *CommitReviewIssue based on the issue type, which both implement ReviewIssue interface.

type ReviewIssueCommonBody

type ReviewIssueCommonBody struct {
	*CommitList
	*ReviewBlockerList

	UserContent string
}

ReviewIssueCommonBody represents the issue body part that is shared by all issue types, i.e. by both story review issues and commit review issues.

type StoryReviewIssue

type StoryReviewIssue struct {
	StoryId      string
	StoryURL     string
	StorySummary string
	TrackerName  string
	StoryKey     string

	*ReviewIssueCommonBody
}

StoryReviewIssue represents the review issue associated with a story.

func NewStoryReviewIssue

func NewStoryReviewIssue(
	storyId string,
	storyURL string,
	storySummary string,
	issueTracker string,
	storyKey string,
) *StoryReviewIssue

func (*StoryReviewIssue) FormatBody

func (issue *StoryReviewIssue) FormatBody() string

func (*StoryReviewIssue) FormatTitle

func (issue *StoryReviewIssue) FormatTitle() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL