Skip to content

Keep Copilot review scans running past coding-agent PRs - #20040

Merged
Jose Perez Rodriguez (joperezr) merged 10 commits into
mainfrom
joperezr-organization-funded-copilot-reviews
Sep 10, 2026
Merged

Jose Perez Rodriguez (joperezr) merged 10 commits into
mainfrom
joperezr-organization-funded-copilot-reviews

Conversation

@joperezr

Copy link
Copy Markdown
Member

Description

Keep scheduled Copilot-review reconciliation running when it encounters a coding-agent-authored PR. After #20036, scans correctly gated ordinary authors by write access but stopped at #15633 because GitHub's collaborator endpoint rejects the special Copilot bot identity with 404: Copilot is not a user.

Skip authors whose API identity is exactly login: Copilot and type: Bot before calling that endpoint. They receive the existing no-write-access decision, and the scan continues to subsequent PRs. Other authors still require repository write access; unrelated 404s and other lookup failures continue to fail visibly.

Regression coverage exercises event, manual, and dry-run skips; a scheduled scan with a Copilot PR followed by a writable-author PR on another page; a non-bot with the same login; and unrelated permission-lookup 404s. All 73 focused OrganizationFundedCopilotReviewsTests passed. Existing workflow path mappings already select Infrastructure.Tests.

Failure evidence: https://github.com/microsoft/aspire/actions/runs/34510935899

Security considerations

This is a deny-only exception requiring both the exact login and bot type from GitHub's PR API. It does not authorize any additional authors, broaden token permissions, or catch arbitrary API errors. Existing trusted no-checkout execution and scoped App-token handling remain unchanged.

Fixes # (issue)

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 98e48823-4d0d-4cbc-aa9b-eba1c86342b0
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 98e48823-4d0d-4cbc-aa9b-eba1c86342b0
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 98e48823-4d0d-4cbc-aa9b-eba1c86342b0
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 98e48823-4d0d-4cbc-aa9b-eba1c86342b0
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 98e48823-4d0d-4cbc-aa9b-eba1c86342b0
…ccess

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 98e48823-4d0d-4cbc-aa9b-eba1c86342b0
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 98e48823-4d0d-4cbc-aa9b-eba1c86342b0
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 20040

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 20040"

@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot September 10, 2026 18:46
@github-actions github-actions Bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Sep 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

1 / 99 PR test projects · 0 PR jobs · 0 advisory-only targets, from 3 changed files.

Selected PR test projects (1 / 99)

Infrastructure.Tests

Selected PR jobs (0)

none

Advisory workflow impact (0)

none


How these were chosen — grouped by what changed

📄 .github/workflows/organization-funded-copilot-reviews.yml (changed)
→ 1 directly: Infrastructure.Tests

🧪 tests/Infrastructure.Tests/WorkflowScripts/OrganizationFundedCopilotReviewsTests.cs (changed test)
→ 1 directly: Infrastructure.Tests

🧪 tests/Infrastructure.Tests/WorkflowScripts/organization-funded-copilot-reviews.harness.mjs (changed test)
→ 1 directly: Infrastructure.Tests

Job reasons

none


Selection computed for commit 9739e97.

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 narrowly scoped fix preserves failure handling and all added harness scenarios pass.

Review tier: Balanced
Findings: None

What changed in this PR

Prevents scheduled Copilot-review scans from stopping on coding-agent PRs while preserving author permission checks.

Changes:

  • Skips the exact Copilot bot identity before collaborator lookup.
  • Adds regression coverage for trigger modes, pagination, and unrelated 404s.
  • Documents the exception and security boundary.
File Description
.github/​workflows/​organization-funded-copilot-reviews.yml Adds the deny-only bot exception.
tests/​Infrastructure.Tests/​WorkflowScripts/​OrganizationFundedCopilotReviewsTests.cs Registers six regression scenarios.
tests/​Infrastructure.Tests/​WorkflowScripts/​organization-funded-copilot-reviews.harness.mjs Tests skip, continuation, and error behavior.
docs/​ci/​organization-funded-copilot-reviews.md Documents the special identity handling.

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

@joperezr
Jose Perez Rodriguez (joperezr) merged commit 5e232cc into main Sep 10, 2026
43 checks passed
@joperezr
Jose Perez Rodriguez (joperezr) deleted the joperezr-organization-funded-copilot-reviews branch September 10, 2026 19:12
@github-actions github-actions Bot added this to the 13.6 milestone Sep 10, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

✅ No documentation update needed.

Step 5 branch taken: docs_optional → build_or_ci_only

Triggered signals: none (signal_count: 0, recommendation: "docs_optional"). The pre-computed only_test_or_build_changes advisory flag is true.

Allowlist justification: All 4 changed files fall under CI/test infrastructure paths, with no changes to Aspire's shipped product surface (no src/ changes at all):

  • .github/workflows/organization-funded-copilot-reviews.yml — internal scheduled-workflow logic (matches .github/**)
  • docs/ci/organization-funded-copilot-reviews.md — internal engineering/CI documentation in the microsoft/aspire repo itself (not part of the microsoft/aspire.dev user-facing docs site; this is the doc that was already updated in the source PR)
  • tests/Infrastructure.Tests/WorkflowScripts/OrganizationFundedCopilotReviewsTests.cs — test file (matches tests/**)
  • tests/Infrastructure.Tests/WorkflowScripts/organization-funded-copilot-reviews.harness.mjs — test harness script (matches tests/**)

This is an internal fix to keep the Copilot-review reconciliation scheduled workflow from stopping early when it encounters a coding-agent-authored PR (a bot-identity edge case in a GitHub API 404 check). It has no effect on any Aspire product feature, CLI, API, dashboard, or integration behavior that ships to end users, so there is nothing to add to the microsoft/aspire.dev documentation site.

@github-actions

Copy link
Copy Markdown
Contributor

🔍 CI Failure Analysis: Transient Infrastructure Failure

The CI build failed due to transient infrastructure issues.

Failed jobs:

  • Tests / No-package tests (regular, Aspire.Hosting.RemoteHost.Tests, Hosting.RemoteHost, Hosting.RemoteHos... / Hosting.RemoteHost (windows-latest) — Build test project step failed with generic 'Process completed with exit code 1' and no retrievable logs. The PR only changes workflow YAML, docs, and unrelated Infrastructure.Tests workflow-script test files; it does not touch Aspire.Hosting.RemoteHost.Tests or its dependencies, so this is unrelated to PR changes. Matches known recurring cause of widespread unrelated 'Build test project' exit-code-1 failures. (transient-infra)
  • Tests / No-package tests (regular, Aspire.Hosting.Dotnet.Tests, Hosting.Dotnet, Hosting.Dotnet, tests/Asp... / Hosting.Dotnet (windows-latest) — The 'Upload logs, and test results' step failed with 'Failed to CreateArtifact: Unable to make request: ETIMEDOUT', a network timeout talking to the GitHub Actions artifact service. This is a known transient infrastructure error unrelated to the PR's changes (workflow/docs/test-harness for Copilot reviews). (transient-infra)

If a rerun was not already requested automatically, visit the workflow run page to rerun the failed jobs manually.

@github-actions github-actions Bot locked and limited conversation to collaborators Oct 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants