litellm/scripts/issue-labels.ts
ryan-crabbe-berri 294a9e15de ci: classify new issues into domain, provider, kind, priority and lift labels
Every issue opened from now on is gated on the template headings, sent once
through the LiteLLM proxy with a strict JSON schema, and labelled from the
manifest in .github/labels.json. Old-template issues are not touched. The bug
template shrinks to Description, Config, LiteLLM Version and Steps to Repro,
both templates gain a domain dropdown, and the labelers that keyed off the old
component dropdown go away.
2026-09-18 11:37:55 -07:00

32 lines
1,023 B
TypeScript

import manifest from "../.github/labels.json";
export const NAMESPACES = ["domain", "provider", "kind", "priority", "lift", "needs"] as const;
export type Namespace = (typeof NAMESPACES)[number];
export interface LabelSpec {
readonly color: string;
readonly description: string;
}
export type Manifest = Readonly<Record<Namespace, Readonly<Record<string, LabelSpec>>>>;
export interface ManifestLabel extends LabelSpec {
readonly name: string;
}
export const MANIFEST: Manifest = manifest;
export function labelName(namespace: Namespace, value: string): string {
return `${namespace}:${value}`;
}
export function namespaceOf(label: string): Namespace | undefined {
const prefix = label.split(":")[0];
return NAMESPACES.find((namespace) => namespace === prefix);
}
export function manifestLabels(source: Manifest): readonly ManifestLabel[] {
return NAMESPACES.flatMap((namespace) =>
Object.entries(source[namespace]).map(([value, spec]) => ({ name: labelName(namespace, value), ...spec })),
);
}