reinventing_democracy

package
v0.0.0-...-c09d977 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PolicyName ds.PolicyName = "tlar"
	// RequiredLeadsCount number of lead to be picked as reviewers (also count of lead approves)
	RequiredLeadsCount = 1
	// RequiredDevelopersCount number of developers to be picked as reviewers
	RequiredDevelopersCount = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GitlabClient

type GitlabClient interface {
	// SetReviewers overwrites reviewers list for the merge request
	SetReviewers(mr *ds.MergeRequest, reviewers []int) error
}

type Policy

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

func New

func New(r Repository, g GitlabClient) *Policy

func (*Policy) ApprovedByPolicy

func (p *Policy) ApprovedByPolicy(team *ds.Team, mr *ds.MergeRequest) bool

func (*Policy) ApprovedByUser

func (p *Policy) ApprovedByUser(team *ds.Team, mr *ds.MergeRequest, byAll ...*ds.BasicUser) bool

func (*Policy) ProcessChanges

func (p *Policy) ProcessChanges(team *ds.Team, mr *ds.MergeRequest) (err error)

type Repository

type Repository interface {
	// PolicyMetadata returns policy metadata for the given merge request
	PolicyMetadata(mr *ds.MergeRequest, team *ds.Team, policy ds.PolicyName) (bson.Raw, error)
	// UpdatePolicyMetadata updates policy metadata for the given merge request
	UpdatePolicyMetadata(mr *ds.MergeRequest, team *ds.Team, policy ds.PolicyName, d bson.Raw) error
}

Jump to

Keyboard shortcuts

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