Skip to content

Commit 0c91611

Browse files
committed
Introduce triage policy
Signed-off-by: Aryan Gorwade <gorwadearyan@gmail.com>
1 parent 16b4723 commit 0c91611

12 files changed

Lines changed: 366 additions & 7 deletions
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: '[Bug]: '
5+
labels: ["bug", "needs-triage"]
6+
7+
---
8+
9+
<!-- _**Important Note: NVIDIA AI Enterprise customers can get support from NVIDIA Enterprise support. Please open a case [here](https://enterprise-support.nvidia.com/s/create-case)**._ -->
10+
11+
**Motivation**
12+
<!-- A clear and concise description of your motivation: is this a real issue you ran into while using the product? -->
13+
14+
**Check here if you would like to work on this issue**
15+
- [ ] I would like to work on this issue.
16+
17+
**Describe the bug**
18+
<!-- A clear and concise description of what the bug is. -->
19+
20+
**To Reproduce**
21+
<!-- Detailed steps to reproduce the issue. -->
22+
23+
**Expected behavior**
24+
<!-- A clear and concise description of what you expected to happen. -->

‎.github/ISSUE_TEMPLATE/config.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Community Slack (#gpu-operator)
4+
url: https://inviter.co/dsx-ai-factory
5+
about: Chat with the GPU Operator team and community
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Feature request
3+
about: Submit a feature request
4+
title: "[Feature]: "
5+
labels: ["feature", "needs-triage"]
6+
---
7+
**Motivation**
8+
<!-- A clear and concise description of your motivation: e.g. would this feature greatly help your use-case, and why? -->
9+
10+
**Check here if you would like to work on this issue**
11+
- [ ] I would like to work on this issue.
12+
13+
**Describe the feature**
14+
<!-- A clear and concise description of the feature request. What alternatives did you consider? What impact will this have on users? If this is related to another GitHub issue, please link it here too. -->

‎.github/PULL_REQUEST_TEMPLATE.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Issue
2+
<!-- Link the `accepted` issue assigned to you. See CONTRIBUTING.md#contribution-workflow -->
3+
Fixes #
4+
5+
## Description
6+
7+
<!-- Brief description of the change, including context -->

‎.github/workflows/assign.yaml‎

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Copyright NVIDIA CORPORATION
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Assign
16+
17+
on:
18+
issue_comment:
19+
types: [created]
20+
21+
permissions: {}
22+
23+
jobs:
24+
assign:
25+
name: Assign issue from /assign comment
26+
if: ${{ !github.event.issue.pull_request && startsWith(github.event.comment.body, '/assign') }}
27+
runs-on: ubuntu-latest
28+
timeout-minutes: 5
29+
permissions:
30+
issues: write
31+
steps:
32+
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
33+
with:
34+
script: |
35+
const { owner, repo } = context.repo;
36+
const { comment, issue } = context.payload;
37+
const react = (content) =>
38+
github.rest.reactions.createForIssueComment({ owner, repo, comment_id: comment.id, content });
39+
40+
const firstLine = comment.body.split(/\r?\n/, 1)[0].trim();
41+
if (!/^\/assign(\s|$)/.test(firstLine)) {
42+
return;
43+
}
44+
45+
// Matches GitHub's own rule: assigning requires the triage role or higher.
46+
const { data: perm } = await github.rest.repos.getCollaboratorPermissionLevel({
47+
owner,
48+
repo,
49+
username: comment.user.login,
50+
});
51+
const canAssign = ['admin', 'maintain', 'write', 'triage'].includes(perm.role_name)
52+
|| ['admin', 'write'].includes(perm.permission);
53+
if (!canAssign) {
54+
return react('-1');
55+
}
56+
57+
const match = firstLine.match(/^\/assign(?:\s+@?([A-Za-z0-9-]+))?$/);
58+
if (!match || !issue.labels.some((label) => label.name === 'accepted')) {
59+
return react('confused');
60+
}
61+
62+
const assignee = match[1] ?? comment.user.login;
63+
const { data: updated } = await github.rest.issues.addAssignees({
64+
owner,
65+
repo,
66+
issue_number: issue.number,
67+
assignees: [assignee],
68+
});
69+
// GitHub silently skips users it cannot assign, such as people who have not commented on the issue.
70+
if (!updated.assignees.some((a) => a.login.toLowerCase() === assignee.toLowerCase())) {
71+
return react('confused');
72+
}
73+
74+
// The PR gatekeeper accepts any assignee, so a new claimant must replace the previous ones.
75+
// Maintainers stay assigned because the gatekeeper does not apply to them.
76+
const previousClaimants = [];
77+
for (const { login } of updated.assignees) {
78+
if (login.toLowerCase() === assignee.toLowerCase()) {
79+
continue;
80+
}
81+
const { data: level } = await github.rest.repos.getCollaboratorPermissionLevel({
82+
owner,
83+
repo,
84+
username: login,
85+
});
86+
if (!['admin', 'maintain', 'write'].includes(level.permission)) {
87+
previousClaimants.push(login);
88+
}
89+
}
90+
if (previousClaimants.length > 0) {
91+
await github.rest.issues.removeAssignees({
92+
owner,
93+
repo,
94+
issue_number: issue.number,
95+
assignees: previousClaimants,
96+
});
97+
}
98+
return react('+1');
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Copyright NVIDIA CORPORATION
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Issue State Labels
16+
17+
on:
18+
issues:
19+
types: [labeled]
20+
21+
permissions: {}
22+
23+
concurrency:
24+
group: issue-state-${{ github.event.issue.number }}
25+
26+
jobs:
27+
single-state:
28+
name: Keep one state label per issue
29+
if: contains(fromJSON('["needs-triage","needs-more-info","accepted"]'), github.event.label.name)
30+
runs-on: ubuntu-latest
31+
timeout-minutes: 5
32+
permissions:
33+
issues: write
34+
steps:
35+
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
36+
with:
37+
script: |
38+
const stateLabels = ['needs-triage', 'needs-more-info', 'accepted'];
39+
const { owner, repo } = context.repo;
40+
const issue_number = context.payload.issue.number;
41+
const added = context.payload.label.name;
42+
if (!stateLabels.includes(added)) {
43+
return;
44+
}
45+
46+
const { data: labels } = await github.rest.issues.listLabelsOnIssue({ owner, repo, issue_number });
47+
const current = labels.map((label) => label.name);
48+
// Adding two state labels at once starts two runs; a later run must not undo an earlier one.
49+
if (!current.includes(added)) {
50+
return;
51+
}
52+
53+
for (const name of current.filter((label) => stateLabels.includes(label) && label !== added)) {
54+
try {
55+
await github.rest.issues.removeLabel({ owner, repo, issue_number, name });
56+
core.info(`Removed ${name}: ${added} replaces it.`);
57+
} catch (error) {
58+
if (error.status !== 404) {
59+
throw error;
60+
}
61+
}
62+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Copyright NVIDIA CORPORATION
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Issue Triage
16+
17+
on:
18+
issues:
19+
types: [opened]
20+
21+
permissions: {}
22+
23+
jobs:
24+
label:
25+
name: Label new issues for triage
26+
runs-on: ubuntu-latest
27+
timeout-minutes: 5
28+
permissions:
29+
issues: write
30+
steps:
31+
# Issue templates apply needs-triage, but issues created through the API skip templates.
32+
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
33+
with:
34+
script: |
35+
const stateLabels = ['needs-triage', 'needs-more-info', 'accepted'];
36+
const labels = context.payload.issue.labels.map((label) => label.name);
37+
if (labels.some((label) => stateLabels.includes(label))) {
38+
return;
39+
}
40+
await github.rest.issues.addLabels({
41+
owner: context.repo.owner,
42+
repo: context.repo.repo,
43+
issue_number: context.payload.issue.number,
44+
labels: ['needs-triage'],
45+
});

‎.github/workflows/stale.yaml‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Stale issues
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "21 4 * * *"
7+
8+
permissions: {}
9+
10+
jobs:
11+
stale:
12+
permissions:
13+
actions: write
14+
issues: write
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 10
17+
18+
steps:
19+
- uses: actions/stale@4391f3da665fdf50b6810c1a66712fb9ba21aa93 # v11
20+
with:
21+
stale-issue-message: 'This issue is stale because it has been open 90 days with no activity. This issue will be closed in 30 days unless new comments are made or the stale label is removed. To skip these checks, apply the "lifecycle/frozen" label.'
22+
stale-issue-label: 'lifecycle/stale'
23+
exempt-issue-labels: 'lifecycle/frozen,feature,enhancement,accepted'
24+
days-before-stale: 90
25+
close-issue-message: 'This issue was automatically closed due to inactivity.'
26+
days-before-issue-close: 30
27+
remove-stale-when-updated: true
28+
operations-per-run: 1000
29+
- uses: actions/stale@4391f3da665fdf50b6810c1a66712fb9ba21aa93 # v11
30+
with:
31+
only-issue-labels: 'needs-more-info'
32+
# Triage policy start date.
33+
start-date: '2026-10-27T00:00:00Z'
34+
stale-issue-message: 'This issue has been waiting for more information for 23 days with no activity. It will be closed in 7 days unless the requested information is provided.'
35+
stale-issue-label: 'lifecycle/stale'
36+
exempt-issue-labels: 'lifecycle/frozen'
37+
days-before-issue-stale: 23
38+
close-issue-message: 'This issue was automatically closed because the requested information was not provided within 30 days.'
39+
days-before-issue-close: 7
40+
days-before-pr-stale: -1
41+
days-before-pr-close: -1
42+
remove-stale-when-updated: true
43+
operations-per-run: 1000

‎AGENTS.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## Contribution process (see `CONTRIBUTING.md`)
2+
3+
- For any change, an issue should exist describing the problem/proposal before implementation begins. Additionally, the contributor should be approved to work on said issue — ensure the PR is linked to an issue the contributor has been assigned to.
4+
- Keep PR titles short and imperative.
5+
- Issue or PR descriptions drafted with AI must be thoroughly reviewed and verified by the user before they are submitted.
6+
- Replies to maintainers in review comments or issue discussions may not be AI generated.
7+
- All commits must be signed off (DCO): `git commit -s`, producing a trailing
8+
`Signed-off-by: Name <email>` line. Do not fabricate a sign-off identity — use the configured
9+
git user's identity.
10+
- Do not open, push to, or comment on GitHub issues/PRs without explicit user confirmation.
11+
- Keep all changes as minimal as possible.

‎CONTRIBUTING.md‎

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,59 @@
11
# Contribute to the NVIDIA `sandbox-device-plugin` Project
22

3-
Want to contribute to the NVIDIA `sandbox-device-plugin` Project? Awesome!
4-
We only require you to sign your work, the below section describes this!
3+
To file feature requests or bugs, submit an issue at https://github.com/NVIDIA/sandbox-device-plugin/issues. For questions, ask in the `#gpu-operator` channel in our community Slack at https://inviter.co/dsx-ai-factory.
4+
5+
All external contributions start with an issue. External contributors must have an accepted issue that is assigned to them before they open a pull request. See [Contribution workflow](#contribution-workflow). Contributions do not require explicit contributor license agreements (CLA), but we expect contributors to [sign](#sign-your-work) their work.
6+
7+
PR approval and decision-making for major changes are documented in [GOVERNANCE.md](GOVERNANCE.md).
58

69
All contributions must adhere to the [Code of Conduct](CODE_OF_CONDUCT.md).
710

11+
### AI Usage
12+
AI-assisted contributions are welcome, however, **you must understand your code**. If you can't explain what your changes do and how they interact with the greater system without the aid of AI tools, your contribution may not be accepted. AI should assist your effort, not replace it or shift the burden of understanding, testing, and reviewing onto maintainers.
13+
14+
The human contributor is accountable for all code, regardless of how much was AI-generated. Each contribution must name the human behind the change via a [DCO sign-off](#sign-your-work).
15+
16+
Maintainers may close issues and PRs that are unproductive or low-quality, without explanation, regardless of whether AI tools were used or not. If a contributor repeatedly opens unproductive issues or PRs, they may be blocked from contributing to the project because it is disruptive and disrespectful of the maintainers' time.
17+
18+
Below are some unacceptable usages of AI that will likely result in your contribution being closed:
19+
20+
- Submitting AI-generated issues or PRs without thorough review and verification
21+
- Submitting AI-generated code that you cannot explain or answer questions about during review
22+
- Using AI to generate replies to review comments or issue discussions
23+
- Submitting AI-generated code that contains unnecessary refactoring or unrelated changes not scoped to the problem the PR is solving
24+
25+
### Contribution workflow
26+
27+
**To propose a new issue:** start at step 1.\
28+
**To work on an existing issue:** skip to step 3 and [claim an `accepted` issue](https://github.com/NVIDIA/sandbox-device-plugin/issues?q=is%3Aopen+label%3Aaccepted+no%3Aassignee) with no assignees.
29+
30+
1. **Open an issue.** Use the bug report template to report a defect, or the feature request template to propose new behavior or a [major change](GOVERNANCE.md#core-decisions). Indicate if you want to work on the issue. Each new issue gets the `needs-triage` label.
31+
2. **Wait for triage.** A maintainer reviews the issue against the [triage criteria](#triage-criteria). The maintainer then labels the issue `accepted`, `needs-more-info`, or closes it.
32+
3. **Claim the issue.** When an issue is `accepted`, comment on it expressing interest and summarizing your proposed solution. Issue authors have priority if they indicate they would like to work on it. Other claims are first-come, first-served. A maintainer discusses your plan with you and assigns the issue to you when the plan is ready.
33+
4. **Open a pull request.** File a pull request at https://github.com/NVIDIA/sandbox-device-plugin/pulls and link the issue in the description (for example, `Fixes #1234`). Maintainers close pull requests that do not link an issue assigned to the author, and pull requests that are duplicates of existing ones.
34+
35+
### Issue labels
36+
37+
Each open issue has one state label and one category label. For example, `needs-triage` and `bug` together identify a bug report that no maintainer has reviewed yet.
38+
39+
| Label | Type | Meaning |
40+
| ----- | ---- | ------- |
41+
| `needs-triage` | State | No maintainer has reviewed the issue yet. |
42+
| `needs-more-info` | State | Maintainers are waiting for more information from the author. If the issue has no activity for 30 days, it is closed. |
43+
| `accepted` | State | The issue is approved for work. Contributors can claim it. |
44+
| `bug` | Category | A defect in existing behavior. |
45+
| `feature` | Category | A request for new behavior. |
46+
47+
### Triage criteria
48+
49+
Maintainers use these questions to triage an issue:
50+
51+
- Is the problem clear and reproducible?
52+
- Is the issue a duplicate, or does other work already address it?
53+
- Does the issue fit the supported use cases and the project priorities?
54+
- Is the proposed approach appropriate?
55+
- Does the issue align with the product roadmap?
56+
857
## Sign your work
958

1059
The sign-off is a simple line at the end of the explanation for the patch. Your

0 commit comments

Comments
 (0)