Fix bot-opened inter-branch merge policy matching - #36992
Conversation
Remove the redundant issue-author predicate that does not match App-authored pull request events. The Opened action and github-actions bot sender already bind the rule to the bot-created PR event. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1b2b2dd6-bf5f-4179-8a8f-c4c85b9bce26
|
Azure Pipelines: 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 36992Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 36992" |
PureWeen
left a comment
There was a problem hiding this comment.
Adversarial review: no issues found
All 3/3 independent reviewers agreed that removing the extra issueAuthor: True predicate is the correct, narrowly scoped fix.
- The retained
github-actions[bot]sender condition still gates theOpenedevent. Synchronizeremains excluded.- Exact target branches and fully anchored title patterns remain unchanged.
- Approval and auto-merge still use a true merge commit and remain subject to branch requirements.
- The change matches the proven Policy Service pattern used by an equivalent live inter-branch merge flow.
Test coverage: There is no in-repo execution harness for Policy Service rules. The failed fresh Opened event on #36989 provides the reproduction, and the equivalent working rule/PR provides comparative evidence. A fresh post-merge Opened event remains the definitive end-to-end validation.
Prior review status: No earlier reviews or unresolved review findings were present on this replacement PR.
Methodology: 3 independent reviewers with adversarial consensus. Review event: COMMENT.
There was a problem hiding this comment.
Pull request overview
This PR adjusts the GitHub Policy Service configuration for automated inter-branch merge pull requests by removing an extra isActivitySender predicate that was preventing the rule from matching/triggering as expected for github-actions[bot]-opened PRs.
Changes:
- Remove the redundant
isActivitySender: { issueAuthor: True }condition from the inter-branch merge PR rule in Policy Service. - Keep the existing constraints intact (Opened-only action, exact bot sender, exact target-branch allow-list, fully anchored title regexes, and auto-approve + merge-commit auto-merge actions).
Show a summary per file
| File | Description |
|---|---|
.github/policies/resourceManagement.yml |
Simplifies the inter-branch merge Policy Service matcher by removing the extra activity-sender predicate so bot-opened merge PRs can be approved/auto-merged as intended. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 0
kubaflo
left a comment
There was a problem hiding this comment.
Adversarial review — NEEDS_DISCUSSION (low confidence)
Opus 5, GPT-5.6 Sol, Gemini 3.1 Pro, the MAUI expert reviewer, and final GPT-5.6 Terra arbitration found no material, non-duplicate defect attributable to a changed line. This patch contains only two deletions, so there is no valid RIGHT-side inline anchor; the expert findings output was empty.
Cross-pollination confirmed that removing the additional author-equality predicate cannot widen reachable real pull_request.opened events. The retained github-actions[bot], Opened, exact title, and target-branch constraints remain; Synchronize remains excluded, stale approvals are dismissed after a push, and normal merge requirements still gate auto-merge. The previously discussed bot-provenance boundary from #36875 is unchanged and is not duplicated here.
CI/evidence: license/cla and GitOps/YmlSchemaValidation passed. Required maui-pr was skipped by path filtering, no inspectable AzDO build exists, and Policy Service has no pre-merge end-to-end harness. That evidence gap prevents a textual LGTM and caps confidence at low.
Prior review reconciliation: the existing comments-only reviews contain no error findings, and there are no inline comments to reconcile.
Operational caveat: “unique difference” is not literal byte-for-byte policy identity. The next generated bot-authored pull_request.opened event should be checked explicitly for Policy Service approval and merge-method auto-merge; if it still misses, the behavior fails closed and the remaining matcher/config-ingestion assumptions need revisiting.
Methodology: three independent frontier-model reviews, full peer cross-pollination, MAUI expert verification, and final Terra arbitration. Review event: COMMENT only.
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description of Change
Remove the redundant
isActivitySender: { issueAuthor: True }predicate from the inter-branch merge Policy Service rule.The end-to-end retest after #36875 merged created #36989 with the exact expected
github-actions[bot]author, title, head, and base, but Policy Service did not approve it or enable auto-merge. The additional issue-author predicate is the unique difference from the proven policy used bydotnet/vscode-csharp, which successfully auto-approves and enables merge-commit auto-merge for equivalent bot-opened inter-branch merge PRs.For an
Openedevent, requiring the activity sender to begithub-actions[bot]already binds the event to the bot that opened the PR. The exact target branch and fully anchored title checks remain unchanged, andSynchronizeremains excluded.Verification
main..github/policies/resourceManagement.ymlparses as YAML.git diff --checkpasses.Openedaction, target branches, anchored titles, approval, and merge-method auto-merge actions.dotnet/vscode-csharpPolicy Service rule and PR GraphicsView does not call Drawable's Draw() after each Invalidate on iOS #9595, wheredotnet-policy-serviceapproved and enabledMERGEauto-merge for agithub-actions[bot]inter-branch merge PR.Issues Fixed
Follow-up to #36875. Replaces #36990, whose branch retained the original squash-merged PR history.