Skip to content

Commit 66e9d83

Browse files
authored
Refine the issue-labeler config for this repo. Add comments and a doc. (#11277)
1 parent 31531a9 commit 66e9d83

6 files changed

+62
-9
lines changed

.github/workflows/labeler-cache-retention.yml

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Workflow template imported and updated from:
2+
# https://github.com/dotnet/issue-labeler/wiki/Onboarding
3+
#
4+
# See labeler.md for more information
5+
#
16
# Regularly restore the prediction models from cache to prevent cache eviction
27
name: "Labeler: Cache Retention"
38

.github/workflows/labeler-predict-issues.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Workflow template imported and updated from:
2+
# https://github.com/dotnet/issue-labeler/wiki/Onboarding
3+
#
4+
# See labeler.md for more information
5+
#
16
# Predict labels for Issues using a trained model
27
name: "Labeler: Predict (Issues)"
38

@@ -24,7 +29,6 @@ env:
2429
LABEL_PREFIX: "area-"
2530
THRESHOLD: 0.40
2631
DEFAULT_LABEL: "needs-area-label"
27-
EXCLUDED_AUTHORS: "" # Comma-separated list of authors to exclude from training data
2832

2933
jobs:
3034
predict-issue-label:
@@ -51,7 +55,6 @@ jobs:
5155
label_prefix: ${{ env.LABEL_PREFIX }}
5256
threshold: ${{ env.THRESHOLD }}
5357
default_label: ${{ env.DEFAULT_LABEL }}
54-
excluded_authors: ${{ env.EXCLUDED_AUTHORS }}
5558
env:
5659
GITHUB_TOKEN: ${{ github.token }}
5760
continue-on-error: ${{ !env.ALLOW_FAILURE }}

.github/workflows/labeler-predict-pulls.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Workflow template imported and updated from:
2+
# https://github.com/dotnet/issue-labeler/wiki/Onboarding
3+
#
4+
# See labeler.md for more information
5+
#
16
# Predict labels for Pull Requests using a trained model
27
name: "Labeler: Predict (Pulls)"
38

@@ -37,7 +42,6 @@ env:
3742
LABEL_PREFIX: "area-"
3843
THRESHOLD: 0.40
3944
DEFAULT_LABEL: "needs-area-label"
40-
EXCLUDED_AUTHORS: "" # Comma-separated list of authors to exclude from training data
4145

4246
jobs:
4347
predict-pull-label:
@@ -64,7 +68,6 @@ jobs:
6468
label_prefix: ${{ env.LABEL_PREFIX }}
6569
threshold: ${{ env.THRESHOLD }}
6670
default_label: ${{ env.DEFAULT_LABEL }}
67-
excluded_authors: ${{ env.EXCLUDED_AUTHORS }}
6871
env:
6972
GITHUB_TOKEN: ${{ github.token }}
7073
continue-on-error: ${{ !env.ALLOW_FAILURE }}

.github/workflows/labeler-promote.yml

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Workflow template imported and updated from:
2+
# https://github.com/dotnet/issue-labeler/wiki/Onboarding
3+
#
4+
# See labeler.md for more information
5+
#
16
# Promote a model from staging to 'ACTIVE', backing up the currently 'ACTIVE' model
27
name: "Labeler: Promotion"
38

.github/workflows/labeler-train.yml

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Workflow template imported and updated from:
2+
# https://github.com/dotnet/issue-labeler/wiki/Onboarding
3+
#
4+
# See labeler.md for more information
5+
#
16
# Train the Issues and Pull Requests models for label prediction
27
name: "Labeler: Training"
38

@@ -29,7 +34,7 @@ on:
2934
description: "Max number of items to download for training/testing the model (newest items are used). Defaults to the max number of pages times the page size."
3035
type: number
3136
page_size:
32-
description: "Number of items per page in GitHub API requests. Defaults to 100 for issues, 25 for pull requests."
37+
description: "Number of items per page in GitHub API requests. Defaults to 100 for issues. Always uses 1 for pull requests."
3338
type: number
3439
page_limit:
3540
description: "Maximum number of pages to download for training/testing the model. Defaults to 1000 for issues, 4000 for pull requests."
@@ -84,8 +89,8 @@ jobs:
8489
repository: ${{ env.REPOSITORY }}
8590
label_prefix: ${{ env.LABEL_PREFIX }}
8691
limit: ${{ env.LIMIT }}
87-
page_size: ${{ env.PAGE_SIZE }}
88-
page_limit: ${{ env.PAGE_LIMIT }}
92+
page_size: 1 # This repository can only successfully download pulls one at a time due to GitHub's API performance
93+
page_limit: 10000 # Download the newest 10,000 pull requests
8994
excluded_authors: ${{ env.EXCLUDED_AUTHORS }}
9095
env:
9196
GITHUB_TOKEN: ${{ github.token }}
@@ -154,8 +159,8 @@ jobs:
154159
label_prefix: ${{ env.LABEL_PREFIX }}
155160
threshold: ${{ env.THRESHOLD }}
156161
limit: ${{ env.LIMIT }}
157-
page_size: ${{ env.PAGE_SIZE }}
158-
page_limit: ${{ env.PAGE_LIMIT }}
162+
page_size: 1 # This repository can only successfully download pulls one at a time due to GitHub's API performance
163+
page_limit: 10000 # Download the newest 10,000 pull requests
159164
excluded_authors: ${{ env.EXCLUDED_AUTHORS }}
160165
env:
161166
GITHUB_TOKEN: ${{ github.token }}

.github/workflows/labeler.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Issue-Labeler Workflows
2+
3+
This repository uses actions from [dotnet/issue-labeler](https://github.com/dotnet/issue-labeler) to predict area labels for issues and pull requests.
4+
5+
The following workflow templates were imported and updated from [dotnet/issue-labeler/wiki/Onboarding](https://github.com/dotnet/issue-labeler/wiki/Onboarding):
6+
7+
1. `labeler-cache-retention.yml`
8+
2. `labeler-predict-issues.yml`
9+
3. `labeler-predict-pulls.yml`
10+
4. `labeler-promote.yml`
11+
5. `labeler-train.yml`
12+
13+
## Repository Configuration
14+
15+
Across these workflows, the following changes were made to configure the issue labeler for this repository:
16+
17+
1. Set `LABEL_PREFIX` to `"area-"`:
18+
- `labeler-predict-issues.yml`
19+
- `labeler-predict-pulls.yml`
20+
- `labeler-train.yml`
21+
2. Set `DEFAULT_LABEL` to `"needs-area-label"`:
22+
- `labeler-predict-issues.yml`
23+
- `labeler-predict-pulls.yml`
24+
3. Remove the `EXCLUDED_AUTHORS` value as we do not bypass labeling for any authors' issues/pulls in this repository:
25+
- `labeler-predict-issues.yml`
26+
- `labeler-predict-pulls.yml`
27+
4. Remove the `repository` input for training the models against another repository:
28+
- `labeler-train.yml`
29+
5. Hard-code the `page_size` to 1 and `page_limit` to 10000 for pull requests
30+
- `labeler-train.yml` (on both the `download-pulls` and `test-pulls` jobs)
31+
6. Update the cache retention cron schedule to an arbitrary time of day:
32+
- `labeler-cache-retention.yml`

0 commit comments

Comments
 (0)