routing

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package routing reads which roles and gates run on which event, and which handoffs are allowed (docs/spec/routing.md). It decides nothing by itself.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddReviewer added in v0.9.0

func AddReviewer(repo string) (steps []string, changed bool, err error)

AddReviewer has the project's merge requests reviewed (ADR-0020): the reviewer is added at the end of the project's merge-request line, or of the shipped one when the project routes none. It returns the steps the line runs afterwards, and whether the file changed.

func RoutePrePush

func RoutePrePush(repo string) (steps []string, changed bool, err error)

RoutePrePush has the project's .workline/config.yaml route pre-push to the committer and the documentalist, unless it routes pre-push already: then it is the project's choice, left as it is. It returns the steps pre-push runs afterwards, and whether the file changed. The file is appended to when it has no routing yet, so what a person wrote stays as they wrote it.

func SetAutonomy added in v0.13.0

func SetAutonomy(repo, level string) (string, bool, error)

SetAutonomy sets the product owner's autonomy level in the project's .workline/config.yaml (ADR-0026), unless the project set one already: then it is the project's choice, returned as it is. It returns the level in force afterwards, and whether the file changed.

Types

type Config

type Config struct {
	Events      map[string][]string `yaml:"events"`
	Handoffs    *[]Edge             `yaml:"handoffs"`
	MaxHandoffs int                 `yaml:"max-handoffs"`
}

Config is the line: steps per event, and the allowed handoffs.

func Load

func Load(repo string) (*Config, error)

Load returns the shipped routing with the project's changes applied.

func (*Config) Allowed

func (c *Config) Allowed(from, to string) bool

Allowed reports whether role from may hand over to role to.

func (*Config) Follows added in v0.20.0

func (c *Config) Follows(first, then string) bool

Follows reports whether a line runs role then after role first, in the same event's steps: the reviewer after the product owner reads the specs it refined (#128).

type Edge

type Edge struct {
	From string `yaml:"from"`
	To   string `yaml:"to"`
}

Edge is one handoff a role may ask for.

Jump to

Keyboard shortcuts

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