8000 Auto-labeling issues by ahus1 · Pull Request #53232 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Auto-labeling issues - #53232

Draft
ahus1 wants to merge 2 commits into
keycloak:mainfrom
ahus1:is-53231-auto-label-issues
Draft

ahus1 wants to merge 2 commits into
keycloak:mainfrom
ahus1:is-53231-auto-label-issues

Conversation

@ahus1
@ahus1 ahus1 commented Sep 26, 2026 •
Copy link
Copy Markdown
Member

@ahus1 ahus1 self-assigned this Sep 26, 2026
@ahus1
ahus1 requested a balanced review from Copilot September 26, 2026 12:26
Copilot AI 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.

Copilot review overview

🔵 Needs a closer look

The new privileged scheduled automation uses AI classifications to mutate issue metadata and warrants human validation.

Review effort: Balanced
Findings: None

What changed in this PR

Adds a scheduled and manually triggered GitHub Actions workflow that uses GitHub Copilot to assign missing issue types and area labels.

Changes:

  • Adds a 15-minute issue-triage workflow with dry-run and single-issue options.
  • Adds template-based and Copilot-based issue type/area classification.
  • Restricts area assignment to labels mapped to teams.
File Description
.github/​workflows/​issue-triage.yml Schedules and runs automated issue triage.
.github/​scripts/​auto_label.py Fetches, classifies, and labels eligible issues.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@shawkins
Copy link
Copy Markdown
Contributor

@ahus1 see also the related #51034

@ahus1
ahus1 commented Sep 28, 2026
Copy link
Copy Markdown
Member Author

Feedback:

  • add a label "triaged by bot"
  • Run every 24 hours only

@ahus1
ahus1 commented Sep 30, 2026
Copy link
Copy Markdown
Member Author

@shawkins - this is only labeling issues based on their content, so I'd say there is no overlap.

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

The area query exceeds GitHub search limits, while several classification paths can mislabel issues or abort processing.

Review effort: Balanced
Findings: 1 High severity

Open (1)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Distinguish feature requests from enhancements

.github/​scripts/​auto_label.py:201

This collapses every new capability into enhancement, although the repository has distinct feature and enhancement issue types and templates. Untyped feature requests will be assigned the wrong type; add feature to the prompt and validation, and stop treating every ### Value Proposition body as an enhancement.

Comment thread .github/scripts/auto_label.py Resolved
@shawkins
Copy link
Copy Markdown
Contributor

@shawkins - this is only labeling issues based on their content, so I'd say there is no overlap.

Agreed there's no overlap yet. I'm just calling it out as related as that other PR / efforts are the automated triage umbrella as well.

And in general I'd like to keep that effort moving forward with additional input as PR pre-triage efforts have been slowly moving.

Copilot AI 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.

🔵 Needs a closer look

Single-issue area assignment, malformed-response handling, and recovery from partial updates need correction.

0 open findings

1 resolved since last review
Previously missed (3)

In code that hasn't changed since last review

Medium severity Validate LLM response shape and field types

.github/​scripts/​auto_label.py:332

parse_llm_response accepts any JSON value: ["bug"] crashes at parsed.get, and {"area": ["authentication"]} crashes during set membership. Validate that the response is an object and its requested fields are strings so a malformed Copilot reply skips classification instead of terminating the batch.

Medium severity Make partial type labeling retryable

.github/​scripts/​auto_label.py:497

If setting an unlabeled issue's type succeeds but adding status/triage fails, subsequent scheduled runs skip it in both steps: it now has a type but lacks the required triage label. Make this transition retryable, for example by having add_labels report success and setting the type only after the required labels are applied.

Medium severity Newly classified bugs skip area assignment

.github/​scripts/​auto_label.py:498

With --issue, an untyped issue without kind/bug can be classified as a bug after step2_issues has already been set to an empty list, so the real run skips the area assignment shown by its dry run. Enqueue newly classified bugs that lack an area for step 2.

🧠 Review effort: Balanced

Copilot AI 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.

🔵 Needs a closer look

Manual runs bypass the sub-issue exclusion, and single-issue dry runs can preview changes that live runs would skip.

0 open findings

Previously missed (2)

In code that hasn't changed since last review

Medium severity Manual issue runs process sub-issues despite parent exclusion

.github/​scripts/​auto_label.py:421

The --issue path never checks for a parent, so an untyped sub-issue can receive a bug/enhancement type and triage labels despite the documented exclusion and the no:parent-issue filter in both scheduled searches. Fetch and check the parent relationship before constructing either pass's candidates, and skip sub-issues in manual runs too.

Medium severity Dry-run queues ineligible type, triage, and area changes

.github/​scripts/​auto_label.py:446

--issue N --dry-run queues both passes unconditionally, so an already typed enhancement with an existing area can be reported as receiving type, triage, and area changes even though the same live invocation changes nothing. Share eligibility checks between both modes and carry simulated Step 1 type changes into Step 2 so the workflow's default preview reflects the actual run.

🧠 Review effort: Balanced

@ahus1
ahus1 commented Oct 22, 2026
Copy link
Copy Markdown
Member Author

Reworked this to be a GitHub agentic workflow.

It works, but is a bit bloated. But with the guardrails and everything safer than running copilot directly.

image

It set the labels, but in my personal repo it couldn't set the issue types as they are an organization feature.

Closes keycloak#53231

Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
@ahus1
ahus1 force-pushed the is-53231-auto-label-issues branch from 4fbc9c9 to 11e79ed Compare October 22, 2026 10:51
@ahus1
ahus1 requested a balanced review from Copilot October 22, 2026 10:51
Copilot AI 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.

🟡 Changes recommended

Write targets need single-issue enforcement, and recurring issue discovery and dispatch are missing.

2 open issues

Review effort: Balanced

Comment thread .github/workflows/issue-triage.md Resolved
Comment thread .github/workflows/issue-triage.md Resolved
Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
Copilot AI 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.

🔵 Needs a closer look

Processing untrusted issue content and applying privileged updates warrants human validation of the workflow’s end-to-end safeguards.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

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.

Create an auto-labeller that picks up issues without area and kind

3 participants

0