From 816eee447d4f9d67aa41f65cc42e7b446915be3d Mon Sep 17 00:00:00 2001 From: Jeff Handley Date: Wed, 12 Mar 2025 10:45:33 -0700 Subject: [PATCH 1/8] Onboard to the GitHub workflow based issue-labeler (#11057) * Onboard to the GitHub workflow based issue-labeler * Bump to issue-labeler v1.0.1 --- .github/workflows/labeler-build-predictor.yml | 17 ++++++ .github/workflows/labeler-cache-retention.yml | 13 ++++ .github/workflows/labeler-predict-issues.yml | 32 ++++++++++ .github/workflows/labeler-predict-pulls.yml | 43 +++++++++++++ .github/workflows/labeler-promote.yml | 42 +++++++++++++ .github/workflows/labeler-train.yml | 60 +++++++++++++++++++ 6 files changed, 207 insertions(+) create mode 100644 .github/workflows/labeler-build-predictor.yml create mode 100644 .github/workflows/labeler-cache-retention.yml create mode 100644 .github/workflows/labeler-predict-issues.yml create mode 100644 .github/workflows/labeler-predict-pulls.yml create mode 100644 .github/workflows/labeler-promote.yml create mode 100644 .github/workflows/labeler-train.yml diff --git a/.github/workflows/labeler-build-predictor.yml b/.github/workflows/labeler-build-predictor.yml new file mode 100644 index 00000000000..8a12b312db0 --- /dev/null +++ b/.github/workflows/labeler-build-predictor.yml @@ -0,0 +1,17 @@ +name: "Labeler: Build Predictor App" + +on: + # Allow dispatching the workflow via the Actions UI + workflow_dispatch: + inputs: + rebuild: + description: "Force a rebuild of the app" + type: boolean + +jobs: + build-predictor: + permissions: + actions: write + uses: dotnet/issue-labeler/.github/workflows/build-predictor.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 + with: + rebuild: ${{ inputs.rebuild }} diff --git a/.github/workflows/labeler-cache-retention.yml b/.github/workflows/labeler-cache-retention.yml new file mode 100644 index 00000000000..c6914710cac --- /dev/null +++ b/.github/workflows/labeler-cache-retention.yml @@ -0,0 +1,13 @@ +name: "Labeler: Cache Retention" + +on: + schedule: + - cron: "13 6 * * *" # 6:13 every day (arbitrary time daily) + + workflow_dispatch: + +jobs: + cache-retention: + # Do not run the workflow on forks outside the 'dotnet' org + if: ${{ github.repository_owner == 'dotnet' }} + uses: dotnet/issue-labeler/.github/workflows/cache-retention.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 diff --git a/.github/workflows/labeler-predict-issues.yml b/.github/workflows/labeler-predict-issues.yml new file mode 100644 index 00000000000..f1783e7340c --- /dev/null +++ b/.github/workflows/labeler-predict-issues.yml @@ -0,0 +1,32 @@ +name: "Labeler: Predict Issue Labels" + +on: + # Only automatically predict area labels when issues are originally opened + issues: + types: opened + + # Allow dispatching the workflow via the Actions UI, specifying ranges of numbers + workflow_dispatch: + inputs: + issue_numbers: + description: "Issue Numbers (comma-separated list of ranges)" + type: string + model_cache_key: + description: "The cache key suffix to use for loading the model" + type: string + required: true + default: "LIVE" + +jobs: + predict-issues: + # Do not run the workflow on forks outside the 'dotnet' org + if: ${{ github.repository_owner == 'dotnet' && (inputs.issue_numbers || github.event.issue.number) }} + permissions: + issues: write + uses: dotnet/issue-labeler/.github/workflows/predict-issues.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 + with: + model_cache_key: ${{ inputs.model_cache_key }} + issue_numbers: ${{ inputs.issue_numbers || github.event.issue.number }} + label_prefix: "area-" + threshold: 0.40 + default_label: "needs-area-label" diff --git a/.github/workflows/labeler-predict-pulls.yml b/.github/workflows/labeler-predict-pulls.yml new file mode 100644 index 00000000000..4f00854d5df --- /dev/null +++ b/.github/workflows/labeler-predict-pulls.yml @@ -0,0 +1,43 @@ +name: "Labeler: Predict Pull Labels" + +on: + # Per to the following documentation: + # https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request_target + # + # The `pull_request_target` event runs in the context of the base of the pull request, rather + # than in the context of the merge commit, as the `pull_request` event does. This prevents + # execution of unsafe code from the head of the pull request that could alter the repository + # or steal any secrets you use in your workflow. This event allows your workflow to do things + # like label or comment on pull requests from forks. + # + # Only automatically predict area labels when pull requests are first opened + pull_request_target: + types: opened + branches: + - 'main' + + # Allow dispatching the workflow via the Actions UI, specifying ranges of numbers + workflow_dispatch: + inputs: + pull_numbers: + description: "Pull Numbers (comma-separated list of ranges)" + type: string + model_cache_key: + description: "The cache key suffix to use for loading the model" + type: string + required: true + default: "LIVE" + +jobs: + predict-pulls: + # Do not run the workflow on forks outside the 'dotnet' org + if: ${{ github.repository_owner == 'dotnet' && (inputs.pull_numbers || github.event.number) }} + permissions: + pull-requests: write + uses: dotnet/issue-labeler/.github/workflows/predict-pulls.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 + with: + model_cache_key: ${{ inputs.model_cache_key }} + pull_numbers: ${{ inputs.pull_numbers || github.event.number }} + label_prefix: "area-" + threshold: 0.40 + default_label: "needs-area-label" diff --git a/.github/workflows/labeler-promote.yml b/.github/workflows/labeler-promote.yml new file mode 100644 index 00000000000..97f40afa8f1 --- /dev/null +++ b/.github/workflows/labeler-promote.yml @@ -0,0 +1,42 @@ +name: "Labeler: Promote Models" + +on: + # Dispatched via the Actions UI, promotes the staged models from + # a staging slot into the prediction environment + workflow_dispatch: + inputs: + promote_issues: + description: "Issues: Promote Model" + type: boolean + required: true + promote_pulls: + description: "Pulls: Promote Model" + type: boolean + required: true + model_cache_key: + description: "The cache key suffix to promote into the 'LIVE' cache" + type: string + required: true + default: "staging" + backup_cache_key: + description: "The cache key suffix to use for backing up the currently promoted model" + type: string + default: "backup" + +permissions: + actions: write + +jobs: + labeler-promote-issues: + if: ${{ inputs.promote_issues }} + uses: dotnet/issue-labeler/.github/workflows/promote-issues.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 + with: + model_cache_key: ${{ inputs.model_cache_key }} + backup_cache_key: ${{ inputs.backup_cache_key }} + + labeler-promote-pulls: + if: ${{ inputs.promote_pulls }} + uses: dotnet/issue-labeler/.github/workflows/promote-pulls.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 + with: + model_cache_key: ${{ inputs.model_cache_key }} + backup_cache_key: ${{ inputs.backup_cache_key }} diff --git a/.github/workflows/labeler-train.yml b/.github/workflows/labeler-train.yml new file mode 100644 index 00000000000..9775be4fe00 --- /dev/null +++ b/.github/workflows/labeler-train.yml @@ -0,0 +1,60 @@ +name: "Labeler: Train Models" + +on: + # Dispatched via the Actions UI, stages new models for promotion consideration + # Each step of the workflow can be run independently: Download, Train, and Test + workflow_dispatch: + inputs: + download_issues: + description: "Issues: Download Data" + type: boolean + default: true + train_issues: + description: "Issues: Train Model" + type: boolean + default: true + test_issues: + description: "Issues: Test Model" + type: boolean + default: true + download_pulls: + description: "Pulls: Download Data" + type: boolean + default: true + train_pulls: + description: "Pulls: Train Model" + type: boolean + default: true + test_pulls: + description: "Pulls: Test Model" + type: boolean + default: true + + data_limit: + description: "Max number of items to include in the model" + type: number + + cache_key_suffix: + description: "The cache key suffix to use for staging data/models (use 'LIVE' to bypass staging)" + type: string + required: true + default: "staging" + +jobs: + labeler-train: + permissions: + issues: read + pull-requests: read + actions: write + uses: dotnet/issue-labeler/.github/workflows/train.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 + with: + download_issues: ${{ inputs.download_issues }} + train_issues: ${{ inputs.train_issues }} + test_issues: ${{ inputs.test_issues }} + download_pulls: ${{ inputs.download_pulls }} + train_pulls: ${{ inputs.train_pulls }} + test_pulls: ${{ inputs.test_pulls }} + data_limit: ${{ inputs.data_limit && fromJSON(inputs.data_limit) || 0 }} + cache_key_suffix: ${{ inputs.cache_key_suffix }} + label_prefix: "area-" + threshold: 0.40 From 91e69996d2a5fbf9527962909a887a0736d40f56 Mon Sep 17 00:00:00 2001 From: Jeff Handley Date: Wed, 12 Mar 2025 13:29:20 -0700 Subject: [PATCH 2/8] Customize the issue-labeler train workflow to specify a page size for pulls (#11078) --- .github/workflows/labeler-train.yml | 94 ++++++++++++++++++++++++++--- 1 file changed, 84 insertions(+), 10 deletions(-) diff --git a/.github/workflows/labeler-train.yml b/.github/workflows/labeler-train.yml index 9775be4fe00..8bc81164be9 100644 --- a/.github/workflows/labeler-train.yml +++ b/.github/workflows/labeler-train.yml @@ -34,6 +34,11 @@ on: description: "Max number of items to include in the model" type: number + pull_page_size: + description: "Max number of pulls to download per page" + type: number + default: 1 + cache_key_suffix: description: "The cache key suffix to use for staging data/models (use 'LIVE' to bypass staging)" type: string @@ -41,20 +46,89 @@ on: default: "staging" jobs: - labeler-train: + # Without specifying a pageSize of 1 for downloading pull requests, the requests time out + # Directly invoking the individual workflows until https://github.com/dotnet/issue-labeler/issues/97 is addressed + # + # labeler-train: + # permissions: + # issues: read + # pull-requests: read + # actions: write + # uses: dotnet/issue-labeler/.github/workflows/train.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 + # with: + # download_issues: ${{ inputs.download_issues }} + # train_issues: ${{ inputs.train_issues }} + # test_issues: ${{ inputs.test_issues }} + # download_pulls: ${{ inputs.download_pulls }} + # train_pulls: ${{ inputs.train_pulls }} + # test_pulls: ${{ inputs.test_pulls }} + # data_limit: ${{ inputs.data_limit && fromJSON(inputs.data_limit) || 0 }} + # cache_key_suffix: ${{ inputs.cache_key_suffix }} + # label_prefix: "area-" + # threshold: 0.40 + + build-predictor: + uses: dotnet/issue-labeler/.github/workflows/build-predictor.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 + + labeler-download-issues: + needs: build-predictor + if: ${{ inputs.download_issues }} permissions: issues: read + actions: write + uses: dotnet/issue-labeler/.github/workflows/download-issues.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 + with: + data_cache_key: ${{ inputs.cache_key_suffix }} + issue_limit: ${{ inputs.data_limit && fromJSON(inputs.data_limit) || 0 }} + label_prefix: "area-" + + labeler-train-issues: + needs: labeler-download-issues + if: ${{ inputs.train_issues && always() && (needs.labeler-download-issues.result == 'success' || needs.labeler-download-issues.result == 'skipped') }} + permissions: + actions: write + uses: dotnet/issue-labeler/.github/workflows/train-issues.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 + with: + data_cache_key: ${{ inputs.cache_key_suffix }} + model_cache_key: ${{ inputs.cache_key_suffix }} + + labeler-test-issues: + needs: [labeler-download-issues, labeler-train-issues] + if: ${{ inputs.test_issues && always() && (needs.labeler-download-issues.result == 'success' || needs.labeler-download-issues.result == 'skipped') && (needs.labeler-train-issues.result == 'success' || needs.labeler-train-issues.result == 'skipped') }} + uses: dotnet/issue-labeler/.github/workflows/test-issues.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 + with: + model_cache_key: ${{ inputs.cache_key_suffix }} + label_prefix: "area-" + threshold: 0.40 + + labeler-download-pulls: + needs: build-predictor + if: ${{ inputs.download_pulls }} + permissions: pull-requests: read actions: write - uses: dotnet/issue-labeler/.github/workflows/train.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 + uses: dotnet/issue-labeler/.github/workflows/download-pulls.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 + with: + data_cache_key: ${{ inputs.cache_key_suffix }} + pull_limit: ${{ inputs.data_limit && fromJSON(inputs.data_limit) || 0 }} + page_size: ${{ inputs.pull_page_size }} + label_prefix: "area-" + + labeler-train-pulls: + needs: labeler-download-pulls + if: ${{ inputs.train_pulls && always() && (needs.labeler-download-pulls.result == 'success' || needs.labeler-download-pulls.result == 'skipped') }} + permissions: + actions: write + uses: dotnet/issue-labeler/.github/workflows/train-pulls.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 + with: + data_cache_key: ${{ inputs.cache_key_suffix }} + model_cache_key: ${{ inputs.cache_key_suffix }} + + labeler-test-pulls: + needs: [labeler-download-pulls, labeler-train-pulls] + if: ${{ inputs.test_pulls && always() && (needs.labeler-download-pulls.result == 'success' || needs.labeler-download-pulls.result == 'skipped') && (needs.labeler-train-pulls.result == 'success' || needs.labeler-train-pulls.result == 'skipped') }} + uses: dotnet/issue-labeler/.github/workflows/test-pulls.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 with: - download_issues: ${{ inputs.download_issues }} - train_issues: ${{ inputs.train_issues }} - test_issues: ${{ inputs.test_issues }} - download_pulls: ${{ inputs.download_pulls }} - train_pulls: ${{ inputs.train_pulls }} - test_pulls: ${{ inputs.test_pulls }} - data_limit: ${{ inputs.data_limit && fromJSON(inputs.data_limit) || 0 }} - cache_key_suffix: ${{ inputs.cache_key_suffix }} + model_cache_key: ${{ inputs.cache_key_suffix }} label_prefix: "area-" threshold: 0.40 From 3d594d19920e1e579e35e479510cb9ccda37c5cf Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 12 Mar 2025 13:47:28 -0700 Subject: [PATCH 3/8] Use different commits (#11079) --- .github/workflows/labeler-train.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/labeler-train.yml b/.github/workflows/labeler-train.yml index 8bc81164be9..635423cc7dd 100644 --- a/.github/workflows/labeler-train.yml +++ b/.github/workflows/labeler-train.yml @@ -68,7 +68,7 @@ jobs: # threshold: 0.40 build-predictor: - uses: dotnet/issue-labeler/.github/workflows/build-predictor.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 + uses: dotnet/issue-labeler/.github/workflows/build-predictor.yml@68a3df3b6444ec3e2a37af4d5e2569df1d45201d # v1.0.1 labeler-download-issues: needs: build-predictor @@ -76,7 +76,7 @@ jobs: permissions: issues: read actions: write - uses: dotnet/issue-labeler/.github/workflows/download-issues.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 + uses: dotnet/issue-labeler/.github/workflows/download-issues.yml@68a3df3b6444ec3e2a37af4d5e2569df1d45201d # v1.0.1 with: data_cache_key: ${{ inputs.cache_key_suffix }} issue_limit: ${{ inputs.data_limit && fromJSON(inputs.data_limit) || 0 }} @@ -87,7 +87,7 @@ jobs: if: ${{ inputs.train_issues && always() && (needs.labeler-download-issues.result == 'success' || needs.labeler-download-issues.result == 'skipped') }} permissions: actions: write - uses: dotnet/issue-labeler/.github/workflows/train-issues.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 + uses: dotnet/issue-labeler/.github/workflows/train-issues.yml@68a3df3b6444ec3e2a37af4d5e2569df1d45201d # v1.0.1 with: data_cache_key: ${{ inputs.cache_key_suffix }} model_cache_key: ${{ inputs.cache_key_suffix }} @@ -95,7 +95,7 @@ jobs: labeler-test-issues: needs: [labeler-download-issues, labeler-train-issues] if: ${{ inputs.test_issues && always() && (needs.labeler-download-issues.result == 'success' || needs.labeler-download-issues.result == 'skipped') && (needs.labeler-train-issues.result == 'success' || needs.labeler-train-issues.result == 'skipped') }} - uses: dotnet/issue-labeler/.github/workflows/test-issues.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 + uses: dotnet/issue-labeler/.github/workflows/test-issues.yml@68a3df3b6444ec3e2a37af4d5e2569df1d45201d # v1.0.1 with: model_cache_key: ${{ inputs.cache_key_suffix }} label_prefix: "area-" @@ -107,7 +107,7 @@ jobs: permissions: pull-requests: read actions: write - uses: dotnet/issue-labeler/.github/workflows/download-pulls.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 + uses: dotnet/issue-labeler/.github/workflows/download-pulls.yml@68a3df3b6444ec3e2a37af4d5e2569df1d45201d # v1.0.1 with: data_cache_key: ${{ inputs.cache_key_suffix }} pull_limit: ${{ inputs.data_limit && fromJSON(inputs.data_limit) || 0 }} @@ -119,7 +119,7 @@ jobs: if: ${{ inputs.train_pulls && always() && (needs.labeler-download-pulls.result == 'success' || needs.labeler-download-pulls.result == 'skipped') }} permissions: actions: write - uses: dotnet/issue-labeler/.github/workflows/train-pulls.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 + uses: dotnet/issue-labeler/.github/workflows/train-pulls.yml@68a3df3b6444ec3e2a37af4d5e2569df1d45201d # v1.0.1 with: data_cache_key: ${{ inputs.cache_key_suffix }} model_cache_key: ${{ inputs.cache_key_suffix }} @@ -127,7 +127,7 @@ jobs: labeler-test-pulls: needs: [labeler-download-pulls, labeler-train-pulls] if: ${{ inputs.test_pulls && always() && (needs.labeler-download-pulls.result == 'success' || needs.labeler-download-pulls.result == 'skipped') && (needs.labeler-train-pulls.result == 'success' || needs.labeler-train-pulls.result == 'skipped') }} - uses: dotnet/issue-labeler/.github/workflows/test-pulls.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 + uses: dotnet/issue-labeler/.github/workflows/test-pulls.yml@68a3df3b6444ec3e2a37af4d5e2569df1d45201d # v1.0.1 with: model_cache_key: ${{ inputs.cache_key_suffix }} label_prefix: "area-" From 487408fef0e9896588a077fa15e740f5dda5c1e4 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 12 Mar 2025 13:58:08 -0700 Subject: [PATCH 4/8] Try to fix workflow (#11080) --- .github/workflows/labeler-train.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/labeler-train.yml b/.github/workflows/labeler-train.yml index 635423cc7dd..f08b390cbb6 100644 --- a/.github/workflows/labeler-train.yml +++ b/.github/workflows/labeler-train.yml @@ -68,7 +68,11 @@ jobs: # threshold: 0.40 build-predictor: - uses: dotnet/issue-labeler/.github/workflows/build-predictor.yml@68a3df3b6444ec3e2a37af4d5e2569df1d45201d # v1.0.1 + permissions: + issues: read + pull-requests: read + actions: write + uses: dotnet/issue-labeler/.github/workflows/build-predictor.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 labeler-download-issues: needs: build-predictor @@ -76,7 +80,7 @@ jobs: permissions: issues: read actions: write - uses: dotnet/issue-labeler/.github/workflows/download-issues.yml@68a3df3b6444ec3e2a37af4d5e2569df1d45201d # v1.0.1 + uses: dotnet/issue-labeler/.github/workflows/download-issues.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 with: data_cache_key: ${{ inputs.cache_key_suffix }} issue_limit: ${{ inputs.data_limit && fromJSON(inputs.data_limit) || 0 }} @@ -87,7 +91,7 @@ jobs: if: ${{ inputs.train_issues && always() && (needs.labeler-download-issues.result == 'success' || needs.labeler-download-issues.result == 'skipped') }} permissions: actions: write - uses: dotnet/issue-labeler/.github/workflows/train-issues.yml@68a3df3b6444ec3e2a37af4d5e2569df1d45201d # v1.0.1 + uses: dotnet/issue-labeler/.github/workflows/train-issues.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 with: data_cache_key: ${{ inputs.cache_key_suffix }} model_cache_key: ${{ inputs.cache_key_suffix }} @@ -95,7 +99,7 @@ jobs: labeler-test-issues: needs: [labeler-download-issues, labeler-train-issues] if: ${{ inputs.test_issues && always() && (needs.labeler-download-issues.result == 'success' || needs.labeler-download-issues.result == 'skipped') && (needs.labeler-train-issues.result == 'success' || needs.labeler-train-issues.result == 'skipped') }} - uses: dotnet/issue-labeler/.github/workflows/test-issues.yml@68a3df3b6444ec3e2a37af4d5e2569df1d45201d # v1.0.1 + uses: dotnet/issue-labeler/.github/workflows/test-issues.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 with: model_cache_key: ${{ inputs.cache_key_suffix }} label_prefix: "area-" @@ -107,7 +111,7 @@ jobs: permissions: pull-requests: read actions: write - uses: dotnet/issue-labeler/.github/workflows/download-pulls.yml@68a3df3b6444ec3e2a37af4d5e2569df1d45201d # v1.0.1 + uses: dotnet/issue-labeler/.github/workflows/download-pulls.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 with: data_cache_key: ${{ inputs.cache_key_suffix }} pull_limit: ${{ inputs.data_limit && fromJSON(inputs.data_limit) || 0 }} @@ -119,7 +123,7 @@ jobs: if: ${{ inputs.train_pulls && always() && (needs.labeler-download-pulls.result == 'success' || needs.labeler-download-pulls.result == 'skipped') }} permissions: actions: write - uses: dotnet/issue-labeler/.github/workflows/train-pulls.yml@68a3df3b6444ec3e2a37af4d5e2569df1d45201d # v1.0.1 + uses: dotnet/issue-labeler/.github/workflows/train-pulls.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 with: data_cache_key: ${{ inputs.cache_key_suffix }} model_cache_key: ${{ inputs.cache_key_suffix }} @@ -127,7 +131,7 @@ jobs: labeler-test-pulls: needs: [labeler-download-pulls, labeler-train-pulls] if: ${{ inputs.test_pulls && always() && (needs.labeler-download-pulls.result == 'success' || needs.labeler-download-pulls.result == 'skipped') && (needs.labeler-train-pulls.result == 'success' || needs.labeler-train-pulls.result == 'skipped') }} - uses: dotnet/issue-labeler/.github/workflows/test-pulls.yml@68a3df3b6444ec3e2a37af4d5e2569df1d45201d # v1.0.1 + uses: dotnet/issue-labeler/.github/workflows/test-pulls.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 with: model_cache_key: ${{ inputs.cache_key_suffix }} label_prefix: "area-" From 6dfebc3b64ad3dd47cc9c0772a5236cb3bf2a440 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 12 Mar 2025 14:25:11 -0700 Subject: [PATCH 5/8] use main (#11081) --- .github/workflows/labeler-train.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/labeler-train.yml b/.github/workflows/labeler-train.yml index f08b390cbb6..53791a7f258 100644 --- a/.github/workflows/labeler-train.yml +++ b/.github/workflows/labeler-train.yml @@ -111,7 +111,7 @@ jobs: permissions: pull-requests: read actions: write - uses: dotnet/issue-labeler/.github/workflows/download-pulls.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 + uses: dotnet/issue-labeler/.github/workflows/download-pulls.yml@main with: data_cache_key: ${{ inputs.cache_key_suffix }} pull_limit: ${{ inputs.data_limit && fromJSON(inputs.data_limit) || 0 }} From 5aaa82b281db096cdc3f24953680bd3fee833ff4 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 12 Mar 2025 14:29:14 -0700 Subject: [PATCH 6/8] Revert "use main (#11081)" (#11082) This reverts commit 6dfebc3b64ad3dd47cc9c0772a5236cb3bf2a440. --- .github/workflows/labeler-train.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/labeler-train.yml b/.github/workflows/labeler-train.yml index 53791a7f258..f08b390cbb6 100644 --- a/.github/workflows/labeler-train.yml +++ b/.github/workflows/labeler-train.yml @@ -111,7 +111,7 @@ jobs: permissions: pull-requests: read actions: write - uses: dotnet/issue-labeler/.github/workflows/download-pulls.yml@main + uses: dotnet/issue-labeler/.github/workflows/download-pulls.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 with: data_cache_key: ${{ inputs.cache_key_suffix }} pull_limit: ${{ inputs.data_limit && fromJSON(inputs.data_limit) || 0 }} From 8857bc6fd57c98ab3636324c87d18f67faed13ff Mon Sep 17 00:00:00 2001 From: Jeff Handley Date: Wed, 12 Mar 2025 15:13:16 -0700 Subject: [PATCH 7/8] Declare permissions for labeler-train workflow. Parse the pull_page_size input. (#11083) --- .github/workflows/labeler-train.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/labeler-train.yml b/.github/workflows/labeler-train.yml index f08b390cbb6..2acfe17fe9c 100644 --- a/.github/workflows/labeler-train.yml +++ b/.github/workflows/labeler-train.yml @@ -45,6 +45,11 @@ on: required: true default: "staging" +permissions: + issues: read + pull-requests: read + actions: write + jobs: # Without specifying a pageSize of 1 for downloading pull requests, the requests time out # Directly invoking the individual workflows until https://github.com/dotnet/issue-labeler/issues/97 is addressed @@ -68,10 +73,6 @@ jobs: # threshold: 0.40 build-predictor: - permissions: - issues: read - pull-requests: read - actions: write uses: dotnet/issue-labeler/.github/workflows/build-predictor.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1 labeler-download-issues: @@ -115,7 +116,7 @@ jobs: with: data_cache_key: ${{ inputs.cache_key_suffix }} pull_limit: ${{ inputs.data_limit && fromJSON(inputs.data_limit) || 0 }} - page_size: ${{ inputs.pull_page_size }} + page_size: ${{ inputs.pull_page_size && fromJSON(inputs.pull_page_size) || 1 }} label_prefix: "area-" labeler-train-pulls: From 2427e62e1307d6d8e18959c9c3b9e74eb8c4be0a Mon Sep 17 00:00:00 2001 From: Kyle Sabo Date: Wed, 12 Mar 2025 15:27:51 -0700 Subject: [PATCH 8/8] Fix descriptions of invalid eventlog overflow policy (#9293) --- xml/System.Diagnostics/EventLog.xml | 45 ++++++++++------------- xml/System.Diagnostics/OverflowAction.xml | 13 ++++--- 2 files changed, 27 insertions(+), 31 deletions(-) diff --git a/xml/System.Diagnostics/EventLog.xml b/xml/System.Diagnostics/EventLog.xml index 0b21674e876..675f0ee02b5 100644 --- a/xml/System.Diagnostics/EventLog.xml +++ b/xml/System.Diagnostics/EventLog.xml @@ -2510,22 +2510,18 @@ SVC_UPDATE.EXE System.Int32 - Gets the number of days to retain entries in the event log. - The number of days that entries in the event log are retained. The default value is 7. + This property is deprecated. + To be added. - property to examine the current setting for an event log. Use to change the minimum number of days that each entry in the event log must be retained. - - The value depends on the configured overflow behavior of the event log. If the property for an event log is set to , then the value is 0. If the property for an event log is set to , then the value is -1. If the property for an event log is set to , then the value is greater than zero, and represents the number of days to retain event log entries when the event log is full. + has its set to , and the event log reaches its maximum size, then new entries are written only if they can replace entries whose age exceeds the period. Retaining event entries for a minimum period is appropriate when the event log is archived regularly. Otherwise, you risk losing new entries when the event log reaches its limit. To avoid losing new event information, set the minimum retention days for events based on your archive schedule for a particular event log. - - - -## Examples - The following example enumerates the event logs defined on the local computer, and displays configuration details for each event log. +> [!IMPORTANT] +> Support for the property was removed in Windows Vista and later operating systems. Setting this value can cause the Event Log to never overwrite events, and to drop all events to the channel once it is full. + +## Examples + The following example enumerates the event logs defined on the local computer, and displays configuration details for each event log. :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/EventLogProperties/CPP/source.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Diagnostics/EventLog/GetEventLogs/source1.cs" id="Snippet2"::: @@ -2576,8 +2572,8 @@ SVC_UPDATE.EXE - The overflow behavior for writing new entries to the event log. - The minimum number of days each event log entry is retained. This parameter is used only if is set to . + The overflow behavior for writing new entries to the event log. Must not be `OverwriteOlder`. + Deprecated. Must be 0. Changes the configured behavior for writing new entries when the event log reaches its maximum file size. [!NOTE] -> The overflow behavior takes effect only when an event log reaches its maximum file size. The overflow behavior does not affect writing a new entry to a log that can accommodate additional event log entries. +> The overflow behavior takes effect only when an event log reaches its maximum file size. The overflow behavior does not affect writing a new entry to a log that can accommodate additional event log entries. The method configures the overflow behavior of an event log. instance. After calling this method for the event log specified by the property, the and property values reflect the newly configured overflow behavior. > [!NOTE] -> This property represents a configuration setting for the event log represented by this instance. When the event log reaches its maximum size, this property specifies how the operating system handles new entries written by all event sources registered for the event log. +> This property represents a configuration setting for the event log represented by this instance. When the event log reaches its maximum size, this property specifies how the operating system handles new entries written by all event sources registered for the event log. + + Set the `action` parameter to to indicate that a new entry overwrites the oldest entry when the reaches its maximum size. If the `action` parameter is set to , the `retentionDays` parameter value is ignored. - Set the `action` parameter to to indicate that a new entry overwrites the oldest entry when the reaches its maximum size. If the `action` parameter is set to , the `retentionDays` parameter value is ignored. + Set the `action` parameter to to discard new events when the maximum log size is reached. If the `action` parameter is set to , the `retentionDays` parameter value is ignored. - Set the `action` parameter to to indicate that each new entry overwrites older entries when the reaches its maximum size. Specify the number of days that events must be retained in the log using the `retentionDays` parameter. Events written within the retention range are not overwritten by new entries. - - Set the `action` parameter to to discard new events when the maximum log size is reached. If the `action` parameter is set to , the `retentionDays` parameter value is ignored. +> [!WARNING] +> Never set the `action` parameter to . This value is deprecated and might cause the log to behave as if the `DoNotOverwrite` parameter was passed instead. > [!CAUTION] -> Setting the overflow policy to specifies that new entries are discarded when the event log is full. If you use this setting, ensure the event log is regularly archived and cleared to avoid reaching its maximum size limit. - - +> Setting the overflow policy to specifies that new entries are discarded when the event log is full. If you use this setting, ensure the event log is regularly archived and cleared to avoid reaching its maximum size limit. ## Examples The following example displays the configured overflow policy for a specified event log, and allows the user to select a new overflow policy setting for the event log. diff --git a/xml/System.Diagnostics/OverflowAction.xml b/xml/System.Diagnostics/OverflowAction.xml index 4b3b0b16ad6..583a46739b5 100644 --- a/xml/System.Diagnostics/OverflowAction.xml +++ b/xml/System.Diagnostics/OverflowAction.xml @@ -38,12 +38,13 @@ - New entries will be discarded. -- New entries will overwrite older entries. - -- New entries will either be discarded or will overwrite existing entries depending upon the age of the existing entries. +- New entries will overwrite older entries. Use the method to set the overflow behavior for an . Check the current configured behavior of an through its property. +> [!WARNING] +> The `OverwriteOlder` behavior is deprecated. Using this value might cause the Event Log to behave as if the `DoNotOverwrite` value was used instead, which will cause events to be discarded when the log is full. + ## Examples The following example enumerates the event logs defined on the local computer and displays configuration details for each event log. @@ -149,17 +150,17 @@ The following example enumerates the event logs defined on the local computer an 1 - Indicates that new events overwrite events older than specified by the property value when the event log is full. New events are discarded if the event log is full and there are no events older than specified by the property value. + This field is deprecated. [!WARNING] +> Do not use this value. Doing so might cause the Event Log to behave as if the `DoNotOverwrite` value was used instead. ]]> -