Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
124 changes: 124 additions & 0 deletions .github/skills/create-dnceng-kbe/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
---
name: create-dnceng-kbe
description: >
Draft or publish a caller-requested dotnet/dnceng Known Build Error outcome.
The caller chooses the action; the skill reuses supplied lookup evidence or
completes missing dnceng lookup context without changing that action.
---

# Draft a dotnet/dnceng Infrastructure Known Build Error

Use this skill after a caller has completed dnceng ownership and duplicate
triage and explicitly selected a draft or publication action.

This skill executes the selected action. It does not decide whether a dnceng KBE
is warranted or whether the result should be draft-only or live.

## Authoritative guidance

Read the current versions of these sources before drafting:

1. [dnceng infrastructure Known Issue form](https://github.com/dotnet/dnceng/blob/main/.github/ISSUE_TEMPLATE/z-build-break-infrastructure-issue-template.yml)
Comment thread
ViveliDuCh marked this conversation as resolved.
Resolved
2. [Arcade Known Issues guidance](https://github.com/dotnet/arcade/blob/main/Documentation/Build%20Analysis/KnownIssues.md)
3. [Arcade Known Issue JSON steps](https://github.com/dotnet/arcade/blob/main/Documentation/Build%20Analysis/KnownIssueJsonStepByStep.md)
4. [dnceng issue tracking guidance](https://github.com/dotnet/dnceng/blob/main/Documentation/TeamProcess/DevGuide/IssueTrackingGuidance.md)

Do not copy or recreate the dnceng issue template in this repository. Load its
current field order, labels, default content, and validation requirements. If
the authoritative form or guidance cannot be read, stop and report the blocked
draft instead of inventing a substitute. Record the resolved repository commit
SHA for each external source in the local draft so the artifact is reproducible.

## Input contract

The caller supplies:

- one concrete candidate already classified for a dnceng draft,
- a stable candidate ID, failure name or family, and build leg,
- the originating repository and PR,
- the failing build, leg, pipeline, queue, logs, and stable signature evidence,
- the Build Analysis infrastructure issue link when available,
- the requested action:
`draft-review`, `draft-new-dnceng`, `draft-recurrence-dnceng`,
`publish-new-dnceng`, or `publish-recurrence-dnceng`,
- dnceng duplicate-search and recurrence evidence when available,
- lookup mode: `reuse-supplied` or `complete-if-needed`,
- why repository ownership was rejected or remains uncertain,
- any missing evidence for a review-only draft,
- for publication actions: `caller=pr-failure-scan`, live mode, the prepared
draft path and fingerprint, explicit user permission to publish to
`dotnet/dnceng`, and the authenticated GitHub account.

Treat query parameters in a Build Analysis link as hints. Verify the destination
repository, issue-form name, labels, build, leg, and PR against the selected
check and authoritative form.

The requested action is mandatory. Reject contradictory action inputs. Do not
select a different action.

## Publication boundary

- Publication is allowed only for `publish-new-dnceng` or
`publish-recurrence-dnceng` requested by a live `pr-failure-scan` run.
- Explicit user permission for publication to `dotnet/dnceng` is mandatory.
Runtime or workflow publication authorization does not transfer.
- `dryrun`, `draft-review`, and caller-selected draft-only outcomes never
publish and never trigger a permission request.
- Reject publication when the prepared draft, fingerprint, authenticated
account, explicit permission, or caller identity is missing.

## Execute the requested action

1. Verify the requested action and apply the requested lookup mode:
- With `reuse-supplied`, require a conclusive dnceng lookup.
- With `complete-if-needed`, reuse conclusive supplied evidence; otherwise
run the dnceng duplicate and recurrence lookup before drafting.
- A direct user request with an explicit action and no lookup context uses
`complete-if-needed`.
The lookup may return an existing issue or block an unsafe duplicate, but it
must not select a different draft action.
2. Stop when the candidate contains potential security-sensitive material. Do
not create any GitHub issue, AzDO work item, comment, draft, or other
external artifact.
Comment thread
ViveliDuCh marked this conversation as resolved.
Resolved
3. Load the authoritative external form and guidance. Verify that the requested
action and supplied evidence are compatible with the current form.
4. Write one local Markdown review artifact. Prefer the session
artifact directory; otherwise use a temporary directory outside the runtime
checkout.
5. Render the current dnceng issue-form fields in their authoritative order and
fill them with verified evidence. Use Arcade's current Known Issue guidance
for the JSON signature. Preserve form-owned default content that maintainers
are expected to retain. If a form-owned link is broken, record that fact and
use the verified current guidance for analysis rather than silently
rewriting the external template.
6. Include the proposed title, current form labels, destination repository,
issue-form URL, prefilled Build Analysis link when available, and any
ownership uncertainty requiring maintainer review.
7. Clearly mark `draft-review` as incomplete and non-publishable. Include
recurrence evidence for `draft-recurrence-dnceng`.
8. For `publish-new-dnceng` or `publish-recurrence-dnceng`, verify the matching
prepared draft and fingerprint, perform a final narrow dnceng duplicate
safety check, verify the publication boundary above, append the required AI
disclosure, and publish exactly that draft.
9. Report both a clickable local-file link when supported and the plain
absolute path for drafts. Return the created issue URL for publication.
10. Never change the caller-selected action.

## Outcome contract

```json
{
"status": "created | drafted | existing | blocked | failed",
"requestedAction": "draft-review | draft-new-dnceng | draft-recurrence-dnceng | publish-new-dnceng | publish-recurrence-dnceng",
"lookupMode": "reuse-supplied | complete-if-needed",
"candidateId": "stable caller-provided identifier",
"failure": "failure name or family",
"buildLeg": "failing build leg",
"signature": "concise stable signature summary",
"proposedTitle": "draft title, or empty string",
"issueUrl": "verified existing dotnet/dnceng issue URL, or null",
"draftPath": "absolute local path or null",
"missingEvidence": ["ownership or verification items still required"],
"message": "concise evidence-based result"
}
```
15 changes: 15 additions & 0 deletions .github/skills/create-kbe/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@ Read and follow these in order:
2. the caller workflow or tool instructions that selected this failure and decided it is in scope
3. any workflow-specific formatting or dry-run requirements for the current caller

When the caller already provides a complete, conclusive result from the shared
lookup, reuse it. Otherwise run the applicable shared lookup before creating or
updating anything. This preserves direct use of the skill while avoiding a
duplicate broad search for callers that already completed it.

The shared instructions may classify the failure as a `dotnet/dnceng`
infrastructure outcome. In that case:

- do not use the runtime KBE body template,
- report an existing dnceng KBE directly when one matched,
- use [`create-dnceng-kbe`](../create-dnceng-kbe/SKILL.md) for a requested local
dnceng draft,
- publish to dnceng only through the explicit-permission path documented by the
caller; runtime publication authorization does not transfer.

## Core rules

- One failure shape = one KBE outcome.
Expand Down
98 changes: 81 additions & 17 deletions .github/skills/pr-failure-scan/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ description: >
Analyze a dotnet/runtime PR's CI failures, skip failures already known to
Build Analysis, find matching Known Build Errors, and create or draft new
KBEs for the remaining failures. Supports dry-run output to local markdown
files instead of creating GitHub issues.
files instead of creating GitHub issues. Also handles exact check-run links,
servicing propagation, and dnceng infrastructure KBE outcomes.
---

# PR Failure Scan Skill

Use this skill for requests like:

- `/pr-failure-scan <PR URL>`
- `/pr-failure-scan <PR check-run URL>`
- `/pr-failure-scan <PR URL> dryrun`
- `create KBEs for PR <number>`

Expand All @@ -35,6 +37,7 @@ Accept one of:

- a PR number,
- a PR URL,
- a deep link to a PR check run with a numeric `check_run_id`,
- text containing a PR reference,
- an optional trailing `dryrun` token.

Expand All @@ -45,6 +48,7 @@ Examples:

- `/pr-failure-scan 123456`
- `/pr-failure-scan https://github.com/dotnet/runtime/pull/123456`
- `/pr-failure-scan https://github.com/dotnet/runtime/pull/123456/checks?check_run_id=123456789`
- `/pr-failure-scan https://github.com/dotnet/runtime/pull/123456 dryrun`

## Step 1: Resolve identities and require explicit permission for non-owned PRs
Expand All @@ -65,13 +69,24 @@ If the user declines, stop immediately.

## Step 2: Gather PR CI context

Use the latest completed check runs for the PR head SHA.
If the input identifies a specific check run, resolve that exact completed run,
verify that it belongs to the referenced PR, and use its check suite or workflow
attempt and head SHA. Otherwise, use the latest completed check runs for the PR
head SHA.

Collect all of:

1. The `Build Analysis` check run payload from the GitHub REST API.
2. The non-success CI check runs for the PR head SHA.
3. The AzDO build URLs linked from those check runs.
1. The selected check run, when one was supplied.
2. The `Build Analysis` check run payload from the GitHub REST API for the
selected suite or workflow attempt, or for the PR head SHA when no exact
check run was supplied.
3. The non-success CI check runs associated with that same suite or attempt.
4. The AzDO build URLs linked from those check runs.

Do not silently replace a selected historical run with the latest run. When
sibling checks cannot be correlated unambiguously, keep the selected run as an
explicit candidate and report unavailable evidence rather than mixing attempts
that share a SHA.

The local skill has a different candidate-source model than the scheduled
workflow:
Expand All @@ -86,8 +101,11 @@ workflow:
Build the candidate list from two sources:

1. **Build Analysis unknowns on analyzed pipelines.**
- Parse the `Build Analysis` check text for `Create issue in this repo` links
and the surrounding failure description.
- Parse the `Build Analysis` check text for both `Create issue in this repo`
and `Create issue against infrastructure team` links and their surrounding
failure descriptions.
- Record the proposed destination, issue form, labels, build, build leg, and
PR encoded in the link as hints; verify them against the selected evidence.
- Each such entry is an in-scope candidate unless you later find an existing
matching KBE.
2. **Failed pipelines explicitly excluded from Build Analysis.**
Expand All @@ -112,13 +130,28 @@ For each candidate failure, do the following:
- the relevant build or task log,
- for Helix-submitted legs, the Helix console log or failure details when
accessible.
2. Extract the narrowest signature that fits the shared rules.
3. Run the shared KBE lookup flow from
2. Decide whether the failure is **related**, **unrelated**, or **unclear** with
respect to the current PR:
- **related**: report that the PR must be fixed and stop KBE processing for
this candidate;
- **unrelated**: continue with KBE lookup and handling;
- **unclear**: search for existing tracking, but keep any proposed new issue
as a non-publishable review draft until the relationship is resolved.
3. Use the shared destination-classification section when runtime ownership is
not already established.
4. For a runtime candidate, extract the narrowest signature and run the existing
shared runtime KBE lookup flow from
`.github/workflows/shared/create-kbe.instructions.md`.
4. Classify the candidate into exactly one of these buckets:
5. Classify the runtime candidate into exactly one of these buckets:
- **new KBE needed**
- **existing KBE matched but Build Analysis likely missed it**
- **unhandled**
6. For a dnceng candidate, preserve the shared dnceng classification and either
report the existing issue, prepare a new/recurrence draft, prepare a
non-publishable review draft, or mark the failure unhandled.
7. When the PR targets `release/<major>.<minor>`, read and follow
[`references/servicing-triage.md`](references/servicing-triage.md) after the
normal runtime lookup and before any live publication.

### PR-specific guidance for excluded or partially-analyzed pipelines

Expand Down Expand Up @@ -168,11 +201,11 @@ In particular:

## Step 5: Write draft files and optionally create live issues

### Draft files for all new KBEs
### Draft files for all new runtime KBEs

For every item in the **new KBE needed** bucket, always write a markdown draft
file before deciding whether to create a GitHub issue. This applies to both
`dryrun` and live mode.
For every runtime item in the **new KBE needed** bucket, always write a markdown
draft file before deciding whether to create a GitHub issue. This applies to
both `dryrun` and live mode.

1. Write one markdown file per `new KBE needed` item.
2. Prefer the session artifact directory if it is available. Otherwise, use a
Expand All @@ -190,7 +223,9 @@ Each draft file should contain:
These dry-run files are **review artifacts**, not necessarily byte-for-byte live
issue bodies. Keep them easy to compare and edit on disk.

Prefer this layout for dry-run files:
Prefer this layout for runtime dry-run files. Do not use it for dnceng drafts;
those must follow the authoritative dnceng issue form through
[`create-dnceng-kbe`](../create-dnceng-kbe/SKILL.md).

````markdown
# Draft KBE issue
Expand Down Expand Up @@ -295,9 +330,27 @@ for example:
> [!NOTE]
> This issue was prepared with GitHub Copilot assistance.

### Infrastructure KBE drafts and publication

For every shared result classified as a new dnceng KBE, dnceng recurrence, or
useful infrastructure review draft, use
[`create-dnceng-kbe`](../create-dnceng-kbe/SKILL.md) to create the local draft.
The runtime draft layout above does not apply to these drafts.

- In `dryrun`, stop after producing local drafts.
- A review draft or any caller-selected draft-only result is never publishable;
do not check for permission and do not ask the user whether to publish it.
- In live mode, a publishable new or recurrence draft may be published only
after the complete batch and servicing analysis are finished and the user
explicitly authorizes publication to `dotnet/dnceng`.
- Agent Merge/runtime publication authorization does not transfer to dnceng.
- Before publication, show the proposed title, labels, complete form body,
authenticated account, affected failures, and local draft path, then run a
final narrow dnceng duplicate check.

## Step 6: Final output format

The final response must contain all four sections below.
The final response must contain all six sections below.

### 1. New issues created or draft files

Expand All @@ -324,7 +377,18 @@ For every such failure, provide:
- why it appears to match,
- why Build Analysis likely missed it.

### 4. Failures not handled
### 4. Infrastructure KBE outcomes

List existing dnceng issues, local draft paths, created dnceng issue URLs,
recurrence findings, blocked lookups, and ownership uncertainty.

### 5. Servicing findings

For release-targeted PRs, report tracker reuse, matcher gaps, main/release/VMR
propagation, and any recommended maintainer `/backport` command. Never invoke
the backport workflow.

### 6. Failures not handled

For every unhandled failure, provide:

Expand Down
Loading