Add a scheduled code-review orchestrator and path-specific review instructions#130339
Open
jeffhandley wants to merge 11 commits into
Open
Add a scheduled code-review orchestrator and path-specific review instructions#130339jeffhandley wants to merge 11 commits into
jeffhandley wants to merge 11 commits into
Conversation
Move the general, language-agnostic review criteria (reviewer mindset, Holistic PR Assessment, PR hygiene, codebase consistency, and documentation) verbatim out of .github/skills/code-review/SKILL.md into a path-specific instruction file scoped to src/**, and point the skill at the new file. Copilot agents -- including the Copilot code review agent -- automatically respect .github/instructions/**/*.instructions.md files whose applyTo glob matches the changed files, so these rules now apply to native Copilot reviews in addition to the code-review skill. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move the C# rules (error handling, thread safety, security, correctness patterns, performance/allocations, API design, and code style) verbatim out of the skill into a file scoped to **/*.cs, and add the loading reference. Copilot agents -- including the Copilot code review agent -- automatically respect .github/instructions/**/*.instructions.md files whose applyTo glob matches the changed files, so these C# rules now apply to native Copilot reviews of C# files in addition to the code-review skill. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move the native rules (JIT-specific correctness, C++ style, runtime/VM patterns, native performance, platform defines, and P/Invoke marshalling) verbatim out of the skill into a file scoped to the C/C++/asm globs, and add the loading reference. Copilot agents -- including the Copilot code review agent -- automatically respect .github/instructions/**/*.instructions.md files whose applyTo glob matches the changed files, so these native rules now apply to native Copilot reviews of native files in addition to the code-review skill. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move the testing rules verbatim out of the skill into a file scoped to the test globs, and add the loading reference. The skill now contains only the review process and points to the path-specific instruction files. Copilot agents -- including the Copilot code review agent -- automatically respect .github/instructions/**/*.instructions.md files whose applyTo glob matches the changed files, so these test rules now apply to native Copilot reviews of test files in addition to the code-review skill. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…trator - Add code-review-orchestrator.md: on a 10-minute schedule (and workflow_dispatch) it polls open PRs, computes the new/updated set deterministically from a reviewed-SHA actions/cache, and dispatches the code-review workflow per PR via the dispatch-workflow safe output. - Rework code-review.md from a pull_request-triggered workflow into a per-PR worker (workflow_dispatch) dispatched by the orchestrator; it reviews one PR using the code-review skill and posts a single holistic comment. - Both import the Copilot PAT pool; update .github/aw/actions-lock.json for the pinned actions the new locks use. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Tagging subscribers to this area: @dotnet/runtime-infrastructure |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR restructures the repo’s customized Copilot-based review automation into a scheduled “orchestrator + per-PR worker” model and moves detailed review guidance into path-scoped .github/instructions/*.instructions.md files so both the custom workflow and GitHub’s built-in Copilot code review can share the same rule source.
Changes:
- Converts
code-reviewinto aworkflow_dispatchper-PR worker and adds a scheduled orchestrator that deterministically selects PRs needing (re)review and dispatches the worker. - Splits language-/area-specific review guidance out of the
code-reviewskill into path-scoped instruction files under.github/instructions/. - Updates the Agentic Workflows action pinning to include
actions/cache/*@v4to support the new orchestrator’s state caching.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/code-review.md | Reworks the workflow into a per-PR workflow_dispatch worker with updated safe-outputs / concurrency and PAT-pool handling. |
| .github/workflows/code-review.lock.yml | Regenerated lockfile reflecting the worker model and updated tool/container configuration. |
| .github/workflows/code-review-orchestrator.md | New scheduled orchestrator that computes a deterministic dispatch list and fans out worker dispatches. |
| .github/workflows/code-review-orchestrator.lock.yml | New lockfile for the orchestrator workflow. |
| .github/skills/code-review/SKILL.md | Slims the skill to process + points at path-scoped instruction files; updates output header text. |
| .github/instructions/review-all-src.instructions.md | New “general” source review criteria for src/**. |
| .github/instructions/review-csharp.instructions.md | New C#-specific review criteria (**/*.cs). |
| .github/instructions/review-native.instructions.md | New native/interop review criteria (C/C++/asm globs). |
| .github/instructions/review-all-tests.instructions.md | New test review criteria (tests globs). |
| .github/aw/actions-lock.json | Adds pinned SHAs for actions/cache/restore@v4 and actions/cache/save@v4. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
# Conflicts: # .github/workflows/code-review.lock.yml # .github/workflows/code-review.md
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…hestration' into jeffhandley/code-review-orchestration
Comment on lines
+45
to
+49
| # The per-PR job-discriminator gives each PR's compiler-generated jobs (agent, safe_outputs, | ||
| # conclusion) a distinct concurrency slot, so concurrently dispatched workers for different PRs | ||
| # run independently; cancel-in-progress above still cancels a stale review when the same PR is | ||
| # pushed again. | ||
| job-discriminator: ${{ github.event.inputs.pr_number }} |
Comment on lines
14
to
16
| github: | ||
| mode: remote | ||
| # Use the default containerized github-mcp-server, authenticated with the Actions GITHUB_TOKEN. | ||
| toolsets: [default, search] |
Comment on lines
+73
to
+76
| gh pr list --repo "$GITHUB_REPOSITORY" --state open --limit 1000 \ | ||
| --json number,headRefOid,isDraft,updatedAt,isCrossRepository \ | ||
| --jq '[.[] | select(.isDraft == false)]' > /tmp/open_prs.json | ||
| echo "Open non-draft PRs: $(jq 'length' /tmp/open_prs.json) (forks included)" |
jeffhandley
commented
Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reworks the repo's customized code-review automation into two related parts:
pull_request-triggeredcode-review.md.built-in Copilot code review agent applies them too.
This is separate from -- and complements -- GitHub's built-in Copilot code review agent.
The dispatched worker posts a single holistic review comment ("Holistic Runtime Review")
on each PR.
Changes
Scheduled orchestrator / worker
code-review-orchestrator.md-- on a 10-minute schedule (andworkflow_dispatch),polls open PRs, computes the new/updated set deterministically from a reviewed-SHA
actions/cache, and dispatches the worker per PR via thedispatch-workflowsafe output.Follows the OrchestratorOps, DeterministicOps, and WorkQueueOps patterns from gh-aw.
code-review.md-- reworked from apull_request-triggered workflow into a per-PRworker (
workflow_dispatch); reviews one PR using the code-review skill and posts oneholistic comment.
copilot-pat-poolenvironment and draw a token from the Copilot PAT pool(
shared/pat_pool.md), matching the convention already inmain.Path-specific review instructions
The review rules move verbatim out of
.github/skills/code-review/SKILL.mdinto path-scopedinstruction files, each with an
applyToglob:review-all-src.instructions.md(src/**) -- reviewer mindset, Holistic PR Assessment,PR hygiene, codebase consistency, documentation.
review-csharp.instructions.md(**/*.cs) -- error handling, thread safety, security,correctness patterns, performance/allocations, API design, code style.
review-native.instructions.md(C/C++/asm globs) -- JIT-specific correctness, C++ style,runtime/VM patterns, native performance, platform defines, P/Invoke marshalling.
review-all-tests.instructions.md(test globs) -- testing rules.Copilot agents -- including the built-in Copilot code review agent -- automatically respect
.github/instructions/**/*.instructions.mdfiles whoseapplyToglob matches the changedfiles, so these rules now apply to native Copilot reviews in addition to the code-review skill.
SKILL.mdis slimmed to the review process and points at the new files.Validation
Exercised end-to-end in a private test repo across native, C#, test, and non-src PRs:
orchestrator pickup, per-PR dispatch, holistic worker comments, native Copilot reviews that
reflect the path-specific instructions, WorkQueue dedup (no re-review when unchanged), and
re-review when new commits are pushed.
Notes
(
!github.event.repository.fork);workflow_dispatchalways runs. Fork PRs themselves arestill reviewed (see the security note in the orchestrator's poll step).