Skip to content

{CI} resourceManagement.yml sync: replace squad labels/reviewers/mentionees and route to squad teams#33682

Merged
a0x1ab merged 1 commit into
Azure:devfrom
a0x1ab:ci/squad-mapping-replace-team-form
Jul 1, 2026
Merged

{CI} resourceManagement.yml sync: replace squad labels/reviewers/mentionees and route to squad teams#33682
a0x1ab merged 1 commit into
Azure:devfrom
a0x1ab:ci/squad-mapping-replace-team-form

Conversation

@a0x1ab

@a0x1ab a0x1ab commented Jun 30, 2026

Copy link
Copy Markdown
Member

Related command

This is a CI/automation tooling change (no az command surface). It updates the script that syncs the ADO Wiki Squad Mapping table into .github/policies/resourceManagement.yml.

Description

Updates tools/Github/ParseSquadMappingList.ps1 so squad routing is written correctly and deterministically:

  • Existing squad references (labels, reviewers, mentionees) are now replaced in place so a rule routes to the currently-mapped squad instead of accumulating stale ones. Re-running the sync no longer grows the file or leaves duplicate squads behind.
  • mentionees and reviewer values are emitted in GitHub team form (Azure/act-*-squad) so they can actually be @mentioned and assigned. addLabel and hasLabel deliberately stay in bare label form (act-*-squad), since those require a label, not a team.
  • A new NormalizeSquadTeamForms pass normalizes squad reviewers/mentionees to team form everywhere including the hand-written auto-assign rules that are keyed on a squad label and are therefore not driven by the wiki mapping.

Testing Guide

Ran the script locally against the live ADO Wiki and audited the generated resourceManagement.yml:

$token = az account get-access-token --resource {resource-id} --query accessToken -o tsv
pwsh -NoProfile -File tools/Github/ParseSquadMappingList.ps1 -AccessToken $token

This checklist is used to make sure that common guidelines for a pull request are followed.

…ionees and route to squad teams

Update ParseSquadMappingList.ps1 so squad references are replaced in place instead of appended, and so reviewers/mentionees use GitHub team form (Azure/act-*-squad) while addLabel keeps bare label form. Adds a NormalizeSquadTeamForms pass so hand-written [Squad Auto-Assign] rules also route to teams.
Copilot AI review requested due to automatic review settings June 30, 2026 11:57
@a0x1ab a0x1ab requested review from a team as code owners June 30, 2026 11:57
@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Jun 30, 2026

Copy link
Copy Markdown
️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.14
️✔️acs
️✔️latest
️✔️3.12
️✔️3.14
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.14
️✔️ams
️✔️latest
️✔️3.12
️✔️3.14
️✔️apim
️✔️latest
️✔️3.12
️✔️3.14
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.14
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.14
️✔️aro
️✔️latest
️✔️3.12
️✔️3.14
️✔️backup
️✔️latest
️✔️3.12
️✔️3.14
️✔️batch
️✔️latest
️✔️3.12
️✔️3.14
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.14
️✔️billing
️✔️latest
️✔️3.12
️✔️3.14
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.14
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.14
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.14
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.14
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.14
️✔️config
️✔️latest
️✔️3.12
️✔️3.14
️✔️configure
️✔️latest
️✔️3.12
️✔️3.14
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.14
️✔️container
️✔️latest
️✔️3.12
️✔️3.14
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.14
️✔️core
️✔️latest
️✔️3.12
️✔️3.14
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.14
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.14
️✔️dls
️✔️latest
️✔️3.12
️✔️3.14
️✔️dms
️✔️latest
️✔️3.12
️✔️3.14
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.14
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.14
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.14
️✔️find
️✔️latest
️✔️3.12
️✔️3.14
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.14
️✔️identity
️✔️latest
️✔️3.12
️✔️3.14
️✔️iot
️✔️latest
️✔️3.12
️✔️3.14
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.14
️✔️lab
️✔️latest
️✔️3.12
️✔️3.14
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.14
️✔️maps
️✔️latest
️✔️3.12
️✔️3.14
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.14
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.14
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.14
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.14
️✔️network
️✔️latest
️✔️3.12
️✔️3.14
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.14
️✔️postgresql
️✔️latest
️✔️3.12
️✔️3.14
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.14
️✔️profile
️✔️latest
️✔️3.12
️✔️3.14
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.14
️✔️redis
️✔️latest
️✔️3.12
️✔️3.14
️✔️relay
️✔️latest
️✔️3.12
️✔️3.14
️✔️resource
️✔️latest
️✔️3.12
️✔️3.14
️✔️role
️✔️latest
️✔️3.12
️✔️3.14
️✔️search
️✔️latest
️✔️3.12
️✔️3.14
️✔️security
️✔️latest
️✔️3.12
️✔️3.14
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.14
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.14
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.14
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.14
️✔️sql
️✔️latest
️✔️3.12
️✔️3.14
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.14
️✔️storage
️✔️latest
️✔️3.12
️✔️3.14
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.14
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.14
️✔️util
️✔️latest
️✔️3.12
️✔️3.14
️✔️vm
️✔️latest
️✔️3.12
️✔️3.14

@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Jun 30, 2026

Copy link
Copy Markdown
️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

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 tools/Github/ParseSquadMappingList.ps1 sync script to generate .github/policies/resourceManagement.yml squad routing in a more deterministic way, aiming to avoid accumulating stale squad label/reviewer/mentionee entries and to emit GitHub team-form values for reviewers/mentionees.

Changes:

  • Adds helpers to identify squad values, convert team-form to label-form, and normalize bare squad reviewers/mentionees to Azure/<team> form.
  • Refactors AddSquadLabelsToYaml to update existing squad label/reviewer/mentionee lines in-place and insert additional ones when needed.
  • Adds a final NormalizeSquadTeamForms pass so hand-written [Squad Auto-Assign] rules also get normalized to team form.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if (-not [string]::IsNullOrWhiteSpace($condLabel)) {
$labelsPresent[$condLabel] = $true
}
$labelsFromConditions = GetLabelsFromConditions -Lines $Lines -ThenLineIndex $i -BaseIndentLength $baseIndentLength
Comment on lines +430 to +433
for ($p = $i - 1; $p -ge 0; $p--) {
if ($Lines[$p] -match '^\s*description:') { break }
if ($Lines[$p] -match 'payloadType:\s*Pull_Request') { $isPR = $true; break }
}
Comment on lines +435 to +446
$labelExtraLines = [System.Collections.Generic.List[string]]::new()
for ($t = 0; $t -lt $targets.Count; $t++) {
$squadLabel = ToSquadLabel -Squad $targets[$t]
if ($t -lt $addLabelSquadLines.Count) {
$lineIndex = $addLabelSquadLines[$t]
$indent = " " * (GetIndentLength -Line $work[$lineIndex])
$work[$lineIndex] = "${indent}label: $squadLabel"
} elseif ($lastAddLabelLine -ge 0) {
$labelExtraLines.Add((" " * $listIndentLength) + "- addLabel:")
$labelExtraLines.Add((" " * $listIndentLength) + " label: $squadLabel")
}
}
@yonzhan

yonzhan commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

CI

@a0x1ab a0x1ab merged commit 1de660f into Azure:dev Jul 1, 2026
67 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

act-identity-squad act-platform-engineering-squad ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group Auto-Assign Auto assign by bot CI CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants