Skip to content

Commit 816eee4

Browse files
authored
Onboard to the GitHub workflow based issue-labeler (#11057)
* Onboard to the GitHub workflow based issue-labeler * Bump to issue-labeler v1.0.1
1 parent d6810b3 commit 816eee4

6 files changed

+207
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: "Labeler: Build Predictor App"
2+
3+
on:
4+
# Allow dispatching the workflow via the Actions UI
5+
workflow_dispatch:
6+
inputs:
7+
rebuild:
8+
description: "Force a rebuild of the app"
9+
type: boolean
10+
11+
jobs:
12+
build-predictor:
13+
permissions:
14+
actions: write
15+
uses: dotnet/issue-labeler/.github/workflows/build-predictor.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1
16+
with:
17+
rebuild: ${{ inputs.rebuild }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: "Labeler: Cache Retention"
2+
3+
on:
4+
schedule:
5+
- cron: "13 6 * * *" # 6:13 every day (arbitrary time daily)
6+
7+
workflow_dispatch:
8+
9+
jobs:
10+
cache-retention:
11+
# Do not run the workflow on forks outside the 'dotnet' org
12+
if: ${{ github.repository_owner == 'dotnet' }}
13+
uses: dotnet/issue-labeler/.github/workflows/cache-retention.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: "Labeler: Predict Issue Labels"
2+
3+
on:
4+
# Only automatically predict area labels when issues are originally opened
5+
issues:
6+
types: opened
7+
8+
# Allow dispatching the workflow via the Actions UI, specifying ranges of numbers
9+
workflow_dispatch:
10+
inputs:
11+
issue_numbers:
12+
description: "Issue Numbers (comma-separated list of ranges)"
13+
type: string
14+
model_cache_key:
15+
description: "The cache key suffix to use for loading the model"
16+
type: string
17+
required: true
18+
default: "LIVE"
19+
20+
jobs:
21+
predict-issues:
22+
# Do not run the workflow on forks outside the 'dotnet' org
23+
if: ${{ github.repository_owner == 'dotnet' && (inputs.issue_numbers || github.event.issue.number) }}
24+
permissions:
25+
issues: write
26+
uses: dotnet/issue-labeler/.github/workflows/predict-issues.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1
27+
with:
28+
model_cache_key: ${{ inputs.model_cache_key }}
29+
issue_numbers: ${{ inputs.issue_numbers || github.event.issue.number }}
30+
label_prefix: "area-"
31+
threshold: 0.40
32+
default_label: "needs-area-label"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: "Labeler: Predict Pull Labels"
2+
3+
on:
4+
# Per to the following documentation:
5+
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request_target
6+
#
7+
# The `pull_request_target` event runs in the context of the base of the pull request, rather
8+
# than in the context of the merge commit, as the `pull_request` event does. This prevents
9+
# execution of unsafe code from the head of the pull request that could alter the repository
10+
# or steal any secrets you use in your workflow. This event allows your workflow to do things
11+
# like label or comment on pull requests from forks.
12+
#
13+
# Only automatically predict area labels when pull requests are first opened
14+
pull_request_target:
15+
types: opened
16+
branches:
17+
- 'main'
18+
19+
# Allow dispatching the workflow via the Actions UI, specifying ranges of numbers
20+
workflow_dispatch:
21+
inputs:
22+
pull_numbers:
23+
description: "Pull Numbers (comma-separated list of ranges)"
24+
type: string
25+
model_cache_key:
26+
description: "The cache key suffix to use for loading the model"
27+
type: string
28+
required: true
29+
default: "LIVE"
30+
31+
jobs:
32+
predict-pulls:
33+
# Do not run the workflow on forks outside the 'dotnet' org
34+
if: ${{ github.repository_owner == 'dotnet' && (inputs.pull_numbers || github.event.number) }}
35+
permissions:
36+
pull-requests: write
37+
uses: dotnet/issue-labeler/.github/workflows/predict-pulls.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1
38+
with:
39+
model_cache_key: ${{ inputs.model_cache_key }}
40+
pull_numbers: ${{ inputs.pull_numbers || github.event.number }}
41+
label_prefix: "area-"
42+
threshold: 0.40
43+
default_label: "needs-area-label"

.github/workflows/labeler-promote.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "Labeler: Promote Models"
2+
3+
on:
4+
# Dispatched via the Actions UI, promotes the staged models from
5+
# a staging slot into the prediction environment
6+
workflow_dispatch:
7+
inputs:
8+
promote_issues:
9+
description: "Issues: Promote Model"
10+
type: boolean
11+
required: true
12+
promote_pulls:
13+
description: "Pulls: Promote Model"
14+
type: boolean
15+
required: true
16+
model_cache_key:
17+
description: "The cache key suffix to promote into the 'LIVE' cache"
18+
type: string
19+
required: true
20+
default: "staging"
21+
backup_cache_key:
22+
description: "The cache key suffix to use for backing up the currently promoted model"
23+
type: string
24+
default: "backup"
25+
26+
permissions:
27+
actions: write
28+
29+
jobs:
30+
labeler-promote-issues:
31+
if: ${{ inputs.promote_issues }}
32+
uses: dotnet/issue-labeler/.github/workflows/promote-issues.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1
33+
with:
34+
model_cache_key: ${{ inputs.model_cache_key }}
35+
backup_cache_key: ${{ inputs.backup_cache_key }}
36+
37+
labeler-promote-pulls:
38+
if: ${{ inputs.promote_pulls }}
39+
uses: dotnet/issue-labeler/.github/workflows/promote-pulls.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1
40+
with:
41+
model_cache_key: ${{ inputs.model_cache_key }}
42+
backup_cache_key: ${{ inputs.backup_cache_key }}

.github/workflows/labeler-train.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: "Labeler: Train Models"
2+
3+
on:
4+
# Dispatched via the Actions UI, stages new models for promotion consideration
5+
# Each step of the workflow can be run independently: Download, Train, and Test
6+
workflow_dispatch:
7+
inputs:
8+
download_issues:
9+
description: "Issues: Download Data"
10+
type: boolean
11+
default: true
12+
train_issues:
13+
description: "Issues: Train Model"
14+
type: boolean
15+
default: true
16+
test_issues:
17+
description: "Issues: Test Model"
18+
type: boolean
19+
default: true
20+
download_pulls:
21+
description: "Pulls: Download Data"
22+
type: boolean
23+
default: true
24+
train_pulls:
25+
description: "Pulls: Train Model"
26+
type: boolean
27+
default: true
28+
test_pulls:
29+
description: "Pulls: Test Model"
30+
type: boolean
31+
default: true
32+
33+
data_limit:
34+
description: "Max number of items to include in the model"
35+
type: number
36+
37+
cache_key_suffix:
38+
description: "The cache key suffix to use for staging data/models (use 'LIVE' to bypass staging)"
39+
type: string
40+
required: true
41+
default: "staging"
42+
43+
jobs:
44+
labeler-train:
45+
permissions:
46+
issues: read
47+
pull-requests: read
48+
actions: write
49+
uses: dotnet/issue-labeler/.github/workflows/train.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1
50+
with:
51+
download_issues: ${{ inputs.download_issues }}
52+
train_issues: ${{ inputs.train_issues }}
53+
test_issues: ${{ inputs.test_issues }}
54+
download_pulls: ${{ inputs.download_pulls }}
55+
train_pulls: ${{ inputs.train_pulls }}
56+
test_pulls: ${{ inputs.test_pulls }}
57+
data_limit: ${{ inputs.data_limit && fromJSON(inputs.data_limit) || 0 }}
58+
cache_key_suffix: ${{ inputs.cache_key_suffix }}
59+
label_prefix: "area-"
60+
threshold: 0.40

0 commit comments

Comments
 (0)