Update code-review workflow and standardize AI disclosure#126110
Update code-review workflow and standardize AI disclosure#126110stephentoub wants to merge 6 commits intodotnet:mainfrom
Conversation
|
@jeffhandley, can you help with the Code Review / activation (pull request) failure? |
There was a problem hiding this comment.
Pull request overview
Updates the repository’s agentic code-review workflow to support additional trigger scenarios and standardizes the AI-generated content disclosure guidance across skills and Copilot instructions.
Changes:
- Expanded code-review workflow triggering (ready_for_review, workflow_dispatch), added concurrency + increased timeout, and added an “empty PR” no-comment guard in the prompt.
- Adjusted compiled workflow (
code-review.lock.yml) to match the new triggering/activation behavior. - Standardized AI disclosure wording/placement guidance across skills and
.github/copilot-instructions.md.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/code-review.md |
Adds timeout/concurrency, new triggers (ready_for_review, workflow_dispatch), fork allowance, and “empty diff” guard text; updates prompt to use PR number/input. |
.github/workflows/code-review.lock.yml |
Compiled workflow updated to match new triggers/timeout/concurrency and loosened activation gating. |
.github/skills/vmr-codeflow-status/SKILL.md |
Updates AI disclosure guidance (bot exemptions + bottom placement). |
.github/skills/performance-benchmark/SKILL.md |
Updates AI disclosure guidance (bot exemptions + bottom placement). |
.github/skills/code-review/SKILL.md |
Updates AI disclosure guidance and adjusts the sample review heading format. |
.github/skills/ci-analysis/SKILL.md |
Updates AI disclosure guidance (bot exemptions + bottom placement). |
.github/skills/api-proposal/SKILL.md |
Updates AI disclosure guidance (bot exemptions + intended bottom placement). |
.github/copilot-instructions.md |
Updates repo-wide AI disclosure guidance (bot exemptions + bottom placement). |
Comments suppressed due to low confidence (5)
.github/workflows/code-review.lock.yml:243
github.event.inputs.pr-numberis invalid for theworkflow_dispatchinput (hyphenated name) and will cause expression evaluation failures here too. Usegithub.event.inputs['pr-number']or rename the input and update references.
env:
GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
GH_AW_EXPR_61AA0003: ${{ github.event.pull_request.number || github.event.inputs.pr-number }}
GH_AW_GITHUB_ACTOR: ${{ github.actor }}
.github/workflows/code-review.md:111
github.event.inputs.pr-numberis invalid for a hyphenated input name and will fail expression evaluation onworkflow_dispatch. Usegithub.event.inputs['pr-number'](or rename the input) here as well.
Follow the instructions in SKILL.md to perform a thorough code review of PR #${{ github.event.pull_request.number || github.event.inputs.pr-number }}.
.github/workflows/code-review.md:103
github.event.inputs.pr-numberis invalid for a hyphenated input name and will fail expression evaluation onworkflow_dispatch. Usegithub.event.inputs['pr-number'](or rename the input) here.
You are an expert code reviewer for the dotnet/runtime repository. Your job is to review pull request #${{ github.event.pull_request.number || github.event.inputs.pr-number }} and post a thorough analysis as a comment.
.github/workflows/code-review.lock.yml:164
- This workflow still uses
github.event.inputs.pr-number, which is invalid for a hyphenated input name and will breakworkflow_dispatchruns. Usegithub.event.inputs['pr-number'](or rename the input) when populating this env var.
GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
GH_AW_SAFE_OUTPUTS: ${{ runner.temp }}/gh-aw/safeoutputs/outputs.jsonl
GH_AW_EXPR_61AA0003: ${{ github.event.pull_request.number || github.event.inputs.pr-number }}
GH_AW_GITHUB_ACTOR: ${{ github.actor }}
.github/workflows/code-review.lock.yml:232
github.event.inputs.pr-numberis invalid for theworkflow_dispatchinput (hyphenated name) and will cause expression evaluation failures here. Usegithub.event.inputs['pr-number']or rename the input and update references.
env:
GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
GH_AW_EXPR_61AA0003: ${{ github.event.pull_request.number || github.event.inputs.pr-number }}
with:
28d6e62 to
e680ba2
Compare
e680ba2 to
5f7513e
Compare
|
@jeffhandley, for now I've removed the role and forks change, in order to get the rest of the changes in. |
|
/ba-g markdown only |
When triggered via workflow_dispatch, the PR branch is not automatically checked out. Added Step 0 instructions for the agent to fetch/checkout the PR branch and pass item_number to add-comment so the review targets the correct PR. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
729c28c to
56dc247
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (2)
.github/workflows/code-review.md:124
- The empty-PR guard is currently only enforced via prompt instructions (“Simply stop without producing any output”). If the goal is to guarantee no comment is posted when the effective diff is empty, consider adding an explicit workflow-level check (e.g., compute PR files/patch size via API and short-circuit before invoking the agent / before accepting
add-comment).
Follow the instructions in SKILL.md to perform a thorough code review of PR #${{ github.event.pull_request.number || github.event.inputs.pr_number }}.
**Important:** Before performing any analysis, check whether the PR has any actual code changes (lines added, removed, or modified). If the diff is empty (e.g., a merge commit with no effective changes), do **not** post a review comment. Simply stop without producing any output.
When completed, post the review output as a regular comment on the PR using the `add-comment` safe output.
.github/workflows/code-review.md:110
- For
workflow_dispatch, this relies on the agent following manual git commands in the prompt to fetch/checkout the PR branch. To make the workflow deterministic (and avoid reviewing default-branch content if the agent deviates), consider doing the PR ref fetch/checkout as an explicit workflow step whengithub.event_name == 'workflow_dispatch'instead of only documenting it in the prompt.
## Step 0: Prepare Workspace (workflow_dispatch only)
When this workflow is triggered via `workflow_dispatch`, the PR branch is **not** automatically checked out — the workspace contains the default branch. Before reviewing, you **must** fetch and check out the PR branch so the workspace reflects the PR's code:
```bash
git fetch origin pull/${{ github.event.pull_request.number || github.event.inputs.pr_number }}/head:pr-branch
git checkout pr-branch
</details>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Recompile agentic workflows with updated gh-aw version.
This comment has been minimized.
This comment has been minimized.
Copilot Code ReviewHolistic AssessmentMotivation: This PR switches the code-review workflow from auto-triggering on Approach: Sound overall. The workflow config changes use proper gh-aw features, the AI disclosure edits are mechanical and consistent, and the lock file recompilation is clean. Prior review feedback (hyphenated input names, contradictory "prepend at the bottom", fork/roles removal, disclosure placement placeholder) has been addressed. Summary: Detailed FindingsDetailed Findings
|
|
Cc @mitchdenny |
Update the code-review agentic workflow and standardize AI disclosure text across all skills.
Code-review workflow changes
slash_command— trigger the workflow using/code-reviewcomment triggers rather than when pull requests are created or synchronized. This avoids the "Approve workflows to run" button on PRs from community contributors and relies on a human-in-the-loop trigger.workflow_dispatch— add manual trigger withpr_numberinputtimeout-minutes: 45— bump from default 20 minutesconcurrency— cancel in-progress reviews when new commits are pushed to the same PRAI disclosure updates (all skills + copilot-instructions)
github-actions[bot]andcopilotas explicitly exempted accounts