config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SanityCheck added in v0.0.2

func SanityCheck(cfg *Config) error

SanityCheck checks if the all team members belong to the organization.

func SortConfig

func SortConfig(cfg *Config)

Types

type CodeReviewAssignment

type CodeReviewAssignment struct {
	// Algorithm can only be LOAD_BALANCE or ROUND_ROBIN.
	Algorithm TeamReviewAssignmentAlgorithm `json:"algorithm,omitempty" yaml:"algorithm,omitempty"`

	// Enabled should be set to true if the CRA is enabled.
	Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`

	// ExcludedMembers contains the list of members that should not receive
	// review requests.
	ExcludedMembers []ExcludedMember `json:"excludedMembers,omitempty" yaml:"excludedMembers,omitempty"`

	// NotifyTeam will notify the entire team if assigning team members.
	NotifyTeam bool `json:"notifyTeam,omitempty" yaml:"notifyTeam,omitempty"`

	// TeamMemberCount specifies the number of team members that should be
	// assigned to review.
	TeamMemberCount int `json:"teamMemberCount,omitempty" yaml:"teamMemberCount,omitempty"`
}

type Config

type Config struct {
	// Organization being managed.
	Organization string `json:"organization,omitempty" yaml:"organization,omitempty"`

	// Members maps the github login to a User.
	Members map[string]User `json:"members,omitempty" yaml:"members,omitempty"`

	// Teams maps the github team name to a TeamConfig.
	Teams map[string]TeamConfig `json:"teams,omitempty" yaml:"teams,omitempty"`

	// Slice of github logins that should be excluded from all team reviews
	// assignments.
	ExcludeCRAFromAllTeams []string `json:"excludeCodeReviewAssignmentFromAllTeams,omitempty" yaml:"excludeCodeReviewAssignmentFromAllTeams,omitempty"`
}

type ExcludedMember

type ExcludedMember struct {
	// Login the login of this GH user.
	Login string `json:"login" yaml:"login"`

	// Reason states the reason why this user is excluded from the
	// CodeReviewAssignment.
	Reason string `json:"reason" yaml:"reason"`
}

type TeamConfig

type TeamConfig struct {
	// ID is the GitHub ID of this team.
	ID string `json:"id" yaml:"id"`

	// Members is a list of users that belong to this team.
	Members []string `json:"members,omitempty" yaml:"members,omitempty"`

	// CodeReviewAssignment is the code review assignment configuration of this team
	CodeReviewAssignment CodeReviewAssignment `json:"codeReviewAssignment,omitempty" yaml:"codeReviewAssignment,omitempty"`
}

type TeamReviewAssignmentAlgorithm

type TeamReviewAssignmentAlgorithm string
const (
	TeamReviewAssignmentAlgorithmLoadBalance TeamReviewAssignmentAlgorithm = "LOAD_BALANCE"
	TeamReviewAssignmentAlgorithmRoundRobin  TeamReviewAssignmentAlgorithm = "ROUND_ROBIN"
)

type User

type User struct {
	// ID is the GitHub ID of this user.
	ID string `json:"id" yaml:"id"`

	// Name is the real name of the person behind this GH account.
	Name string `json:"name,omitempty" yaml:"name,omitempty"`
}

Jump to

Keyboard shortcuts

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