fix: Update submodule, sort permissions deterministically, and stabilize ms.date - #791
Conversation
Three improvements to the weekly docs pipeline: 1. Update msgraph-sdk-powershell submodule to latest main (019fb02 -> 2b68bcb). This picks up MgCommandMetadata.json updates from April-June 2026, including new cmdlets and refreshed metadata. 2. Sort permissions alphabetically in GeneratePermissionsTable.ps1. Previously, permissions appeared in whatever order the metadata JSON listed them, causing non-deterministic diffs when the order changed between runs. Alphabetical sorting ensures stable output. 3. Add StabilizeMsDate.ps1 as a pipeline step that runs after all post-processing scripts. It reverts any file where the only change is the ms.date metadata line, preventing date-only churn from inflating PR diffs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PoliCheck Scan ReportThe following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans. ✅ No issues foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
|
Learn Build status updates of commit e5c91f4: ✅ Validation status: passed
For more details, please refer to the build report. |
There was a problem hiding this comment.
Pull request overview
This PR updates the docs-generation pipeline to reduce PR noise by making output more deterministic: it sorts permissions consistently, and adds a new stabilization step that reverts markdown files when the only change is ms.date.
Changes:
- Add
scripts/StabilizeMsDate.ps1to revert date-only markdown diffs. - Sort permission arrays in
GeneratePermissionsTable.ps1for deterministic table output. - Insert the new stabilization script into
azure-pipelines/powershell-docs.ymlbefore the push/PR creation steps.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| scripts/StabilizeMsDate.ps1 | New script to detect and revert markdown files whose only change is ms.date. |
| scripts/GeneratePermissionsTable.ps1 | Adds sorting to permission lists to stabilize generated table ordering. |
| azure-pipelines/powershell-docs.yml | Runs the new stabilization script as part of the pipeline prior to pushing changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Sort permissions alphabetically for deterministic output | ||
| $DelegatedWorkPermissions = $DelegatedWorkPermissions | Sort-Object; | ||
| $ApplicationPermissions = $ApplicationPermissions | Sort-Object; | ||
| $DelegatedPersonalPermissions = $DelegatedPersonalPermissions | Sort-Object; |
| $modifiedFiles = git diff --name-only -- '*.md' | ||
| $revertedCount = 0 |
| # Get the diff lines, ignoring context | ||
| $diffLines = git diff --unified=0 -- $file | Where-Object { | ||
| $_ -match '^\+[^+]' -or $_ -match '^\-[^-]' | ||
| } | ||
|
|
||
| # Check if all changed lines are ms.date changes | ||
| $allMsDate = $true | ||
| $hasChanges = $false | ||
| foreach ($line in $diffLines) { | ||
| $hasChanges = $true | ||
| if ($line -notmatch '^[+-]ms\.date: ') { |
| if ($hasChanges -and $allMsDate) { | ||
| git checkout -- $file | ||
| $revertedCount++ | ||
| } |
- Sort permissions by privilege level (IsLeastPrivilege=true first),
then alphabetically within each group. This preserves the 'from least
to most privileged' table header semantics while ensuring deterministic
output. Also deduplicates permission entries.
- StabilizeMsDate.ps1: Add error handling for git commands, filter out
special diff markers ('\ No newline at end of file'), and verify
git checkout success before counting reverted files.
- Pipeline step: Add errorActionPreference: 'stop' for consistency.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PoliCheck Scan ReportThe following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans. ✅ No issues foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
|
Learn Build status updates of commit 9c0f1ba: ✅ Validation status: passed
For more details, please refer to the build report. |
Uh oh!
There was an error while loading. Please reload this page.