Skip to content

fix: Update submodule, sort permissions deterministically, and stabilize ms.date - #791

Merged
ramsessanchez merged 2 commits into
mainfrom
fix/doc-pipeline-improvements
Jun 30, 2026
Merged

fix: Update submodule, sort permissions deterministically, and stabilize ms.date#791
ramsessanchez merged 2 commits into
mainfrom
fix/doc-pipeline-improvements

Conversation

@ramsessanchez

@ramsessanchez ramsessanchez commented Jun 17, 2026

Copy link
Copy Markdown
Contributor
  1. Submodule update — 019fb02 (Mar 24) → 2b68bcb (Jun 12), picks up 5+ metadata refreshes
  2. Alphabetical permission sorting in GeneratePermissionsTable.ps1 — eliminates reordering noise
  3. StabilizeMsDate.ps1 — new pipeline step that reverts files where the only change is ms.date

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>
@learn-build-service-prod

Copy link
Copy Markdown
Contributor

PoliCheck Scan Report

The 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 found

More information about PoliCheck

Information: PoliCheck | Severity Guidance | Term
For any questions: Try searching the learn.microsoft.com contributor guides or post your question in the Learn support channel.

@learn-build-service-prod

Copy link
Copy Markdown
Contributor

Learn Build status updates of commit e5c91f4:

✅ Validation status: passed

File Status Preview URL Details
azure-pipelines/powershell-docs.yml ✅Succeeded
msgraph-sdk-powershell ✅Succeeded
scripts/GeneratePermissionsTable.ps1 ✅Succeeded
scripts/StabilizeMsDate.ps1 ✅Succeeded

For more details, please refer to the build report.

Copilot AI left a comment

Copy link
Copy Markdown

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 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.ps1 to revert date-only markdown diffs.
  • Sort permission arrays in GeneratePermissionsTable.ps1 for deterministic table output.
  • Insert the new stabilization script into azure-pipelines/powershell-docs.yml before 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.

Comment thread scripts/GeneratePermissionsTable.ps1 Outdated
Comment on lines +36 to +39
# Sort permissions alphabetically for deterministic output
$DelegatedWorkPermissions = $DelegatedWorkPermissions | Sort-Object;
$ApplicationPermissions = $ApplicationPermissions | Sort-Object;
$DelegatedPersonalPermissions = $DelegatedPersonalPermissions | Sort-Object;
Comment on lines +9 to +10
$modifiedFiles = git diff --name-only -- '*.md'
$revertedCount = 0
Comment thread scripts/StabilizeMsDate.ps1 Outdated
Comment on lines +16 to +26
# 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: ') {
Comment on lines +32 to +35
if ($hasChanges -and $allMsDate) {
git checkout -- $file
$revertedCount++
}
Comment thread azure-pipelines/powershell-docs.yml
msewaweru
msewaweru previously approved these changes Jun 18, 2026
- 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>
@learn-build-service-prod

Copy link
Copy Markdown
Contributor

PoliCheck Scan Report

The 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 found

More information about PoliCheck

Information: PoliCheck | Severity Guidance | Term
For any questions: Try searching the learn.microsoft.com contributor guides or post your question in the Learn support channel.

@learn-build-service-prod

Copy link
Copy Markdown
Contributor

Learn Build status updates of commit 9c0f1ba:

✅ Validation status: passed

File Status Preview URL Details
azure-pipelines/powershell-docs.yml ✅Succeeded
msgraph-sdk-powershell ✅Succeeded
scripts/GeneratePermissionsTable.ps1 ✅Succeeded
scripts/StabilizeMsDate.ps1 ✅Succeeded

For more details, please refer to the build report.

@ramsessanchez
ramsessanchez merged commit 95ecd4c into main Jun 30, 2026
7 checks passed
@ramsessanchez
ramsessanchez deleted the fix/doc-pipeline-improvements branch June 30, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants