Skip to content

feat(ci): auto-assign issues based on area labels#513

Merged
mchmarny merged 6 commits into
mainfrom
feat/auto-assign-by-area
Apr 9, 2026
Merged

feat(ci): auto-assign issues based on area labels#513
mchmarny merged 6 commits into
mainfrom
feat/auto-assign-by-area

Conversation

@mchmarny

@mchmarny mchmarny commented Apr 8, 2026

Copy link
Copy Markdown
Member

Summary

  • Add area_assignees map to .settings.yaml mapping each area/* label to a team member
  • Update triage.yaml workflow to auto-assign issues when an area label is applied
  • Fetches .settings.yaml via GitHub API — no checkout or yq dependency needed

Test plan

  • Verify workflow syntax passes actionlint
  • Add an area/cli label to a test issue and confirm lockwobr is assigned
  • Add multiple area labels to an issue and confirm each mapped user is assigned

Add area-to-assignee mappings in .settings.yaml and update the
labeler workflow to automatically assign team members when area
labels are applied to PRs.
@mchmarny mchmarny requested a review from a team as a code owner April 8, 2026 23:21
@NVIDIA NVIDIA deleted a comment from github-actions Bot Apr 8, 2026
@github-actions

github-actions Bot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Coverage Report ✅

Metric Value
Coverage 74.5%
Threshold 70%
Status Pass
Coverage Badge
![Coverage](https://img.shields.io/badge/coverage-74.5%25-green)

No Go source files changed in this PR.

@mchmarny mchmarny self-assigned this Apr 8, 2026
@mchmarny mchmarny added this to the v0.12 milestone Apr 8, 2026
@yuanchen8911

yuanchen8911 commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Cross-Review Summary for PR #513

Reviewers: Claude Code, Codex, CodeRabbit + Integration Impact Analysis
Rounds: 1 + Codex dedicated session
Consensus reached: Yes

Confirmed Issues

# Severity File Description Confirmed By
1 Critical labeler.yaml yq is not installed on ubuntu-latest runners — workflow will fail with command not found. No setup step exists. Other workflows use .github/actions/setup-build-tools with install_yq: 'true'. All reviewers
2 High labeler.yaml:79-84 Uses issues.addAssignees (sets PR assignees) not pulls.requestReviewers. Assignees don't satisfy branch-protection reviewer requirements or trigger review-request notifications — the feature described in this PR does not actually work as intended. Codex, Reviewer B
3 Medium labeler.yaml:79-84 With sync-labels: true, area labels can be removed on subsequent pushes when changed files shift, but the code only ever calls addAssignees — it never removes stale assignees. Assignees drift from the current label set over time. Codex

Additional Findings

# Severity File Description
4 Low labeler.yaml No null guard — if area_assignees key is removed from .settings.yaml, JSON.parse returns null and assignees[label.name] throws TypeError. Add if (\!assignees) return;
5 Low labeler.yaml context.issue.number is undefined on workflow_dispatch trigger (pre-existing issue, but new code compounds it)
6 Low .settings.yaml Missing area labels/assignees for pkg/snapshotter, pkg/evidence, pkg/manifest, pkg/errors, pkg/k8s/
7 Low labeler.yaml Uses /tmp/area_assignees.json for cross-step data — combining into a single github-script step that parses YAML in JS would eliminate the yq dependency entirely (resolves #1, #4, #7)

Recommendation

Consider replacing the yq + /tmp file approach with a single github-script step that parses .settings.yaml directly in JavaScript (using js-yaml). This eliminates the yq dependency, the temp file, and the null-guard issue. Additionally, switch from issues.addAssignees to pulls.requestReviewers and add logic to remove stale reviewers on synchronize events.

Positive Observations

  • Sparse checkout for .settings.yaml only — minimal footprint
  • Pinned action SHAs with version comments — good supply chain practice
  • Clean config/logic separation
  • area_assignees keys correctly match all 10 labels in .github/labeler.yml

Cross-review by Claude Code + Codex + CodeRabbit

@yuanchen8911 yuanchen8911 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.

assign assignee or reviewer?

@mchmarny mchmarny changed the title feat(ci): auto-assign PR reviewers based on area labels feat(ci): auto-assign issue reviewers based on area labels Apr 8, 2026
@mchmarny

mchmarny commented Apr 8, 2026

Copy link
Copy Markdown
Member Author

assign assignee or reviewer?

This is for Issues, not PRs. The title got messed up. Since issues there also is no need for yq. @yuanchen8911 PTAL

Move area-based assignee logic to triage.yaml (issues, not PRs).
Revert labeler.yaml to original. Fetch .settings.yaml via GitHub
API to avoid yq dependency and checkout step.

Addresses review feedback on #513.
@mchmarny mchmarny changed the title feat(ci): auto-assign issue reviewers based on area labels feat(ci): auto-assign issues based on area labels Apr 8, 2026
@mchmarny mchmarny requested a review from yuanchen8911 April 8, 2026 23:43
@yuanchen8911

Copy link
Copy Markdown
Contributor

assign assignee or reviewer?

This is for Issues, not PRs. The title got messed up. Since issues there also is no need for yq. @yuanchen8911 PTAL

ack. should we automatically assign a reviewer for PR too?

@mchmarny

mchmarny commented Apr 8, 2026

Copy link
Copy Markdown
Member Author

ack. should we automatically assign a reviewer for PR too?

That one is kind of harder, ultimately we need a maintainer to ACK it anyway so probably not as urgent but we can look into this in a subsequent PR

@yuanchen8911

yuanchen8911 commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Cross-Review Summary for PR #513

Reviewers: Claude Code, Codex, CodeRabbit + Integration Analysis
Rounds: 1 + Codex follow-up
Consensus reached: Yes

Confirmed Issues

# Severity Finding Confirmed By
1 High Missing contents: read in job-level permissions — The job-level permissions block (L30-L31) only grants issues: write. In GitHub Actions, job-level permissions replace workflow-level permissions, so the workflow-level contents: read (L22-L23) does not apply. The repos.getContent() call (L74-L78) will fail with a 403. Fix: add contents: read to the job-level permissions. Claude Code + Codex + CodeRabbit
2 Low Hand-rolled YAML parser is narrow but functional — The regex (L81-L97) works correctly against the current .settings.yaml schema (L57-L67). Not a functional defect — maintainability note for future schema changes. Claude Code + Codex + CodeRabbit
3 Low Comment says "PRs" but workflow handles issues.settings.yaml L56: # Area Assignees (GitHub usernames assigned to PRs by area label) should say "issues" to match the trigger at L17-L20. Claude Code + Codex

Open Questions

  • Should area labels on PRs also trigger auto-assignment? Currently only fires on issues: [labeled], not pull_request_target: [labeled].
  • Should tools/check-tools add an exclusion for non-tool sections like area_assignees? Currently silently skips unknown tools.

Cross-review by Claude Code + Codex + CodeRabbit

mchmarny and others added 2 commits April 8, 2026 17:41
Add contents: read to job-level permissions so repos.getContent()
can fetch .settings.yaml. Fix comment to say "issues" not "PRs".
@mchmarny

mchmarny commented Apr 9, 2026

Copy link
Copy Markdown
Member Author

@yuanchen8911 all 3 comments should be resolved now

@mchmarny mchmarny enabled auto-merge (squash) April 9, 2026 00:44

@yuanchen8911 yuanchen8911 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.

/lgtm

@mchmarny mchmarny merged commit 42cfd26 into main Apr 9, 2026
20 of 22 checks passed
@mchmarny mchmarny deleted the feat/auto-assign-by-area branch April 9, 2026 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants