Skip to content

feat: label issues and PRs with a small model - #29

Merged
chrip merged 6 commits into
mainfrom
feat/ai-label
Nov 11, 2026
Merged

chrip merged 6 commits into
mainfrom
feat/ai-label

Conversation

@juliusknorr

@juliusknorr juliusknorr commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Adds scripts/ai-label.sh to label open issues and PRs that have no label (515 across the org today), runnable locally and as a workflow template for new items.

  • Dependency PRs (Renovate, Dependabot, (deps) scope) get dependencies without a model call
  • Everything else: small model picks (conventional commit type as a hint) from an allowlist, enforced in code:
    • type, max 1: bug, enhancement, documentation, question
    • area, max 2: build, dependencies (incl. third-party code like CEF, V8, boost, 3dparty/), docker, packages, tests, design, performance, security, i18n, integration, format: odf|ooxml|pdf
    • extras: linux, windows, macos, mobile, regression, high (high severity)
  • Only adds labels the repo has, never removes. Dry runs list labels the repo still lacks
  • Backend: GitHub Models (GITHUB_TOKEN, models: read) in Actions, Haiku locally via the CLI with no tools, no MCP and no settings, so issue text can't run anything
  • --triage (local only): drafts a first reply, possible duplicates, missing info. Never accepts, declines or closes. --post asks per draft before posting
  • Flags: --prs, --issues, --repo, --item, --limit, --dry-run
  • sync-labels.sh: adds the new labels (performance, linux, windows, macos reuse existing colors), skips repos with issues disabled (GHSA advisory forks reject labels). Already run org-wide from this branch
  • workflow-templates/ai-label.yml runs it on opened issues and PRs, never checks out PR code
  • AI_POLICY.md: one line on maintainer AI labeling and reviewed triage drafts
scripts/ai-label.sh --dry-run --repo Euro-Office/server
scripts/ai-label.sh --triage --post --item Euro-Office/DocumentServer#500
scripts/test-ai-label.sh

Tested: self-check (19 checks, stubbed gh and model), dry runs with Haiku on server, DocumentServer and DesktopEditors (157 items) with two prompt iterations, triage draft on DocumentServer#500, shellcheck and zizmor clean. Not yet tested: the live GitHub Models call and the workflow in a real repo.

After merge: a reviewed backlog run, then sync-workflow.sh --template ai-label.

AI-assisted, see Assisted-by trailer.

@juliusknorr

Copy link
Copy Markdown
Member Author

Quick test run on desktop-sdk

# Title Labels applied
34 feat(cef): port to CEF 156 enhancement, dependencies, linux
31 fix: stop Chromium downloading spellcheck dictionaries from Google bug, dependencies, security, linux
30 feat: check signing certificate and key files enhancement, tests
29 ci: run the AI agent plugin's build and unit tests build, tests
28 test: add file locker suite enhancement, tests, linux
27 test: add AES-256 and crypto-mode suite tests
26 test: add unit test setup tests, build
24 feat: send a per-portal Authorization header with requests enhancement, security
23 fix(wayland): paste from system clipboard in login windows bug, linux
13 Replace removed boost::filesystem::wpath with path bug, dependencies, windows
12 In-process CDP bridge for the command gateway (#57) enhancement
7 fix: (mac_videoplayer)restore previous volume on unmute bug
6 fix: (mac_videoplayer)toggleMute does not restore volume on second call bug, macos

scripts/ai-label.sh labels open unlabeled issues and PRs org-wide, per
repo or per item. PRs use their conventional commit prefix, the rest
asks GitHub Models in Actions or Claude Haiku locally (no tools). Model
output is limited to an allowlist and to labels the repo has.

--triage drafts a first reply locally, a maintainer reviews it before
posting. Adds regression and high severity labels and the ai-label
workflow template.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Julius Knorr <jus@bitgrid.net>
Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Julius Knorr <jus@bitgrid.net>
Groups model labels into type (max 1), area (max 2) and extras, enforced in code. Adds performance, security, i18n, integration, format: pdf, linux, windows, macos and mobile, renames high severity to high. Dry runs report labels a repo still lacks. fix(ci) and fix(build) PRs get build.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Julius Knorr <jus@bitgrid.net>
Temporary GHSA advisory forks have issues disabled and reject label creation.

No-test: one-line repo filter, verified with a dry run (45 repos, no GHSA forks)

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Julius Knorr <jus@bitgrid.net>
The conventional commit type is now a hint in the prompt, so PRs also get area and platform labels. Dependency update PRs still skip the model.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Julius Knorr <jus@bitgrid.net>
Covers CEF, V8, boost, Qt and anything under 3dparty/ or 3rdparty/, not only bot update PRs.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Julius Knorr <jus@bitgrid.net>
@juliusknorr
juliusknorr marked this pull request as ready for review November 11, 2026 11:41
@juliusknorr
juliusknorr requested a review from chrip November 11, 2026 12:45
@juliusknorr juliusknorr added enhancement New feature or request organizational labels Nov 11, 2026

@chrip chrip left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve. Looks good to merge.

This adds a script and a workflow template that label new issues and PRs with a small model, plus the new labels in sync-labels.sh. I read the workflow and the script for injection risks and found none. The workflow uses pull_request_target, but it never checks out PR code and uses no third-party actions. Only the repo name and the item number go into env, and no issue or PR text reaches a run line. That text reaches the model only on stdin, and the model's answer is cut down to the allowlist and to labels the repo already has, so a prompt injection can at worst pick wrong labels from that list. In Actions the script never comments, and labels added with the workflow token don't start other workflows, so nobody gets pinged. The workflow loads ai-label.sh from main of this repo at run time, so a script change goes live in every repo as soon as it is merged here. That's fine while main here stays protected.

suggestion: Try the workflow in one repo before rolling it out to all of them. The live GitHub Models call hasn't been tested yet, and if Models is off for the org or the token can't use it, every new issue and PR in every repo gets a failing run. The "Sync workflow template to repos" workflow takes template: ai-label with a single repo in repos.

nitpick (non-blocking): workflow-templates/ai-label.yml sets no timeout-minutes, and the curl call at scripts/ai-label.sh:66 has no --max-time. A hung request keeps the job running until the six-hour default. timeout-minutes: 5 on the job would cover it.

praise: The allowlist leaves out no-tests-needed, wontfix and the other labels that change what happens to an item, so an injected issue can't switch off the require-tests check. The end-to-end test with an injected issue body shows the allowlist holds.

Assisted-by: ClaudeCode:claude-opus-5-5

@chrip
chrip merged commit 0f90844 into main Nov 11, 2026
2 checks passed
@chrip
chrip deleted the feat/ai-label branch November 11, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request organizational

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants