Skip to content

Commit 43e2876

Browse files
Merge pull request #11085 from dotnet/main
Merge main into live
2 parents 291621e + 2427e62 commit 43e2876

File tree

8 files changed

+313
-31
lines changed

8 files changed

+313
-31
lines changed
Lines changed: 17 additions & 0 deletions
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 }}
Lines changed: 13 additions & 0 deletions
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
Lines changed: 32 additions & 0 deletions
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"
Lines changed: 43 additions & 0 deletions
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

Lines changed: 42 additions & 0 deletions
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

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
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+
pull_page_size:
38+
description: "Max number of pulls to download per page"
39+
type: number
40+
default: 1
41+
42+
cache_key_suffix:
43+
description: "The cache key suffix to use for staging data/models (use 'LIVE' to bypass staging)"
44+
type: string
45+
required: true
46+
default: "staging"
47+
48+
permissions:
49+
issues: read
50+
pull-requests: read
51+
actions: write
52+
53+
jobs:
54+
# Without specifying a pageSize of 1 for downloading pull requests, the requests time out
55+
# Directly invoking the individual workflows until https://github.com/dotnet/issue-labeler/issues/97 is addressed
56+
#
57+
# labeler-train:
58+
# permissions:
59+
# issues: read
60+
# pull-requests: read
61+
# actions: write
62+
# uses: dotnet/issue-labeler/.github/workflows/train.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1
63+
# with:
64+
# download_issues: ${{ inputs.download_issues }}
65+
# train_issues: ${{ inputs.train_issues }}
66+
# test_issues: ${{ inputs.test_issues }}
67+
# download_pulls: ${{ inputs.download_pulls }}
68+
# train_pulls: ${{ inputs.train_pulls }}
69+
# test_pulls: ${{ inputs.test_pulls }}
70+
# data_limit: ${{ inputs.data_limit && fromJSON(inputs.data_limit) || 0 }}
71+
# cache_key_suffix: ${{ inputs.cache_key_suffix }}
72+
# label_prefix: "area-"
73+
# threshold: 0.40
74+
75+
build-predictor:
76+
uses: dotnet/issue-labeler/.github/workflows/build-predictor.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1
77+
78+
labeler-download-issues:
79+
needs: build-predictor
80+
if: ${{ inputs.download_issues }}
81+
permissions:
82+
issues: read
83+
actions: write
84+
uses: dotnet/issue-labeler/.github/workflows/download-issues.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1
85+
with:
86+
data_cache_key: ${{ inputs.cache_key_suffix }}
87+
issue_limit: ${{ inputs.data_limit && fromJSON(inputs.data_limit) || 0 }}
88+
label_prefix: "area-"
89+
90+
labeler-train-issues:
91+
needs: labeler-download-issues
92+
if: ${{ inputs.train_issues && always() && (needs.labeler-download-issues.result == 'success' || needs.labeler-download-issues.result == 'skipped') }}
93+
permissions:
94+
actions: write
95+
uses: dotnet/issue-labeler/.github/workflows/train-issues.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1
96+
with:
97+
data_cache_key: ${{ inputs.cache_key_suffix }}
98+
model_cache_key: ${{ inputs.cache_key_suffix }}
99+
100+
labeler-test-issues:
101+
needs: [labeler-download-issues, labeler-train-issues]
102+
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') }}
103+
uses: dotnet/issue-labeler/.github/workflows/test-issues.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1
104+
with:
105+
model_cache_key: ${{ inputs.cache_key_suffix }}
106+
label_prefix: "area-"
107+
threshold: 0.40
108+
109+
labeler-download-pulls:
110+
needs: build-predictor
111+
if: ${{ inputs.download_pulls }}
112+
permissions:
113+
pull-requests: read
114+
actions: write
115+
uses: dotnet/issue-labeler/.github/workflows/download-pulls.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1
116+
with:
117+
data_cache_key: ${{ inputs.cache_key_suffix }}
118+
pull_limit: ${{ inputs.data_limit && fromJSON(inputs.data_limit) || 0 }}
119+
page_size: ${{ inputs.pull_page_size && fromJSON(inputs.pull_page_size) || 1 }}
120+
label_prefix: "area-"
121+
122+
labeler-train-pulls:
123+
needs: labeler-download-pulls
124+
if: ${{ inputs.train_pulls && always() && (needs.labeler-download-pulls.result == 'success' || needs.labeler-download-pulls.result == 'skipped') }}
125+
permissions:
126+
actions: write
127+
uses: dotnet/issue-labeler/.github/workflows/train-pulls.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1
128+
with:
129+
data_cache_key: ${{ inputs.cache_key_suffix }}
130+
model_cache_key: ${{ inputs.cache_key_suffix }}
131+
132+
labeler-test-pulls:
133+
needs: [labeler-download-pulls, labeler-train-pulls]
134+
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') }}
135+
uses: dotnet/issue-labeler/.github/workflows/test-pulls.yml@f0c098669828a134c0313adf3f58c1909e555d86 # v1.0.1
136+
with:
137+
model_cache_key: ${{ inputs.cache_key_suffix }}
138+
label_prefix: "area-"
139+
threshold: 0.40

xml/System.Diagnostics/EventLog.xml

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2510,22 +2510,18 @@ SVC_UPDATE.EXE
25102510
<ReturnType>System.Int32</ReturnType>
25112511
</ReturnValue>
25122512
<Docs>
2513-
<summary>Gets the number of days to retain entries in the event log.</summary>
2514-
<value>The number of days that entries in the event log are retained. The default value is 7.</value>
2513+
<summary>This property is deprecated.</summary>
2514+
<value>To be added.</value>
25152515
<remarks>
2516-
<format type="text/markdown"><![CDATA[
2517-
2518-
## Remarks
2519-
Use the <xref:System.Diagnostics.EventLog.MinimumRetentionDays%2A> property to examine the current setting for an event log. Use <xref:System.Diagnostics.EventLog.ModifyOverflowPolicy%2A> to change the minimum number of days that each entry in the event log must be retained.
2520-
2521-
The <xref:System.Diagnostics.EventLog.MinimumRetentionDays%2A> value depends on the configured overflow behavior of the event log. If the <xref:System.Diagnostics.OverflowAction> property for an event log is set to <xref:System.Diagnostics.OverflowAction.OverwriteAsNeeded>, then the <xref:System.Diagnostics.EventLog.MinimumRetentionDays%2A> value is 0. If the <xref:System.Diagnostics.OverflowAction> property for an event log is set to <xref:System.Diagnostics.OverflowAction.DoNotOverwrite>, then the <xref:System.Diagnostics.EventLog.MinimumRetentionDays%2A> value is -1. If the <xref:System.Diagnostics.OverflowAction> property for an event log is set to <xref:System.Diagnostics.OverflowAction.OverwriteOlder>, then the <xref:System.Diagnostics.EventLog.MinimumRetentionDays%2A> value is greater than zero, and represents the number of days to retain event log entries when the event log is full.
2516+
<format type="text/markdown"><![CDATA[
2517+
2518+
## Remarks
25222519
2523-
The overflow behavior only occurs when an event log reaches its size limit. When an <xref:System.Diagnostics.EventLog> has its <xref:System.Diagnostics.EventLog.OverflowAction%2A> set to <xref:System.Diagnostics.OverflowAction.OverwriteOlder>, and the event log reaches its maximum size, then new entries are written only if they can replace entries whose age exceeds the <xref:System.Diagnostics.EventLog.MinimumRetentionDays%2A> 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.
2524-
2525-
2526-
2527-
## Examples
2528-
The following example enumerates the event logs defined on the local computer, and displays configuration details for each event log.
2520+
> [!IMPORTANT]
2521+
> Support for the <xref:System.Diagnostics.EventLog.MinimumRetentionDays%2A> 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.
2522+
2523+
## Examples
2524+
The following example enumerates the event logs defined on the local computer, and displays configuration details for each event log.
25292525
25302526
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR/EventLogProperties/CPP/source.cpp" id="Snippet2":::
25312527
:::code language="csharp" source="~/snippets/csharp/System.Diagnostics/EventLog/GetEventLogs/source1.cs" id="Snippet2":::
@@ -2576,8 +2572,8 @@ SVC_UPDATE.EXE
25762572
<Parameter Name="retentionDays" Type="System.Int32" Index="1" FrameworkAlternate="net-10.0-pp;net-8.0-pp;net-9.0-pp;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.6.2-pp;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;netstandard-2.0-pp;windowsdesktop-10.0;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0;windowsdesktop-6.0;windowsdesktop-7.0;windowsdesktop-8.0;windowsdesktop-9.0" />
25772573
</Parameters>
25782574
<Docs>
2579-
<param name="action">The overflow behavior for writing new entries to the event log.</param>
2580-
<param name="retentionDays">The minimum number of days each event log entry is retained. This parameter is used only if <paramref name="action" /> is set to <see cref="F:System.Diagnostics.OverflowAction.OverwriteOlder" />.</param>
2575+
<param name="action">The overflow behavior for writing new entries to the event log. Must not be `OverwriteOlder`.</param>
2576+
<param name="retentionDays">Deprecated. Must be 0.</param>
25812577
<summary>Changes the configured behavior for writing new entries when the event log reaches its maximum file size.</summary>
25822578
<remarks>
25832579
<format type="text/markdown"><![CDATA[
@@ -2586,23 +2582,22 @@ SVC_UPDATE.EXE
25862582
The overflow behavior for an event log specifies what happens when new entries are to be written to a log that has reached its maximum file size.
25872583
25882584
> [!NOTE]
2589-
> 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.
2585+
> 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.
25902586
25912587
The <xref:System.Diagnostics.EventLog.ModifyOverflowPolicy%2A> method configures the overflow behavior of an event log. <xref:System.Diagnostics.EventLog> instance. After calling this method for the event log specified by the <xref:System.Diagnostics.EventLog.Log%2A> property, the <xref:System.Diagnostics.EventLog.OverflowAction%2A> and <xref:System.Diagnostics.EventLog.MinimumRetentionDays%2A> property values reflect the newly configured overflow behavior.
25922588
25932589
> [!NOTE]
2594-
> 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.
2590+
> 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.
2591+
2592+
Set the `action` parameter to <xref:System.Diagnostics.OverflowAction.OverwriteAsNeeded> to indicate that a new entry overwrites the oldest entry when the <xref:System.Diagnostics.EventLog> reaches its maximum size. If the `action` parameter is set to <xref:System.Diagnostics.OverflowAction.OverwriteAsNeeded>, the `retentionDays` parameter value is ignored.
25952593
2596-
Set the `action` parameter to <xref:System.Diagnostics.OverflowAction.OverwriteAsNeeded> to indicate that a new entry overwrites the oldest entry when the <xref:System.Diagnostics.EventLog> reaches its maximum size. If the `action` parameter is set to <xref:System.Diagnostics.OverflowAction.OverwriteAsNeeded>, the `retentionDays` parameter value is ignored.
2594+
Set the `action` parameter to <xref:System.Diagnostics.OverflowAction.DoNotOverwrite> to discard new events when the maximum log size is reached. If the `action` parameter is set to <xref:System.Diagnostics.OverflowAction.DoNotOverwrite>, the `retentionDays` parameter value is ignored.
25972595
2598-
Set the `action` parameter to <xref:System.Diagnostics.OverflowAction.OverwriteOlder> to indicate that each new entry overwrites older entries when the <xref:System.Diagnostics.EventLog> 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.
2599-
2600-
Set the `action` parameter to <xref:System.Diagnostics.OverflowAction.DoNotOverwrite> to discard new events when the maximum log size is reached. If the `action` parameter is set to <xref:System.Diagnostics.OverflowAction.DoNotOverwrite>, the `retentionDays` parameter value is ignored.
2596+
> [!WARNING]
2597+
> Never set the `action` parameter to <xref:System.Diagnostics.OverflowAction.OverwriteOlder>. This value is deprecated and might cause the log to behave as if the `DoNotOverwrite` parameter was passed instead.
26012598
26022599
> [!CAUTION]
2603-
> Setting the overflow policy to <xref:System.Diagnostics.OverflowAction.DoNotOverwrite> 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.
2604-
2605-
2600+
> Setting the overflow policy to <xref:System.Diagnostics.OverflowAction.DoNotOverwrite> 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.
26062601
26072602
## Examples
26082603
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.

0 commit comments

Comments
 (0)