You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
printf'%s\t%s\n'"$key""aw_<id>">> /tmp/gh-aw/agent/filed.tsv # after emit
232
235
```
233
236
237
+
**Cross-definition dedup (check second).** A KBE matches on signature text regardless of which pipeline definition produced it, so do NOT file a second KBE for a signature already filed this run under a different `definition_id`. After the exact-key check above misses, also check the definition-independent key `<queue>|<stress_mode>|<signature_norm>`. On match, record `skipped: cross-def dup of filed-issue #aw_<id> earlier in this run` and stop. Do NOT proceed to Branch B: `aw_<id>` is a safe-output ID from this run, not a real issue number, and rule #9 forbids same-run test-disable PRs. The per-definition test-disable PR (if test-disable is welcome on the resulting KBE) will surface on the next run, once the KBE has a real issue number. Append this key too after every Branch A emission.
238
+
239
+
```bash
240
+
xkey="<queue>|<stress_mode>|${signature_norm}"
241
+
test -f /tmp/gh-aw/agent/filed.tsv && cut -f1 /tmp/gh-aw/agent/filed.tsv | grep -Fxq "$xkey"# cross-def dup if exit 0
242
+
printf'%s\t%s\n'"$xkey""aw_<id>">> /tmp/gh-aw/agent/filed.tsv # after emit
243
+
```
244
+
234
245
#### Step 4.1 — Load the matching skill
235
246
236
247
| Pipeline category | Skill |
@@ -250,6 +261,15 @@ Follow exactly these sections from `.github/workflows/shared/create-kbe.instruct
250
261
3.`<a id="search-existing-prs"></a>` / `## Search for existing PRs already handling the failure`
251
262
4.`<a id="verify-embedded-issues"></a>` / `## Verify every embedded issue number exists`
252
263
264
+
When searching, account for the fact that the same signature can be filed in
265
+
different `ErrorMessage` representations. A KBE recorded in `<a id="kbe-array-form"></a>`
266
+
multi-line array form will not surface from a single-substring search, and vice
267
+
versa. Before concluding "no existing KBE", also search each individual array
268
+
element / log line of the signature on its own (not just the joined form), and
269
+
search the most distinctive single substring even when you intend to file the
270
+
array form. If any of these variant-form searches surfaces a candidate, treat it
271
+
as `existing-kbe` rather than filing a duplicate.
272
+
253
273
Record the same outcomes described there:
254
274
255
275
-`existing-kbe #<n>`
@@ -261,7 +281,8 @@ Record the same outcomes described there:
261
281
262
282
Read the candidate KBE / tracker body + the latest 5 comments (not just the most recent). Also read the body + latest 5 comments of ANY issue referenced in the KBE body (e.g. `refs #<n>`, `Tracking: dotnet/runtime#<n>`) — maintainer signals on the root-cause issue override the KBE. Skip the test-disable (record `-> skipped: do-not-disable on issue #<n>`) if ANY of:
263
283
264
-
- Body or recent comment from any `MEMBER`/`OWNER` mentions one of (case-insensitive): `please don't disable`, `do not mute`, `do not disable`, `keep failing`, `investigation in progress`, `fix-forward`, `fix forward`, `should be supported`, `will investigate`, `wait for #`, `landing in #`.
284
+
- Body or recent comment from any `MEMBER`/`OWNER` mentions one of (case-insensitive): `please don't disable`, `do not mute`, `do not disable`, `keep failing`, `investigation in progress`, `fix-forward`, `fix forward`, `should be supported`, `will investigate`, `wait for #`, `landing in #`, `trying to understand`, `without disabling`, `i'm fixing`, `i am fixing`, `understand the problem`, `investigating root cause`, `find the root cause`.
285
+
- Heuristic catch-all: any `MEMBER`/`OWNER` comment expressing investigation or fix-forward intent, even when no exact phrase above matches. Treat first-person statements about understanding, diagnosing, or fixing the failure (e.g. "I'm looking into this", "we should understand why", "I'd rather fix the pipeline than mute") as a do-not-disable signal. When the comment reads as a maintainer choosing to investigate rather than mute, skip the test-disable.
265
286
- Issue carries a label semantically equivalent to "do not mute" (verify the label exists in `dotnet/runtime` before relying on it; do not invent labels).
266
287
- Most recent area-owner comment within the last 14 days opposes disabling on procedural grounds.
267
288
- A prior `[ci-scan]` test-disable PR for the same test (or same KBE `#<n>`) was **closed without merge** within the last 30 days. Search `is:pr is:closed -is:merged "<test-name>" "[ci-scan]" closed:>=<30-days-ago>` and `is:pr is:closed -is:merged "#<n>" "[ci-scan]" closed:>=<30-days-ago>` (compute `<30-days-ago>` as the ISO date 30 days before the scan run). For each hit, fetch the PR comments and skip if any commenter with `authorAssociation``MEMBER` or `OWNER` used any of the keywords listed above. The combination of a maintainer pushback comment plus a non-merge close is the do-not-disable signal; the closer does not need to be the same maintainer. Re-filing requires fresh evidence such as a new maintainer comment on the KBE greenlighting the disable, or a clearly different failure signature. Record `-> skipped: do-not-disable, prior PR #<n> closed without merge after maintainer pushback`.
@@ -290,12 +311,16 @@ No meta / aggregate / outage issues. Every KBE is keyed to a single `(definition
290
311
291
312
**Branch A — No existing KBE; signature is stable.**
292
313
293
-
Stable means >= 2 occurrences in the ~10-build window, OR a build break that fails all legs of the current build (block-everyone severity that warrants filing on first sight). Emit one `create_issue` using exactly the shared new-KBE template from `.github/workflows/shared/create-kbe.instructions.md` section `<a id="new-kbe-template"></a>` / `## New-KBE template`, including whichever of `<a id="literal-kbe-template"></a>` / `### KBE issue body - literal substring match`, `<a id="regex-kbe-template"></a>` / `### KBE issue body - regex match`, or `<a id="kbe-array-form"></a>` / `### KBE multi-line array form` fits the signature. Apply both `Known Build Error` and `blocking-clean-ci` labels so the org project auto-add rule picks it up; do NOT try to mutate the project from this workflow. Append to the same-run dedup cache (Step 4.0) after emission.
314
+
Stable means >= 2 occurrences across >= 2 distinct builds in the ~10-build window, OR a build break that fails all legs of the current build (block-everyone severity that warrants filing on first sight). Multiple legs, retries, or work items of the SAME build (same build id) count as a single occurrence, not two — a one-off failure that appears in only one build is NOT stable; record `skipped: < 2 occurrences and not blocking` and let the next run revisit. Emit one `create_issue` using exactly the shared new-KBE template from `.github/workflows/shared/create-kbe.instructions.md` section `<a id="new-kbe-template"></a>` / `## New-KBE template`, including whichever of `<a id="literal-kbe-template"></a>` / `### KBE issue body - literal substring match`, `<a id="regex-kbe-template"></a>` / `### KBE issue body - regex match`, or `<a id="kbe-array-form"></a>` / `### KBE multi-line array form` fits the signature. Apply both `Known Build Error` and `blocking-clean-ci` labels so the org project auto-add rule picks it up; do NOT try to mutate the project from this workflow. Append to the same-run dedup cache (Step 4.0) after emission.
315
+
316
+
**Match-count gate.** Reject the emit if the body lacks `<!-- ci-scan-match-count: <N> hits in failure.log -->` with `N >= 1`. Treat an absent marker as `N=0` and record the same skip reason check #7 of the shared instructions uses: `skipped: signature did not match failure.log (N=<count>)`. Rationale, log-source caveats, and native-assert handling live in check #7.
294
317
295
318
If the shared KBE lookup flow recorded `linked-tracker #<tracker>`, cross-link it as `Tracking: dotnet/runtime#<tracker>` in the KBE body. Test-disable PR is deferred to the next run.
296
319
297
320
**Branch B — Existing KBE; no test-disable PR; test-disable is welcome (Step 4.7 clean).**
298
321
322
+
Before emitting, re-confirm the linked KBE is still `open`. If it has been closed (fixed, not planned, or duplicate), do NOT emit a test-disable PR against it — an orphaned PR referencing a closed KBE has no tracking issue to gate its revert. Record `skipped: linked KBE #<n> is closed` and stop for this signature; the next run will re-evaluate via Step 4.2 and may file a fresh KBE through Branch A if the failure still recurs. Do not fall through to Branch A this run (Step 5's one-outcome-per-signature rule).
323
+
299
324
Emit one `create_pull_request` using the Test-disable PR template. Diff <= 5 lines; only test annotations or csproj flags. Body MUST include `Linked KBE: #<n>` as a top-level line plus the Step 4.8 four-question block.
300
325
301
326
Build-break KBEs cannot be disabled — there is no test annotation that can skip a compile error. Skip Branch B for build-break signatures (record `skipped: build break — no test-disable path` in the tally) and rely on Branch C (small-fix PR) when the fix is mechanical, or on the area owner otherwise.
Copy file name to clipboardExpand all lines: docs/coding-guidelines/code-formatting-tools.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,6 +88,8 @@ The following code block can be used as the contents of the `pre-commit` file to
88
88
89
89
```sh
90
90
#!/bin/sh
91
-
./eng/formatting/format.sh
92
91
92
+
./eng/formatting/format.sh
93
93
```
94
+
95
+
Make sure the file is executable (`chmod +x .git/hooks/pre-commit`). If `git config core.hooksPath` points elsewhere, set it with `git config core.hooksPath .git/hooks`.
Copy file name to clipboardExpand all lines: docs/coding-guidelines/interop-guidelines.md
+11-12Lines changed: 11 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ internal static partial class Interop
34
34
...
35
35
internalstaticpartialclassInterop
36
36
{
37
-
internalstaticpartialclassmincore { ... }
37
+
internalstaticpartialclassMincore { ... }
38
38
}
39
39
```
40
40
- With few exceptions, the only methods that should be defined in these interop types are DllImports.
@@ -49,7 +49,9 @@ internal static partial class Interop
49
49
```
50
50
\Common\src\Interop
51
51
\Windows
52
-
\mincore
52
+
\Kernel32
53
+
... interop files
54
+
\Mincore
53
55
... interop files
54
56
\Unix
55
57
\libc
@@ -71,8 +73,8 @@ As shown above, platforms may be additive, in that an assembly may use functiona
71
73
\libc
72
74
\Interop.strerror.cs
73
75
\Windows
74
-
\mincore
75
-
\Interop.OutputDebugString.cs
76
+
\Mincore
77
+
\Interop.WaitOnAddress.cs <-- Also contains WakeByAddressSingle
76
78
```
77
79
78
80
- If structs/constants will be used on their own without an associated DllImport, or if they may be used with multiple DllImports not in the same file, they should be declared in a separate file.
@@ -81,9 +83,9 @@ As shown above, platforms may be additive, in that an assembly may use functiona
81
83
```
82
84
\Common\src\Interop
83
85
\Windows
84
-
\mincore
85
-
\Interop.DuplicateHandle_SafeTokenHandle.cs
86
-
\Interop.DuplicateHandle_IntPtr.cs
86
+
\Kernel32
87
+
\Interop.DuplicateHandle_SafeFileHandle.cs
88
+
\Interop.DuplicateHandle_SafePipeHandle.cs
87
89
```
88
90
89
91
- The library names used per-platform are stored in internal constants in the Interop class in a private Libraries class in a per-platform file named Interop.Libraries.cs. These constants are then used for all DllImports to that library, rather than having the string duplicated each time, e.g.
@@ -94,12 +96,9 @@ internal static partial class Interop // contents of Common\src\Interop\Windows\
0 commit comments