From 539ac2bc01214cbab2903942c919d6d23bf3a6ba Mon Sep 17 00:00:00 2001 From: ryan-crabbe-berri Date: Thu, 17 Sep 2026 17:03:09 -0700 Subject: [PATCH] ci(issue-classifier): name every workflow, script and job after the issue it works on Everything this stack adds now carries issue in its file name, workflow name and job id, so one search finds all of it: ls .github/workflows/issue_* grep -ril issue scripts .github/prompts .github/*.json Renames: label_sync.yml -> issue_label_sync.yml, label_claude_code.yml -> issue_label_claude_code.yml, .github/labels.json -> .github/issue-labels.json, scripts/sync-labels(.test).ts -> scripts/sync-issue-labels(.test).ts. Job ids now match the script they run: classify-issue-tests, classify-issue, label-issue, sync-issue-labels-tests, sync-issue-labels, label-claude-code --- .github/{labels.json => issue-labels.json} | 0 .github/workflows/issue_classifier.yml | 4 ++-- ...e_code.yml => issue_label_claude_code.yml} | 2 +- .../{label_sync.yml => issue_label_sync.yml} | 24 +++++++++---------- scripts/issue-labels.ts | 2 +- scripts/label-issue.ts | 2 +- ...bels.test.ts => sync-issue-labels.test.ts} | 2 +- .../{sync-labels.ts => sync-issue-labels.ts} | 0 8 files changed, 18 insertions(+), 18 deletions(-) rename .github/{labels.json => issue-labels.json} (100%) rename .github/workflows/{label_claude_code.yml => issue_label_claude_code.yml} (94%) rename .github/workflows/{label_sync.yml => issue_label_sync.yml} (77%) rename scripts/{sync-labels.test.ts => sync-issue-labels.test.ts} (99%) rename scripts/{sync-labels.ts => sync-issue-labels.ts} (100%) diff --git a/.github/labels.json b/.github/issue-labels.json similarity index 100% rename from .github/labels.json rename to .github/issue-labels.json diff --git a/.github/workflows/issue_classifier.yml b/.github/workflows/issue_classifier.yml index 43f5664f47a..842e4c40b5e 100644 --- a/.github/workflows/issue_classifier.yml +++ b/.github/workflows/issue_classifier.yml @@ -13,7 +13,7 @@ on: - .github/workflows/issue_classifier.yml - .github/prompts/issue-classifier.md - .github/prompts/issue-classifier.schema.json - - .github/labels.json + - .github/issue-labels.json - .github/ISSUE_TEMPLATE/bug_report.yml - .github/ISSUE_TEMPLATE/feature_request.yml - scripts/classify-issue.ts @@ -31,7 +31,7 @@ concurrency: cancel-in-progress: false jobs: - classifier-tests: + classify-issue-tests: if: github.event_name == 'pull_request' runs-on: ubuntu-latest timeout-minutes: 5 diff --git a/.github/workflows/label_claude_code.yml b/.github/workflows/issue_label_claude_code.yml similarity index 94% rename from .github/workflows/label_claude_code.yml rename to .github/workflows/issue_label_claude_code.yml index cbfecc316ef..6c88433bc21 100644 --- a/.github/workflows/label_claude_code.yml +++ b/.github/workflows/issue_label_claude_code.yml @@ -1,4 +1,4 @@ -name: Label Claude Code issues +name: Issue label claude code on: issues: diff --git a/.github/workflows/label_sync.yml b/.github/workflows/issue_label_sync.yml similarity index 77% rename from .github/workflows/label_sync.yml rename to .github/workflows/issue_label_sync.yml index 67102ba58b7..870dab373d4 100644 --- a/.github/workflows/label_sync.yml +++ b/.github/workflows/issue_label_sync.yml @@ -1,11 +1,11 @@ -name: Label sync +name: Issue label sync on: push: branches: [main] paths: - - .github/labels.json - - scripts/sync-labels.ts + - .github/issue-labels.json + - scripts/sync-issue-labels.ts workflow_dispatch: inputs: dry_run: @@ -14,16 +14,16 @@ on: default: true pull_request: paths: - - .github/workflows/label_sync.yml - - .github/labels.json - - scripts/sync-labels.ts - - scripts/sync-labels.test.ts + - .github/workflows/issue_label_sync.yml + - .github/issue-labels.json + - scripts/sync-issue-labels.ts + - scripts/sync-issue-labels.test.ts - scripts/issue-labels.ts permissions: {} jobs: - sync-tests: + sync-issue-labels-tests: if: github.event_name == 'pull_request' runs-on: ubuntu-latest timeout-minutes: 5 @@ -41,9 +41,9 @@ jobs: bun-version: "1.4.0" - name: Test the sync - run: bun test scripts/sync-labels.test.ts + run: bun test scripts/sync-issue-labels.test.ts - sync: + sync-issue-labels: if: github.event_name != 'pull_request' && github.repository == 'BerriAI/litellm' runs-on: ubuntu-latest timeout-minutes: 5 @@ -65,8 +65,8 @@ jobs: # Exact version, never latest: the next step holds an issues: write token bun-version: "1.4.0" - - name: Create or recolour every label in .github/labels.json - run: bun run scripts/sync-labels.ts + - name: Create or recolour every label in .github/issue-labels.json + run: bun run scripts/sync-issue-labels.ts env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run == true }} diff --git a/scripts/issue-labels.ts b/scripts/issue-labels.ts index a216bca804b..a39f4efa160 100644 --- a/scripts/issue-labels.ts +++ b/scripts/issue-labels.ts @@ -1,4 +1,4 @@ -import manifest from "../.github/labels.json"; +import manifest from "../.github/issue-labels.json"; export const NAMESPACES = ["domain", "provider", "kind", "priority", "lift", "needs"] as const; export type Namespace = (typeof NAMESPACES)[number]; diff --git a/scripts/label-issue.ts b/scripts/label-issue.ts index 05a933755df..ce18b6ee2c1 100644 --- a/scripts/label-issue.ts +++ b/scripts/label-issue.ts @@ -97,7 +97,7 @@ export function parseVerdict(raw: string): ParsedVerdict { const known = new Set(manifestLabels(MANIFEST).map((label) => label.name)); const unknown = desiredLabels(verdict).filter((label) => !known.has(label)); if (unknown.length > 0) { - return { kind: "invalid", reason: `not in .github/labels.json: ${unknown.join(", ")}` }; + return { kind: "invalid", reason: `not in .github/issue-labels.json: ${unknown.join(", ")}` }; } return { kind: "verdict", verdict }; } diff --git a/scripts/sync-labels.test.ts b/scripts/sync-issue-labels.test.ts similarity index 99% rename from scripts/sync-labels.test.ts rename to scripts/sync-issue-labels.test.ts index aed3dfc9cd5..1c0441d5308 100644 --- a/scripts/sync-labels.test.ts +++ b/scripts/sync-issue-labels.test.ts @@ -2,7 +2,7 @@ import { describe, expect, test } from "bun:test"; import type { GitHubApi } from "./auto-close-duplicates"; import { MANIFEST, manifestLabels, type Manifest } from "./issue-labels"; -import { readConfig, syncLabels, syncPlan, type GitHubLabel } from "./sync-labels"; +import { readConfig, syncLabels, syncPlan, type GitHubLabel } from "./sync-issue-labels"; const small: Manifest = { domain: { caching: { color: "1C6E5B", description: "Response cache" } }, diff --git a/scripts/sync-labels.ts b/scripts/sync-issue-labels.ts similarity index 100% rename from scripts/sync-labels.ts rename to scripts/sync-issue-labels.ts