Expand description
Issue (and pull request) labels: GitHub’s default set, owner-only CRUD, per-item assignment, list filtering, rename / delete cascades and the luminance-aware chip helpers.
Follows the JSS forge behaviour (labelDefs, ensureLabels,
resolveLabels, apiLabel*, apiItemLabels, labelTextColor,
labelChips), cited by name only. The per-repo label set lives in the
issue index file (crate::spine::issues::IssueIndex::labels); the
defaults apply until the first label write materialises them. Items store
label names, so a recolour needs no cascade; rename and delete cascade
over issues and pulls.
§Reuse by pull requests
Pull requests keep their own index (pulls/<owner>/<repo>.json, kind
PULLS_KIND) whose items carry a labels name array. The cascade and the
PUT …/labels handler therefore work on that file as raw JSON, with no
dependency on a pull-request type: a pull-request route only has to call
ForgeService::put_item_labels with ItemKind::Pull, and the label
CRUD routes already keep pull labels consistent. Pull writes take
crate::locks::ForgeLocks::pulls after the issue lock.
Enums§
- Item
Kind - Which index an item label operation targets.
Constants§
- DEFAULT_
LABELS - GitHub’s default label set, in JSS order.
- LABELS_
PER_ ITEM - Most labels one item may carry.
- PULLS_
KIND - Spine kind of the pull-request index.
Functions§
- chips_
html - Rounded chips for resolved labels (everything escaped; the colour is re-validated so a corrupt index cannot inject into the style attribute).
- default_
labels - The default set as
Labels. - effective_
labels - The effective label set: the materialised one, or the defaults.
- ensure_
labels - First label write materialises the defaults into the index.
- remove_
from - Drop
namefrom a name list; true when something changed. - rename_
in - Rename
oldtonewin a name list; true when something changed. - resolve_
labels - Item label names to
{name, color}againstdefs; a name with no definition keeps the neutralededed. - text_
color - Perceptual-luminance text colour for a chip (GitHub style): dark text on
bright backgrounds, white on dark ones.
hexmust be six hex digits. - valid_
label_ color - Exactly six hex digits.
- valid_
label_ name - 1 to 50 characters, none of them control characters.