Documentation
¶
Index ¶
- Constants
- Variables
- func Cell(p, e int) string
- func EffortAnchor(l int) string
- func EffortValue(l int) string
- func PriorityName(l int) string
- func Said(l int) string
- func Stuck(s Scale, levels []int) string
- func Use(s Scheme)
- func Value(l int) string
- func Weight(w int) int
- func WeightOf(l int) int
- type Family
- type Field
- type Label
- type On
- type Scale
- type Scheme
- type Setting
- type Source
Constants ¶
const ( InAuto = "auto" InLabels = "labels" InField = "field" InWeight = "weight" )
How a setting says where an axis is kept: detected, a family of labels named by its prefix, a field named, or GitLab's weight (the effort only).
const HiddenSaid = "a level hidden here"
HiddenSaid says a value visible to an organisation's members only, on a public repository: set, never shown (ADR-0040).
const WeightSaid = "GitLab's weight"
WeightSaid names GitLab's weight where the role says an effort is kept.
Variables ¶
var ( Priority = Scale{Axis: "priority", Names: []string{"Urgent", "High", "Medium", "Low"}, None: 5, /* contains filtered or unexported fields */} Effort = Scale{Axis: "effort", Names: []string{"Low", "Medium", "High"}, None: 2, /* contains filtered or unexported fields */} )
The two scales (ADR-0040, "Two axes, the forge's levels, read by name").
var Before = Scheme{Priority: Source{Family: Own, Said: ownSaid}, Effort: Source{Family: Family{Scale: Effort}}}
Before is the scheme before ADR-0040's detection, a project's setting unset: workline's own priority labels; no effort, read nowhere.
var Own = own()
Own is workline's own priority labels, workline:priority/1, the most pressing, to /4, the most pressing the warmest: the family the role writes until ADR-0040's detection finds a project's.
var Used = Before
Used is the scheme the engine reads and writes issues with: Before, until Use sets the one detected on the project a process reads.
var WeightFamily = weightFamily()
WeightFamily is GitLab's weight as a family: each level and the weight written for it, "weight 1" to "weight 5", as the role's texts say it. An issue's weight is read in bands (Weight), never by these names.
Functions ¶
func Cell ¶ added in v0.34.0
Cell is an issue's place in the value-vs-effort grid, as Next says it: "High · Effort Low → quick win"; a value missing said so, "no priority, effort not estimated".
func EffortAnchor ¶ added in v0.34.0
EffortAnchor is what an effort level means to build: hours, days, weeks; "" for none.
func EffortValue ¶ added in v0.34.0
EffortValue is an effort level as the role's texts say it: its name, and the label that carries it ("Low (effort/small)"); "not estimated" for none.
func PriorityName ¶ added in v0.34.0
PriorityName is a priority level by its name; "no priority" for none.
func Stuck ¶ added in v0.34.0
Stuck says an axis's estimates stuck on one value (ADR-0040): past 10 values set, one over 60% of them, said "Medium on 8 of the 11"; "" when not.
func Use ¶ added in v0.34.0
func Use(s Scheme)
Use sets the scheme the engine reads and writes issues with, detected on the project this process reads (Detect): a process reads one.
func Value ¶
Value is a priority level as the role's texts say it: its number, 1 the most pressing, as workline's own labels write it, and the label that carries it when the project keeps its own ("1 (P0)"); "none" for none.
Types ¶
type Family ¶
Family is where a project keeps an axis: labels that carry its levels, each read by its name, or a field's options. Prefix starts each label of a family of labels; "" for a field's options. Its labels are in the order of their levels: the first of a level is the one written.
func Labels ¶
Labels reads a project's family of labels by name: each label starting with prefix, its rest a number or a word. Numbers count from the family's own start, 0 when it has a 0, else 1 (Scale.Number): a family created a label at a time, its first label never made, still reads its second as the second level. A prefix ending in a letter or a digit takes numbers only — P0, effort1: hours —, so P-critical belongs to another family and Performance to none. A word no table knows carries no level, and the error names it, to be said once.
func Options ¶
Options reads a field's options by name, never by their position: a forge lists them as its owner arranged them, an Effort field heaviest first. An option no table knows carries no level, and the error names it, to be said once.
func Words ¶ added in v0.34.0
Words are the forge's words for an axis, created when the role first sets one: on GitHub, the fields' option names, priority/urgent to priority/low and effort/low to effort/high, so a repository moved to an organisation maps them one to one; on GitLab (scoped), the ranked priority::1 to ::4, its own "Label priority" sort then following the role's, and effort::low to ::high.
func (Family) First ¶
First is the first level in the order's direction names carry — the most pressing priority, the lightest effort —; 0 when they carry none.
func (Family) Label ¶
Label is the label written for level l: the family's first carrying it; ok is false when none does.
func (Family) Levels ¶
Levels are the levels names carry in the family, in the names' order; a name outside it carries none.
type Field ¶ added in v0.34.0
Field is a single-select issue field of the forge an axis may be kept in (ADR-0040): its options as its owner arranged them; Hidden, its values visible to the organisation's members only on a public repository, or a visibility not read; Blind, why this token reads no hidden value, "" when it does.
type Label ¶
Label is one name of a family and the level it carries. Color, About and Rank, for a label the role creates: its colour, what it says of itself, and its rank where the forge ranks labels — GitLab's prioritized labels, 1 listed first —, 0 for none.
type On ¶ added in v0.34.0
On is what an issue carries where an axis may be kept: its labels, its values in the forge's issue fields, by name, and its GitLab weight, nil for none.
type Scale ¶
type Scale struct {
Axis string
Names []string
// None is where an issue with no value ranks: after the last
// priority; an effort not estimated as the middle one.
None int
// contains filtered or unexported fields
}
Scale is an axis's levels in the order's direction: level 1 is the first name, the most pressing priority or the lightest effort, the last name the last level; 0 is none.
func (Scale) Number ¶
Number is the level of the number n in a family numbered from first, 0 or 1: first is the first level, each next number the next one, every number past the last level the last (P0 to P5: Urgent, High, Medium, then Low thrice); 0 below first.
type Scheme ¶
type Scheme struct {
Priority Source
Effort Source
// Detected: the project's settings asked where it keeps them
// (ADR-0040): each value is then set once, only where empty, and Next
// shows each issue's cell of the grid.
Detected bool
}
Scheme is where the engine reads each axis on a project.
type Setting ¶ added in v0.34.0
type Setting struct {
In string
Prefix string // with In "labels": the family's prefix
Field string // with In "field": the issue field's name
Names map[string]int // a label's name, of the family read, to the level the settings give it
}
Setting is where a project's settings say it keeps an axis. Unset (In ""), the engine reads as before the detection (Before).
func ReadSetting ¶ added in v0.34.0
ReadSetting reads an axis's setting: unset, `auto`, or a map — `in` (auto, labels, field, or weight for the effort), `prefix` with labels, `name` with field, `names` mapping a label of the family to a level. Anything else is an error, never read as unset.
type Source ¶ added in v0.34.0
type Source struct {
Family Family
// Said is where, as the run's summary says it: "labels P0 to P3, the
// project's"; "" when the axis is read nowhere.
Said string
// Words: the forge's words, each created when the role first sets
// one — all of them, ranked where the forge ranks labels.
Words bool
// Others are the axis's other families on the project: read to tell
// a value kept in another place, never written.
Others []Family
// Unknown names the labels of the family no table knows, nor the
// settings map: read as none, said once.
Unknown error
// Field: the issue field the axis is kept in, its Family its options;
// "" when it is kept in labels. OtherField, a field of the axis the
// project has beside the labels read: a value there is elsewhere.
Field Field
OtherField string
// Weight: the effort is kept in GitLab's weight (Premium, Ultimate),
// read in bands, written 1, 3 or 5, never on a parent (ADR-0040).
// OtherWeight: the project keeps a weight beside the labels read, a
// value there elsewhere.
Weight bool
OtherWeight bool
}
Source is where the engine reads and writes an axis on a project.
func Detect ¶ added in v0.34.0
func Detect(s Scale, set Setting, labels, open []string, scoped bool, fields []Field, weights bool) (Source, error)
Detect finds where a project keeps an axis (ADR-0040, "Where the values live"), with no agent. labels are the project's, open those on its open issues; scoped says the forge's labels are GitLab's; fields, its issue fields; weights, that its issues carry GitLab's weight. Unset, as before the detection (Before). Else the setting's field, weight or family; else the forge's own field named as the axis, Priority or Effort; else, for the effort, GitLab's weight; else the project's own family, two values or more and one on an open issue; else workline's own priority labels, one on an open issue; else the forge's words. A setting naming a field, a weight or a family the project lacks is an error: the run stops, never reading another.
func (Source) Elsewhere ¶ added in v0.34.0
Elsewhere are where an issue carries the axis outside its source — its labels of another family, or a field or a weight beside them —: a value there is never written over, nor mirrored (ADR-0040).
func (Source) Hidden ¶ added in v0.34.0
Hidden says whether the axis's values are visible to the organisation's members only, on a public repository: never shown in the role's comment, its state, nor the job's summary (ADR-0040).
func (Source) Native ¶ added in v0.34.0
Native says whether the axis is kept in the forge's own place, a field or GitLab's weight, rather than in labels.