Add domain/* labels and CODEOWNERS-based domain labeling#13
Open
bryanbeverly wants to merge 3 commits into
Open
Add domain/* labels and CODEOWNERS-based domain labeling#13bryanbeverly wants to merge 3 commits into
bryanbeverly wants to merge 3 commits into
Conversation
Define 7 domain/* labels (scanning, findings, integrations, platform, frontend, infra, database) in labels.yml with a teal color palette. Extend pr_labeler.py to fetch CODEOWNERS from the caller repo via the Contents API, parse it with last-match-wins semantics, match changed files to owning teams, and apply/remove domain/* labels accordingly. This avoids depending on mutable PR reviewer state and works across all repos that have a CODEOWNERS file. Repos without CODEOWNERS gracefully skip domain labeling. Unknown team slugs (e.g. eng-leads) are filtered out so only recognized domain labels are applied. 81 tests passing (26 new for CODEOWNERS parsing, matching, domain reconciliation). Jira: PLAT-222 Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5670c71. Configure here.
- Check for internal slashes before appending ** to trailing-slash patterns, so unanchored dirs like "vendor/" match at any depth - Search all three GitHub CODEOWNERS locations (.github/, root, docs/) in priority order instead of only the root Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
domain/*labels tolabels.yml(scanning, findings, integrations, platform, frontend, infra, database) with a teal color palettepr_labeler.pyto automatically applydomain/*labels by parsing the caller repo's CODEOWNERS file against the PR's changed filespr-labeler.ymlcallers pick this up automaticallyHow it works
CODEOWNERSvia the Contents API (single call, cached per run for backfill)gh pr view --json fileseng-leads)domain/*labels and removes stale onesTest plan
*not crossing/, deep paths)sync-labelsworkflow_dispatch on target repos to propagate label definitionsJira: PLAT-222
Made with Cursor
Note
Low Risk
Automation-only changes to GitHub labeling and label definitions; no product runtime or auth paths.
Overview
Adds seven
domain/*labels to the shared taxonomy and extendspr_labeler.pyso open PRs get those labels from CODEOWNERS, not from reviewer assignment.On each run the labeler loads CODEOWNERS once (Contents API, standard paths), loads the PR’s changed files, resolves owners with last-match-wins per file (GitHub-style path rules), unions team slugs across files, maps them to known domains (
scanning,findings, etc.), and adds missingdomain/*labels while removing stale ones. Catch-all teams likeeng-leadsare ignored; repos without CODEOWNERS skip domain labeling. Existing caller workflows pick this up without changes.Tests cover parsing, pattern matching, domain resolution, and reconcile behavior.
Reviewed by Cursor Bugbot for commit a70cc1a. Bugbot is set up for automated code reviews on this repo. Configure here.