Skip to content

Commit 26eeb46

Browse files
authored
feat: Add a CODEOWNERS file (#109)
* add a CODEOWNERS file * add a github workflow for reviewer assignment
1 parent deae653 commit 26eeb46

File tree

2 files changed

+175
-0
lines changed

2 files changed

+175
-0
lines changed

.github/CODEOWNERS

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# See https://help.github.com/articles/about-codeowners/
2+
# for more info about CODEOWNERS file
3+
4+
# Default ownership for entire repository
5+
* @ai-dynamo/contributors-aiconfigurator
6+
7+
# aic sdk
8+
/src @tianhaox @jasonqinzhou
9+
/src/aiconfigurator/sdk/backends/base_backend.py @tianhaox @Arsene12358
10+
/src/aiconfigurator/sdk/backends/factory.py @tianhaox @jasonqinzhou
11+
/src/aiconfigurator/sdk/backends/sglang_backend.py @xutizhou @AichenF @jasonqinzhou
12+
/src/aiconfigurator/sdk/backends/trtllm_backend.py @tianhaox @jasonqinzhou @ilyasher
13+
/src/aiconfigurator/sdk/backends/vllm_backend.py @jasonqinzhou @ilyasher @davilu-nvidia
14+
/src/aiconfigurator/sdk/common.py @Arsene12358 @simone-chen @xutizhou @AichenF @jasonqinzhou
15+
/src/aiconfigurator/sdk/config.py @YijiaZhao @tianhaox
16+
/src/aiconfigurator/sdk/inference_session.py @tianhaox @xutizhou @AichenF
17+
/src/aiconfigurator/sdk/inference_summary.py @tianhaox @jasonqinzhou
18+
/src/aiconfigurator/sdk/models.py @Arsene12358 @simone-chen @xutizhou @AichenF @YijiaZhao
19+
/src/aiconfigurator/sdk/operations.py @Arsene12358 @xutizhou @AichenF @YijiaZhao
20+
/src/aiconfigurator/sdk/pareto_analysis.py @xutizhou @AichenF @Arsene12358
21+
/src/aiconfigurator/sdk/perf_database.py @Arsene12358 @YijiaZhao @ilyasher @xutizhou @AichenF
22+
/src/aiconfigurator/sdk/task.py @tianhaox @jasonqinzhou @ilyasher
23+
/src/aiconfigurator/sdk/utils.py @tianhaox @jasonqinzhou @simone-chen
24+
25+
# cli
26+
/src/aiconfigurator/cli @Ethan-ES @tianhaox
27+
28+
# eval
29+
/src/aiconfigurator/eval @Ethan-ES @tianhaox
30+
31+
# webapp
32+
/src/aiconfigurator/webapp @tianhaox @xueh-nv
33+
34+
# systems & data files
35+
/src/aiconfigurator/systems @tianhaox @jasonqinzhou @YijiaZhao @ilyasher @simone-chen
36+
37+
# model configs
38+
/src/aiconfigurator/model_configs @simone-chen @Arsene12358
39+
40+
# generator
41+
/src/aiconfigurator/generator @Ethan-ES @tianhaox
42+
43+
# collector
44+
/collector/ @tianhaox @jasonqinzhou @YijiaZhao @Arsene12358
45+
/collector/deep_collector @xutizhou @AichenF
46+
/collector/sglang @xutizhou @AichenF
47+
/collector/slurm_comm_collector @YijiaZhao @Arsene12358
48+
/collector/trtllm @Arsene12358 @YijiaZhao
49+
/collector/vllm @jasonqinzhou @ilyasher @davilu-nvidia
50+
/collector/collect_all_reduce.py @Arsene12358 @YijiaZhao
51+
/collector/collect_comm.sh @Arsene12358 @YijiaZhao
52+
/collector/collect_nccl.py @YijiaZhao @Arsene12358
53+
/collector/collect.py @Arsene12358 @YijiaZhao
54+
/collector/helper.py @Arsene12358 @YijiaZhao @xutizhou @AichenF
55+
/collector/README.md @Arsene12358 @YijiaZhao
56+
57+
# docs
58+
/docs @tianhaox @jasonqinzhou
59+
/docs/add_a_new_model.md @Arsene12358 @tianhaox
60+
/docs/advanced_tunning.md @tianhaox @jasonqinzhou
61+
/docs/cli_user_guide.md @tianhaox @jasonqinzhou
62+
/docs/dynamo_deployment_guide.md @Ethan-ES @davilu-nvidia
63+
64+
# docker
65+
/docker @jasonqinzhou @anish-shanbhag @ilyasher @saturley-hall
66+
67+
# tests
68+
/tests @tianhaox @jasonqinzhou @YijiaZhao @Arsene12358 @ilyasher @saturley-hall
69+
70+
# tools
71+
/tools/automation @tianhaox @Ethan-ES
72+
/tools/sanity_check @tianhaox @YijiaZhao
73+
/tools/simple_sdk_demo @tianhaox @jasonqinzhou
74+
75+
# misc
76+
/ATTRIBUTIONS.md @saturley-hall
77+
/CODE_OF_CONDUCT.md @saturley-hall
78+
/CONTRIBUTING.md @saturley-hall
79+
/DEVELOPMENT.md @saturley-hall @anish-shanbhag
80+
/LICENSE @saturley-hall
81+
/pyproject.toml @tianhaox @jasonqinzhou @saturley-hall @Arsene12358
82+
/pytest.ini @saturley-hall
83+
/README.md @tianhaox @jasonqinzhou @Arsene12358
84+
/SECURITY.md @saturley-hall
85+
/.pre-commit-config.yaml @saturley-hall
86+
87+
# CI/CD and workflows
88+
/.github/workflows @saturley-hall @tianhaox @jasonqinzhou
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Random Review Assignment
2+
3+
on:
4+
pull_request:
5+
types: [opened, ready_for_review]
6+
7+
permissions:
8+
pull-requests: write
9+
contents: read
10+
11+
jobs:
12+
assign:
13+
runs-on: ubuntu-latest
14+
if: github.event.pull_request.draft == false
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
sparse-checkout: .github/CODEOWNERS
20+
sparse-checkout-cone-mode: false
21+
22+
- uses: actions/github-script@v7
23+
with:
24+
script: |
25+
const fs = require('fs');
26+
27+
// Get already requested reviewers
28+
const { data: pullRequest } = await github.rest.pulls.get({
29+
owner: context.repo.owner,
30+
repo: context.repo.repo,
31+
pull_number: context.payload.pull_request.number
32+
});
33+
34+
const existingReviewers = pullRequest.requested_reviewers.map(r => r.login);
35+
console.log(`Already assigned: ${existingReviewers.join(', ')}`);
36+
37+
// Parse CODEOWNERS for all @mentions (both users and teams)
38+
const content = fs.readFileSync('.github/CODEOWNERS', 'utf8');
39+
const userMentions = content.match(/@[\w-]+(?!\/)/g) || [];
40+
const teamMentions = content.match(/@[\w-]+\/[\w-]+/g) || [];
41+
42+
let allReviewers = [...new Set(userMentions.map(m => m.substring(1)))];
43+
44+
// Expand team mentions to get individual members
45+
for (const teamMention of [...new Set(teamMentions)]) {
46+
const [org, team] = teamMention.substring(1).split('/');
47+
try {
48+
const { data: members } = await github.rest.teams.listMembersInOrg({
49+
org: org,
50+
team_slug: team,
51+
per_page: 100
52+
});
53+
allReviewers.push(...members.map(m => m.login));
54+
} catch (error) {
55+
console.log(`Warning: Could not fetch team ${teamMention}: ${error.message}`);
56+
}
57+
}
58+
59+
// Remove duplicates
60+
allReviewers = [...new Set(allReviewers)];
61+
62+
// Filter out PR author and already assigned reviewers
63+
const author = context.payload.pull_request.user.login;
64+
const eligible = allReviewers.filter(r =>
65+
r !== author && !existingReviewers.includes(r)
66+
);
67+
68+
// Pick one additional reviewer
69+
const needToAdd = 1;
70+
71+
if (needToAdd > 0 && eligible.length > 0) {
72+
// Randomly select only the additional reviewers needed
73+
const selected = eligible
74+
.sort(() => Math.random() - 0.5)
75+
.slice(0, Math.min(needToAdd, eligible.length));
76+
77+
await github.rest.pulls.requestReviewers({
78+
owner: context.repo.owner,
79+
repo: context.repo.repo,
80+
pull_number: context.payload.pull_request.number,
81+
reviewers: selected
82+
});
83+
84+
console.log(`✅ Added reviewer: ${selected[0]}`);
85+
} else {
86+
console.log(`⚠️ No eligible reviewers available to add`);
87+
}

0 commit comments

Comments
 (0)