Skip to content

Flatten inter-branch merge Policy Service rules - #37068

Merged
PureWeen merged 1 commit into
mainfrom
pureween-flatten-inter-branch-policy
Aug 4, 2026
Merged

Flatten inter-branch merge Policy Service rules#37068
PureWeen merged 1 commit into
mainfrom
pureween-flatten-inter-branch-policy

Conversation

@PureWeen

@PureWeen PureWeen commented Aug 3, 2026

Copy link
Copy Markdown
Member

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!

Replaces #37050 with a clean, one-commit branch from current main.

Motivation

Live generated inter-branch PRs #37007 and #37042 matched the configured bot sender, Opened event, exact title, and exact target branch, but hosted Policy Service supplied neither an approval nor an auto-merge request. Local evaluation with the production package successfully deserializes and matches the current nested rule, while Policy Service remains active for other MAUI rules.

The nested or-of-and structure is therefore the remaining evidence-backed hosted-runtime compatibility hypothesis. This is not a service-log-confirmed root cause: hosted evaluation catches task exceptions internally, so predicate-level diagnostics are unavailable from GitHub.

Change

Replace the single nested matcher with four flat rules, one for each allowed title/target pair. Every rule preserves the existing security restrictions:

  • sender must be github-actions[bot]
  • action must be Opened
  • title must match the exact anchored regular expression
  • target branch must match the exact allow-listed branch
  • auto-merge uses a merge commit
  • Policy Service does not retrigger on its own actions

No Synchronize behavior or broader matching is added.

Validation

  • full YAML parse
  • production GitOps.PullRequestIssueManagement 0.1.182 deserialization: 24 tasks, 4 flat inter-branch tasks
  • exact sender, title regex, target branch, approval, merge-auto-merge, and triggerOnOwnActions assertions for all four rules
  • CRLF-aware git diff --check

This change is an experiment to remove the remaining unique matcher shape. Definitive validation requires merging it and observing a fresh generated inter-branch PR receive the Policy Service approval and auto-merge request.

Avoid the unique nested or-of-and matcher shape while preserving the exact bot, Opened event, target branch, title, and merge-method requirements for every allowed flow.

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

Copilot-Session: 1b2b2dd6-bf5f-4179-8a8f-c4c85b9bce26
Copilot AI review requested due to automatic review settings August 3, 2026 23:27
@PureWeen
PureWeen temporarily deployed to copilot-pat-pool August 3, 2026 23:27 — with GitHub Actions Inactive
@PureWeen
PureWeen requested a review from kubaflo August 3, 2026 23:27
@github-actions

github-actions Bot commented Aug 3, 2026

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/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 37068

Or

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

@azure-pipelines

Copy link
Copy Markdown
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.

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.

Pull request overview

This PR updates the repo’s Policy Service configuration for automated inter-branch merge PRs by replacing a single nested or-of-and matcher with four separate, flat rules—one per allowed title/target-branch pair—while preserving the same sender/action/branch/title restrictions.

Changes:

  • Split the prior nested inter-branch merge matcher into four explicit rules (main→net11.0, net11.0→preview7, net11.0→rc1, net11.0→rc2).
  • Kept the security gates intact (exact bot sender, Opened only, anchored title regex, allow-listed target branches, merge-commit auto-merge, triggerOnOwnActions: false).
Show a summary per file
File Description
.github/policies/resourceManagement.yml Replaces the nested inter-branch merge matcher with four flat, explicit Policy Service rules for the allowed forward-merge flows.

Copilot's findings

Suppressed comments (3)

.github/policies/resourceManagement.yml:743

  • For consistency with the rest of this file, consider moving this task's description: to the end (after then:). Right now the inter-branch tasks are the only ones that start with description:, which is easy to miss when scanning conditions and actions.
    - description: '[Inter-branch merge] Auto-approve net11.0 to preview7'
      triggerOnOwnActions: false
      if:

.github/policies/resourceManagement.yml:783

  • Same formatting consistency issue as the other new inter-branch tasks: description: appears at the top instead of at the end of the task like the rest of the file. Aligning with the file's pattern makes these rules easier to maintain.
    - description: '[Inter-branch merge] Auto-approve net11.0 to rc2'
      triggerOnOwnActions: false
      if:

.github/policies/resourceManagement.yml:763

  • This inter-branch task's top-level key order differs from the established pattern in this file (ifthendescription). Keeping the same layout across tasks improves readability and reduces the chance of missing conditions/actions during edits.
    - description: '[Inter-branch merge] Auto-approve net11.0 to rc1'
      triggerOnOwnActions: false
      if:
  • Files reviewed: 1/1 changed files
  • Comments generated: 1

Comment thread .github/policies/resourceManagement.yml
@PureWeen
PureWeen temporarily deployed to copilot-pat-pool August 3, 2026 23:32 — with GitHub Actions Inactive
@PureWeen
PureWeen temporarily deployed to copilot-pat-pool August 3, 2026 23:33 — with GitHub Actions Inactive
@github-actions github-actions Bot added the area-infrastructure CI, Maestro / Coherency, upstream dependencies/versions label Aug 3, 2026
@PureWeen
PureWeen temporarily deployed to copilot-pat-pool August 3, 2026 23:33 — with GitHub Actions Inactive
@PureWeen
PureWeen merged commit ad8249e into main Aug 4, 2026
14 of 15 checks passed
@PureWeen
PureWeen deleted the pureween-flatten-inter-branch-policy branch August 4, 2026 23:10
@github-actions github-actions Bot added this to the .NET 10 SR10 milestone Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-infrastructure CI, Maestro / Coherency, upstream dependencies/versions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants