Skip to content

Refine the issue-labeler config for this repo. Add comments and a doc. #11277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/labeler-cache-retention.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Workflow template imported and updated from:
# https://github.com/dotnet/issue-labeler/wiki/Onboarding
#
# See labeler.md for more information
#
# Regularly restore the prediction models from cache to prevent cache eviction
name: "Labeler: Cache Retention"

Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/labeler-predict-issues.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Workflow template imported and updated from:
# https://github.com/dotnet/issue-labeler/wiki/Onboarding
#
# See labeler.md for more information
#
# Predict labels for Issues using a trained model
name: "Labeler: Predict (Issues)"

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

jobs:
predict-issue-label:
Expand All @@ -51,7 +55,6 @@ jobs:
label_prefix: ${{ env.LABEL_PREFIX }}
threshold: ${{ env.THRESHOLD }}
default_label: ${{ env.DEFAULT_LABEL }}
excluded_authors: ${{ env.EXCLUDED_AUTHORS }}
env:
GITHUB_TOKEN: ${{ github.token }}
continue-on-error: ${{ !env.ALLOW_FAILURE }}
7 changes: 5 additions & 2 deletions .github/workflows/labeler-predict-pulls.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Workflow template imported and updated from:
# https://github.com/dotnet/issue-labeler/wiki/Onboarding
#
# See labeler.md for more information
#
# Predict labels for Pull Requests using a trained model
name: "Labeler: Predict (Pulls)"

Expand Down Expand Up @@ -37,7 +42,6 @@ env:
LABEL_PREFIX: "area-"
THRESHOLD: 0.40
DEFAULT_LABEL: "needs-area-label"
EXCLUDED_AUTHORS: "" # Comma-separated list of authors to exclude from training data

jobs:
predict-pull-label:
Expand All @@ -64,7 +68,6 @@ jobs:
label_prefix: ${{ env.LABEL_PREFIX }}
threshold: ${{ env.THRESHOLD }}
default_label: ${{ env.DEFAULT_LABEL }}
excluded_authors: ${{ env.EXCLUDED_AUTHORS }}
env:
GITHUB_TOKEN: ${{ github.token }}
continue-on-error: ${{ !env.ALLOW_FAILURE }}
5 changes: 5 additions & 0 deletions .github/workflows/labeler-promote.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Workflow template imported and updated from:
# https://github.com/dotnet/issue-labeler/wiki/Onboarding
#
# See labeler.md for more information
#
# Promote a model from staging to 'ACTIVE', backing up the currently 'ACTIVE' model
name: "Labeler: Promotion"

Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/labeler-train.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Workflow template imported and updated from:
# https://github.com/dotnet/issue-labeler/wiki/Onboarding
#
# See labeler.md for more information
#
# Train the Issues and Pull Requests models for label prediction
name: "Labeler: Training"

Expand Down Expand Up @@ -29,7 +34,7 @@ on:
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."
type: number
page_size:
description: "Number of items per page in GitHub API requests. Defaults to 100 for issues, 25 for pull requests."
description: "Number of items per page in GitHub API requests. Defaults to 100 for issues. Always uses 1 for pull requests."
type: number
page_limit:
description: "Maximum number of pages to download for training/testing the model. Defaults to 1000 for issues, 4000 for pull requests."
Expand Down Expand Up @@ -84,8 +89,8 @@ jobs:
repository: ${{ env.REPOSITORY }}
label_prefix: ${{ env.LABEL_PREFIX }}
limit: ${{ env.LIMIT }}
page_size: ${{ env.PAGE_SIZE }}
page_limit: ${{ env.PAGE_LIMIT }}
page_size: 1 # This repository can only successfully download pulls one at a time due to GitHub's API performance
page_limit: 10000 # Download the newest 10,000 pull requests
excluded_authors: ${{ env.EXCLUDED_AUTHORS }}
env:
GITHUB_TOKEN: ${{ github.token }}
Expand Down Expand Up @@ -154,8 +159,8 @@ jobs:
label_prefix: ${{ env.LABEL_PREFIX }}
threshold: ${{ env.THRESHOLD }}
limit: ${{ env.LIMIT }}
page_size: ${{ env.PAGE_SIZE }}
page_limit: ${{ env.PAGE_LIMIT }}
page_size: 1 # This repository can only successfully download pulls one at a time due to GitHub's API performance
page_limit: 10000 # Download the newest 10,000 pull requests
excluded_authors: ${{ env.EXCLUDED_AUTHORS }}
env:
GITHUB_TOKEN: ${{ github.token }}
32 changes: 32 additions & 0 deletions .github/workflows/labeler.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Issue-Labeler Workflows

This repository uses actions from [dotnet/issue-labeler](https://github.com/dotnet/issue-labeler) to predict area labels for issues and pull requests.

The following workflow templates were imported and updated from [dotnet/issue-labeler/wiki/Onboarding](https://github.com/dotnet/issue-labeler/wiki/Onboarding):

1. `labeler-cache-retention.yml`
2. `labeler-predict-issues.yml`
3. `labeler-predict-pulls.yml`
4. `labeler-promote.yml`
5. `labeler-train.yml`

## Repository Configuration

Across these workflows, the following changes were made to configure the issue labeler for this repository:

1. Set `LABEL_PREFIX` to `"area-"`:
- `labeler-predict-issues.yml`
- `labeler-predict-pulls.yml`
- `labeler-train.yml`
2. Set `DEFAULT_LABEL` to `"needs-area-label"`:
- `labeler-predict-issues.yml`
- `labeler-predict-pulls.yml`
3. Remove the `EXCLUDED_AUTHORS` value as we do not bypass labeling for any authors' issues/pulls in this repository:
- `labeler-predict-issues.yml`
- `labeler-predict-pulls.yml`
4. Remove the `repository` input for training the models against another repository:
- `labeler-train.yml`
5. Hard-code the `page_size` to 1 and `page_limit` to 10000 for pull requests
- `labeler-train.yml` (on both the `download-pulls` and `test-pulls` jobs)
6. Update the cache retention cron schedule to an arbitrary time of day:
- `labeler-cache-retention.yml`