Skip to content

feat: configurable label prefixes; /lifecycle /stage /status with Prow defaults; /help and /good-first-issue - #137

Merged
jeefy merged 4 commits into
mainfrom
feat/configurable-label-prefixes
Sep 11, 2026
Merged

feat: configurable label prefixes; /lifecycle /stage /status with Prow defaults; /help and /good-first-issue#137
jeefy merged 4 commits into
mainfrom
feat/configurable-label-prefixes

Conversation

@jeefy

@jeefy jeefy commented Sep 11, 2026

Copy link
Copy Markdown
Member

Description

Tier 2 of the Prow parity work. Finishes the label plugin and makes label prefixes configurable, so a repo like cncf/automation gets /status, /level, /triage, /tag, /sub … with zero code.

feat(labels): configurable label sections with exclusive groups

  • Any top-level key in .prowlabels.yaml becomes a /<key> command (plus /remove-<key>) when listed in prow-commands. Sections are either a plain list of values or a mapping:
    level:
      values: [sandbox, incubation, graduation, archived]
      exclusive: true    # applying one removes the other level/* labels
  • New getLabelConfig loader normalizes both forms; malformed sections fail with a clear message. getArgumentLabels remains as a thin wrapper (existing error strings preserved).
  • Dispatcher order: built-in registry → fixed commands → hand-written handlers → dynamic (^/[a-z][a-z0-9-]*$, not a known handler) → the old "could not execute" error for anything else. /remove-<name> resolves to /<name> only for label commands — /remove-assign does not become /assign (pinned).
  • One existing assertion changed: the "unsupported command" test used /not-a-command, which is now a valid dynamic name; it uses /not_a_command, and the dashed case is pinned separately as a missing-yaml-key error.

feat: /lifecycle, /stage and /status with Prow defaults

Registry entries with Prow's fixed value sets — frozen|stale|rotten, alpha|beta|stable, approved-for-milestone|in-progress|in-review — all mutually exclusive as in Prow. A yaml section with the same key overrides the defaults (so cncf/automation's different /status values just work).

feat: /help and /good-first-issue

Prow's help plugin, exactly: /helphelp wanted; /good-first-issuegood first issue + help wanted; /remove-help removes both; /remove-good-first-issue removes only good first issue. Label names with spaces can't go through the arg-based engine, so these are fixed commands (no yaml involved — asserted no contents fetch).

feat(labels): match allowlist values case-insensitively

/kind Cleanupkind/cleanup (allowlist casing wins), incl. exclusive-sibling and /remove- comparisons against labels already on the issue.

Dogfood: .prowlabels.yaml gains a mapping-form triage section; /lifecycle /help /triage added to this repo's prow-commands. Docs: labeling.md documents both forms, exclusive, defaults/overrides, and a cncf/automation-style example; commands.md rows added.

Testing

Follow-ups deliberately not in this PR

Tier 3/4 from the gap analysis: approved label + merge gate, do-not-merge/hold naming option, @org/team expansion, /auto-cc, review-event lgtm.

Any top level key of .prowlabels.yaml is now a /<key> (and /remove-<key>)
label command once it is listed in prow-commands, so downstream repos can
add their own label families without code changes. A section is either a
plain list of values or a mapping { values: [...], exclusive: bool }; a
yaml `exclusive` wins over the registry default. The dispatcher resolves
/remove-<key> to /<key> for such names after the pinned alias table, and
the hand-written command switch becomes a lazily bound handler map so
those names are never treated as label commands.

The pr-labeler cron reads .github/labels.yaml, not .prowlabels.yaml, so its
test gets its own glob fixture instead of sharing the label one.

Signed-off-by: Jeffrey Sica <me@jeefy.dev>
Register the three Prow fixed-value label commands with their upstream
values (frozen/stale/rotten, alpha/beta/stable,
approved-for-milestone/in-progress/in-review). All are exclusive like the
Prow plugins that remove sibling labels. A matching .prowlabels.yaml
section replaces the built-in values, and its mapping form can turn the
exclusive behaviour off.

Signed-off-by: Jeffrey Sica <me@jeefy.dev>
Port Prow's help plugin. /help adds `help wanted`; /good-first-issue adds
`good first issue` together with `help wanted`; /remove-help strips both
and /remove-good-first-issue only `good first issue`. GitHub's default
names contain spaces, so these commands are fixed and never read
.prowlabels.yaml.

Signed-off-by: Jeffrey Sica <me@jeefy.dev>
Prow compares labels without regard to case and GitHub label names are
case-insensitive. `/kind Bug` now matches the allowlist value `bug` and
applies the yaml's canonical casing; duplicate spellings collapse to one
label. Labels already on the issue are compared the same way when an
exclusive command picks siblings to replace or a /remove- form picks
labels to delete, and the delete uses the issue's own casing.

Signed-off-by: Jeffrey Sica <me@jeefy.dev>
@jeefy
jeefy requested a review from jpmcb as a code owner September 11, 2026 00:51
@jeefy
jeefy merged commit 78b07b0 into main Sep 11, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant