Documentation ¶
Index ¶
- Variables
- func NewInstallationIssue(configPullRequest *model.PullRequest, hasTrackedIssue bool, badgeURL BadgeURLs, ...) (model.IssueRequest, error)
- type BadgeStyle
- type BadgeURLs
- type BoardOptions
- type Config
- type Contributor
- func NewBlueTeamFromIssue(issue model.EnrichedIssue, options BoardOptions) ([]*Contributor, error)
- func NewBlueTeamFromIssues(issues map[int]model.EnrichedIssue, options BoardOptions) []*Contributor
- func NewRedTeamFromIssues(issues []model.Issue, currency string, now time.Time) ([]*Contributor, error)
- type Contributors
- type RewardEvent
- type RewardStructure
- type RewardsLastYear
- type TimeToDisclosure
- type WorkLog
- type WorkLogs
Constants ¶
This section is empty.
Variables ¶
var ( ErrMissingRepoPathParameter = errors.New("missing repo path parameter") ErrMissingOwnerPathParameter = errors.New("missing owner path parameter") ErrAppNotInstalled = errors.New("GitHub app not installed for given repository") ErrIssueMissingAssignee = errors.New("the issue is missing an assignee") ErrIssueMissingClosedAt = errors.New("the issue is missing the closed at timestamp") ErrIssueMissingPullRequest = errors.New("the issue is missing a pull request") ErrEventMissingData = errors.New("the event is missing data promised by the GitHub API") ErrEventNotRepoAdded = errors.New("the event is not a repo added to github event") ErrEventNotInstallationCreated = errors.New("the event is not a github created event") ErrEventNotHandled = errors.New("the event is not handled") )
var ErrNoWorkLogForAssignee = errors.New("no work log found for assignee")
Functions ¶
func NewInstallationIssue ¶
func NewInstallationIssue(configPullRequest *model.PullRequest, hasTrackedIssue bool, badgeURL BadgeURLs, state model.IssueState, labels []string) (model.IssueRequest, error)
NewInstallationIssue creates a new InstallationIssue from a given title, a config pull request and a boolean indicating whether an issue is tracked by the famed protocol.
Types ¶
type BadgeStyle ¶
type BadgeStyle string
const ( BadgeStyleSmall BadgeStyle = "small" BadgeStyleLargeLight BadgeStyle = "large-light" BadgeStyleLargeDark BadgeStyle = "large-dark" )
func NewBadgeStyleFromQuery ¶
func NewBadgeStyleFromQuery(query string) BadgeStyle
type BadgeURLs ¶
func NewBadgeURLs ¶
type BoardOptions ¶
type BoardOptions struct { Currency string RewardStructure RewardStructure Now time.Time }
func NewBoardOptions ¶
func NewBoardOptions(currency string, rewardStructure RewardStructure, now time.Time) BoardOptions
type Config ¶
type Contributor ¶
type Contributor struct { Login string `json:"login"` AvatarURL string `json:"avatarUrl"` HTMLURL string `json:"htmlUrl"` FixCount int `json:"fixCount"` Rewards []RewardEvent `json:"rewards"` RewardSum float64 `json:"rewardSum"` Currency string `json:"currency"` RewardsLastYear RewardsLastYear `json:"rewardsLastYear"` TimeToDisclosure TimeToDisclosure `json:"timeToDisclosure"` Severities map[model.IssueSeverity]int `json:"severities"` MeanSeverity float64 `json:"meanSeverity"` // For issue rewardComment generation TotalWorkTime time.Duration `json:"-"` }
func NewBlueTeamFromIssue ¶
func NewBlueTeamFromIssue(issue model.EnrichedIssue, options BoardOptions) ([]*Contributor, error)
NewBlueTeamFromIssue returns a contributors map generated from the repo's internal issue with issueID and its corresponding events.
func NewBlueTeamFromIssues ¶
func NewBlueTeamFromIssues(issues map[int]model.EnrichedIssue, options BoardOptions) []*Contributor
NewBlueTeamFromIssues generates a blue team from a given slice of enriched issues.
func NewRedTeamFromIssues ¶
func NewRedTeamFromIssues(issues []model.Issue, currency string, now time.Time) ([]*Contributor, error)
NewRedTeamFromIssues returns contributors of the red team for a given set of issues.
type Contributors ¶
type Contributors map[string]*Contributor
func (Contributors) UpdateRewards ¶
func (cs Contributors) UpdateRewards(url string, workLogs WorkLogs, open, close time.Time, k int, severity model.IssueSeverity, boardOptions BoardOptions)
UpdateRewards updates the reward for each contributor based on open (time when issue was opened) close (time issue was closed) k (number of times the issue was reopened) workLogs (time each contributor worked on the issue).
type RewardEvent ¶
type RewardStructure ¶
type RewardStructure struct {
// contains filtered or unexported fields
}
func NewRewardStructure ¶
func NewRewardStructure(severityReward map[model.IssueSeverity]float64, maxDaysToFix, kMultiplier int) RewardStructure
func (RewardStructure) Reward ¶
func (RW RewardStructure) Reward(t time.Duration, k int, severity model.IssueSeverity) float64
Reward returns the base reward multiplied by the severity reward.
type RewardsLastYear ¶
type RewardsLastYear []monthlyReward
func NewRewardsLastYear ¶
func NewRewardsLastYear(timeStart time.Time) RewardsLastYear
NewRewardsLastYear returns rewardsLastYear with instantiated months starting at the current month and going back 11 months.