Skip to content

Add evidence-based SqlClient code review skill - #4736

Open
cheenamalhotra wants to merge 6 commits into
mainfrom
dev/cheena/sqlclient-review-skill
Open

cheenamalhotra wants to merge 6 commits into
mainfrom
dev/cheena/sqlclient-review-skill

Conversation

@cheenamalhotra

@cheenamalhotra cheenamalhotra commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Description

  • Add a shared review skill informed by dotnet/runtime, dotnet/efcore, and microsoft/mssql-rs, with pinned sources.
  • Cover driver correctness, compatibility, pooling, TDS, async paths, and regression coverage.
  • Adapt mssql-rs lessons on vacuous tests, versioned parity evidence, partial-send failures, and measured performance to SqlClient's contracts.
  • Add concise finding examples and safeguards for automated publication, duplicate findings, and stale reviews.
  • Route the existing code-review prompt through the skill with explicit read-only tools. No driver behavior changes or new automation.

Issues

N/A

Testing

Self-reviewed and addressed findings. Checked frontmatter, local links, reference links, whitespace, and read-only prompt scoping across all five Markdown files. Verified the four pinned mssql-rs sources. Driver tests are not applicable to this documentation-only change.

Guidelines

  • Tests added or updated: N/A; documentation-only
  • Public API changes documented: N/A
  • Verified against customer repro: N/A
  • Ensure no breaking changes introduced

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5e511be1-16f3-4ab0-a8d3-51efbde72763
@cheenamalhotra
cheenamalhotra requested review from a team and a balanced review from Copilot September 23, 2026 17:00
@github-project-automation github-project-automation Bot moved this to To triage in SqlClient Board Sep 23, 2026
@cheenamalhotra cheenamalhotra moved this from To triage to In review in SqlClient Board Sep 23, 2026
@cheenamalhotra cheenamalhotra added this to the 8.0.0-preview1 milestone Sep 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Removing explicit tool scoping broadens prompt permissions and contradicts the stated read-only, no-automation-change scope.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 High severity

Open (1)
What changed in this PR

Adds a reusable, evidence-based SqlClient review skill and routes the existing review prompt through it.

Changes:

  • Defines review workflow, driver checks, and publication safeguards.
  • Documents pinned upstream sources and reporting examples.
  • Simplifies the existing review prompt to use the shared skill.
File Description
.github/​skills/​sqlclient-code-review/​SKILL.md Defines the review procedure.
.github/​skills/​sqlclient-code-review/​references/​sources.md Records sources and adaptations.
.github/​skills/​sqlclient-code-review/​references/​reporting.md Defines reporting and publication rules.
.github/​skills/​sqlclient-code-review/​references/​driver-checks.md Adds SqlClient-specific review guidance.
.github/​prompts/​code-review.prompt.md Routes reviews through the skill.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/prompts/code-review.prompt.md
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5e511be1-16f3-4ab0-a8d3-51efbde72763
Copilot AI review requested due to automatic review settings September 23, 2026 17:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The driver-check reference incorrectly labels abbreviated paths as repository-relative, which can misdirect automated reviews.

Review effort: Balanced
Findings: None

Resolved since last review (1)
Previously missed (1)

In code that hasn't changed since last review

Low severity Incorrect repository-relative paths in file location table

.github/​skills/​sqlclient-code-review/​references/​driver-checks.md:5

The statement that all entries below are repository-relative is incorrect. For example, the table lists ConnectionPool/ChannelDbConnectionPool.cs, but the file is under src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/; several other entries are similarly abbreviated. This can send automated reviewers to nonexistent paths, so describe these as search starting points or expand them to full repository-relative paths.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5e511be1-16f3-4ab0-a8d3-51efbde72763
Copilot AI review requested due to automatic review settings September 23, 2026 17:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The prompt loads review instructions from the untrusted workspace instead of a trusted base revision.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 High severity

Open (1)

Comment thread .github/prompts/code-review.prompt.md Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 5e511be1-16f3-4ab0-a8d3-51efbde72763
Copilot AI review requested due to automatic review settings September 23, 2026 17:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The previous tool-scoping and trust-boundary concerns are addressed, with no remaining actionable defects found.

Review effort: Balanced
Findings: None

Resolved since last review (1)

@cheenamalhotra
cheenamalhotra enabled auto-merge (squash) September 23, 2026 18:01

@priyankatiwari08 priyankatiwari08 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs/skill-only change. Two things:

  • Prompt says report the review as partial rather than using a terminal fallback, but SKILL.md says prefer gh for GitHub reads when available and documents an npx @microsoft/learn-cli fallback. Reconcile — as written an agent gets contradictory guidance on shell use.
  • See inline on the tools list.

Comment thread .github/prompts/code-review.prompt.md Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 5e511be1-16f3-4ab0-a8d3-51efbde72763
Copilot AI review requested due to automatic review settings September 24, 2026 15:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The documentation-only changes are internally consistent, scoped appropriately, and address the prior tool and trust-boundary feedback.

Review effort: Balanced
Findings: None

@cheenamalhotra cheenamalhotra added Hotfix 7.1.1 PRs targeting main that should be backported to release/7.1 for 7.1.1. Hotfix 7.0.4 Hotfix 6.1.8 labels Sep 24, 2026
mdaigle
mdaigle previously approved these changes Sep 24, 2026

@mdaigle mdaigle left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's too much in here to read. But a few points did stick out that didn't make much sense. I suspect we can probably cut a lot of this out? We can adjust it over time

@priyankatiwari08 priyankatiwari08 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs-only. Content is accurate against the current tree (verified src/Microsoft.Data.SqlClient/ref/ exists and netcore/ref//netfx/ref/ do not; all referenced policy/instruction files resolve). Two follow-ups:

  • The skill tells reviewers to read .github/copilot-instructions.md / architecture.instructions.md as trusted policy, but those still claim netcore/ref/ and netfx/ref/ are the active ref surface. Reviewers get contradictory guidance until those are corrected.
  • run_secret_scanning was dropped from the prompt allowlist, so the secret-scanning inspection step in driver-checks.md has no tool behind it in this prompt.

| Surface | Starting point |
| --- | --- |
| Driver implementation | `src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/` |
| Public API and build selection | `src/Microsoft.Data.SqlClient/ref/`, implementation/ref `.csproj` files and imported build files |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct for the current tree, but .github/copilot-instructions.md and architecture.instructions.md still say netcore/ref/ and netfx/ref/ are active. Since the skill directs reviewers to those as trusted policy, they should be updated here or in a follow-up.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the Copilot, architecture, and API-design instructions to use the unified src/Microsoft.Data.SqlClient/ref/ project and sources. Removed the stale legacy-layout warning from the skill.


- Inspect added code, configuration, samples, and comments for embedded credentials;
follow `.github/instructions/secrets.instructions.md` without reproducing suspected
secrets in findings. Inspect available current-head secret-scanning results.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code-review prompt no longer lists github/run_secret_scanning, and nothing else in its allowlist reads scanning results — so this step is always a verification gap under that prompt. Worth stating that explicitly here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made this explicit: the draft prompt cannot run scans or retrieve scanning alerts. It reports a verification gap unless redacted results for the reviewed revision are supplied by the user or trusted CI; manual inspection is not a scan.

argument-hint: <PR number, PR URL, branch name, or local changes>
agent: agent
tools: ['github/search_issues', 'github/pull_request_read', 'github/get_file_contents', 'github/run_secret_scanning', 'read/readFile', 'search']
tools: ['github/search_issues', 'github/issue_read', 'github/pull_request_read', 'github/get_file_contents', 'read/readFile', 'search/changes', 'search/codebase', 'search/fileSearch', 'search/listDirectory', 'search/textSearch', 'search/usages', 'vscode/askQuestions']

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github/run_secret_scanning was removed but no read path for scan results replaced it, so the secret-scanning guidance in the skill is unreachable from this prompt.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The prompt now states that its allowlist has no scan execution or alert-read tool. It accepts supplied, redacted results or reports a gap, rather than implying it can fetch them; no additional permissions were added.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 5e511be1-16f3-4ab0-a8d3-51efbde72763

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The documentation-only changes are internally consistent, local links resolve, and prior tool-scoping concerns are addressed.

Review effort: Balanced
Findings: None

@paulmedynski paulmedynski removed the Hotfix 7.1.1 PRs targeting main that should be backported to release/7.1 for 7.1.1. label Sep 25, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

5 participants