owners

package
v0.53.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapToActorRole

func MapToActorRole(role Role, currentRole normevent.ActorRole) normevent.ActorRole

MapToActorRole upgrades currentRole based on the OWNERS role. An approver gets at least write; a reviewer gets at least triage. Never downgrades — if the collaborator API already granted a higher role, it is preserved.

Types

type Role

type Role int

Role is the OWNERS-file role for a resolved user.

const (
	RoleNone     Role = iota
	RoleReviewer      // triage-equivalent
	RoleApprover      // write-equivalent
)

func Resolve

func Resolve(ownersPath, aliasesPath, username string) (Role, error)

Resolve checks whether username appears in the OWNERS file at ownersPath (directly or via aliases in aliasesPath). Returns RoleApprover if the user is an approver, RoleReviewer if only a reviewer, or RoleNone if not listed. Matching is case-insensitive.

A missing OWNERS file returns an error. A missing OWNERS_ALIASES file is not an error — alias resolution is skipped. A malformed OWNERS_ALIASES file is an error: without it, alias keys cannot be told apart from logins.

func (Role) String

func (r Role) String() string

Jump to

Keyboard shortcuts

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