Skip to content

Commit c76a70d

Browse files
committed
Add triage skill
1 parent db8279c commit c76a70d

2 files changed

Lines changed: 89 additions & 0 deletions

File tree

.agents/skills/SKILL.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
name: triage
3+
description: Use this skill to triage an incoming issue on the EF Core PostgreSQL provider repo (bug report or feature request). Sets the issue type (bug/feature), attempts to arrive at a minimal repro reproducing the bug, checks whether it represents a regression, finds possible duplicates, etc.
4+
---
5+
6+
# EF Issue Triage
7+
8+
This skill covers triaging and reproducing incoming issues on the repository for the PostgreSQL provider of Entity Framework Core. To do so, read the issue in question (provided as input in the prompt), as well as any linked issues/code/resources, apply appropriate classifications and assignments, and for alleged bugs, try to arrive at a minimal repro. User-submitted bug reports frequently provide only fragmentary information and code snippets, forcing you to try to fill in the missing information in the effort to create a minimal repro; valuable information is frequently provided in free-form text, which you need to integrate into the repro as code.
9+
10+
## High-level steps
11+
12+
1. Read the issue in question and any linked issues/code/resources.
13+
2. Assess whether the issue involves any sort of security concern. If it does, either because the reporting user claims so, or because you suspect there might be a security aspect that the reporting user hasn't mentioned, **exit immediately**. **Do not** continue processing or post anything on issues which may involve any sort of security aspect.
14+
3. Determine whether the issue is a feature or bug, and set the GitHub issue type accordingly.
15+
4. Produce a minimal repro
16+
1. If the issue was determined to be a feature request, skip the minimal repro in this step; continue with the remaining triage steps (duplicate search and final report).
17+
2. If, on the other hand, the issue was determined to be a bug report, attempt to produce a minimal repro as a console program which confirms that the bug is genuine. See "Creating a minimal repro" below for instructions.
18+
3. If you've managed to confirm a bug in your repro, test your repro on both the failing version and the previous working version. Provide clear feedback confirming or refuting the fact that the reported issue is a regression.
19+
6. Try to find possible duplicate issues - opened or closed - in the EF Core repo (https://github.com/dotnet/efcore), and include the likely candidates in your final report.
20+
7. Post your final report as a comment on the issue being triaged.
21+
22+
## Creating a minimal repro
23+
24+
The minimal repro should be created as a completely separate console program, outside of the EF repo. Use the following as your starting point:
25+
26+
```csharp
27+
using System;
28+
using Microsoft.EntityFrameworkCore;
29+
using Microsoft.Extensions.Logging;
30+
31+
await using var context = new TestContext();
32+
await context.Database.EnsureDeletedAsync();
33+
await context.Database.EnsureCreatedAsync();
34+
35+
public class TestContext : DbContext
36+
{
37+
public DbSet<Blog> Blogs { get; set; }
38+
39+
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
40+
=> optionsBuilder
41+
.Npgsql(Environment.GetEnvironmentVariable("Test__Npgsql__DefaultConnection"))
42+
// Use the following to test the repro against SQL Server, to understand whether it's PG-specific or not
43+
// .UseSqlServer(Environment.GetEnvironmentVariable("Test__SqlServer__DefaultConnection"))
44+
.LogTo(Console.WriteLine, LogLevel.Information)
45+
.EnableSensitiveDataLogging();
46+
47+
protected override void OnModelCreating(ModelBuilder modelBuilder)
48+
{
49+
}
50+
}
51+
52+
public class Blog
53+
{
54+
public int Id { get; set; }
55+
public string Name { get; set; }
56+
}
57+
```
58+
59+
* Try to integrate the user's code into the minimal template, incorporating any textual instructions from the issue, or clues that you can glean.
60+
* At the end of the process, the minimal repro should compile and execute, and reproduce the user's reported error.
61+
* The program should use code that's as close as possible to the user-reported code, including type/property naming and things that seem irrelevant.
62+
63+
### Database providers used in the bug report and repro
64+
65+
This repro is for PostgreSQL (Npgsql) issues only, but we frequently get issues that are more general, describing issues in EF which are also reproducible with e.g. SQL Server. Once you have a repro with PostgreSQL, check whether that repro is specific to PostgreSQL by switching the database provider to SQL Server (or, as a fallback, to SQLite). Pay attention to the EF provider version being used, as the bug may be specific to the version reported by the user. Once you have a working repro, try other, newer versions to confirm where the bug still occurs, and whether it has already been fixed.
66+
67+
If the issue is indeed PG-specific, say so clearly on the triage analysis and post the repro with PG. If it isn't, post the SQL Server repro instead, and clearly recommend closing the issue and reopening it on the EF repo.
68+
69+
### Make the repro as minimal as possible
70+
71+
Once you've managed to reproduce the bug, work to make the repro as minimal as possible, removing any code that isn't absolutely necessary to triggering the bug:
72+
73+
* If the repro includes a LINQ query, try to remove any irrelevant LINQ operators from that query, as long as the error continues to reproduce.
74+
* If the repro makes use of AutoMapper, attempt to remove it, reproducing the raw LINQ query which Automapper produces.
75+
* If the repro is a query translation issue and does not actually require seed data to reproduce, remove any seeding as well, keeping only the query.
76+
* Do not include any non-necessary Console.WriteLine, banners, comments, summaries or other long-form text inside the code to explain what's going on. Add minimal one-line comments at most, and only where they're really necessary to follow a complicated flow or document results of calls; otherwise no comments are necessary.
77+
* Do not encapsulate code in functions unless really necessary - prefer a simple, minimal function-less program with only top-level statements.
78+
* Do not catch exceptions in order to convert them to a friendlier message; just allow them to bubble up and terminate the program.
79+
* However, leave the LogTo code that ensures that SQL gets logged to the console for diagnostics.
80+
* Do DbContext configuration within the OnConfiguring method of the DbContext type, rather than building the options externally and passing them to the constructor. Avoid any sort of DI unless it's necessary to reproducing the bug.
81+
* In general, the less lines of code, the better.
82+
83+
## Posting your findings
84+
85+
* Post your findings on the triaged issue as a comment.
86+
* The comment should begin with a first-level heading with the text "AI Triage", followed by the sentence "The below is an AI-generated analysis and may contain inaccuracies."
87+
* If there's a minimal repro, its source code should be contained within the posted comment, wrapped inside a collapsible HTML `<details>` block, to not take up too much space (the summary should be "minimal repro").
88+
* In your response, make sure that all links to issues, pull requests or source files are to the repo on github.com, and not local (e.g. `file://` or `vscode://`) links, as your answer will be posted online.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ TestResult.xml
1818
.dotnet
1919
.vscode/
2020
.github/aw/logs/
21+
*.lscache

0 commit comments

Comments
 (0)