Skip to content

Isolated per-module weekly docs generation (one stage & PR per module) - #827

Merged
ramsessanchez merged 3 commits into
ramsess/revert-generation-changesfrom
ramsess/per-module-docs-generation
Jul 31, 2026
Merged

Isolated per-module weekly docs generation (one stage & PR per module)#827
ramsessanchez merged 3 commits into
ramsess/revert-generation-changesfrom
ramsess/per-module-docs-generation

Conversation

@ramsessanchez

Copy link
Copy Markdown
Contributor

Refactors the weekly documentation pipeline so every Graph workload module generates in its own isolated Azure DevOps stage per SDK profile (~86 independent stages). Each stage runs on a fresh agent with a clean assembly-load context, structurally eliminating the "assembly with same name is already loaded" collisions that caused mass-deletion and no-op refresh PRs.

What changed

  • GenerateMarkDown.ps1 — new -GraphProfileFilter / -ModuleFilter scoping. Scoped runs do a complete delete + full regen of the single module, but throw before any deletion if the module fails to import (fail-safe), and set a ModuleGenerated signal only on success.
  • 9 post-processing scripts — matching profile/module scoping + empty-commit guards so each only touches the target module folder.
  • update-template.yml — parameterized install (InstallProfile/Module): isolated runs install only Microsoft.Graph.Authentication + the single workload submodule. Install failures warn instead of failing.
  • generate-module-docs-steps.yml (new) — full single-module sequence: install → generate → post-process → push → PR. Generate step is continueOnError; every later step is gated on ModuleGenerated, so a failing module deletes nothing, opens no PR, and never fails the overall pipeline.
  • module-stages.yml (new) — emits one dependsOn: [] stage per module.
  • powershell-docs.yml — invokes module-stages.yml for v1.0 (incl. Authentication) and beta. Each stage opens its own pull request.

Behaviour guarantees

  • One bad module = partially-succeeded stage, fully contained — other modules unaffected.
  • ms.date changes every run (StabilizeMsDate intentionally not run) → reviewable PRs.
  • Complete delete + regen is safe again because only one workload module ever loads per stage.

Validation

  • All 4 pipeline YAML files parse-validated.
  • All edited scripts parse-checked; no trailing-whitespace errors.
  • Local smoke test: GenerateMarkDown.ps1 -ModuleFilter Search -GraphProfileFilter v1.0 regenerated only the Search v1.0 folder and touched nothing else.

Each Graph workload module now generates in its own Azure DevOps stage per SDK
profile (~86 independent stages), giving every module a fresh agent and a clean
assembly-load context. This structurally eliminates the "assembly with same name
is already loaded" collisions that produced mass-deletion / no-op refresh PRs.

- GenerateMarkDown.ps1: add -GraphProfileFilter and -ModuleFilter scoping; in
  scoped runs do a complete delete + full regen of the single module, throw
  before any deletion on import failure (fail-safe), and emit a ModuleGenerated
  signal only on success.
- 9 post-processing scripts: add matching profile/module scoping and empty-commit
  guards so each touches only the target module folder.
- update-template.yml: parameterized install (InstallProfile/Module) that installs
  only Authentication + the single workload submodule for isolated runs; install
  failures warn instead of failing.
- New common-templates/generate-module-docs-steps.yml: full single-module sequence
  (install -> generate -> post-process -> push -> PR). Generate step is
  continueOnError and every later step is gated on ModuleGenerated, so a failing
  module deletes nothing, opens no PR, and never fails the overall pipeline.
- New common-templates/module-stages.yml: emits one dependsOn:[] stage per module.
- powershell-docs.yml: invoke module-stages.yml for v1.0 (incl. Authentication)
  and beta; each stage opens its own pull request. ms.date changes every run
  (StabilizeMsDate is intentionally not run) for reviewable PRs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4d27d82f-3809-40d2-b4e7-6623436ff2ef
@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

Azure DevOps resolves template references relative to the directory of the
referencing file. powershell-docs.yml lives in azure-pipelines/, so the
"azure-pipelines/common-templates/module-stages.yml@self" path resolved to
azure-pipelines/azure-pipelines/common-templates/module-stages.yml and failed
with "Not Found". Use a path relative to the file's own directory instead.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4d27d82f-3809-40d2-b4e7-6623436ff2ef
@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

The Authentication module is not present in ModulesMapping.jsonc, so the scoped
module filter ($ModulesToGenerate | Where-Object { $_ -eq $ModuleFilter })
produced an empty list. The folder-based post-processing scripts then passed
that empty array into helper parameters marked [ValidateNotNullOrEmpty()] /
[Parameter(Mandatory)], throwing "The argument is null or empty" and failing the
Escape/UpdateLinks/RemoveInvalidFullStops/CorrectRelatedLinks steps.

These scripts never post-processed Authentication in the original full run either
(its docs are generated but excluded from the module list). Restore that behavior
by skipping gracefully when the filtered module list is empty, so the
Authentication stage succeeds and still opens its PR. RemoveBoilerPlateCode is
unchanged: it intentionally runs its Authentication-specific cleanup and safely
no-ops its (unvalidated) module loop.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4d27d82f-3809-40d2-b4e7-6623436ff2ef
@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

@ramsessanchez
ramsessanchez merged commit 050866e into ramsess/revert-generation-changes Jul 31, 2026
11 checks passed
@ramsessanchez
ramsessanchez deleted the ramsess/per-module-docs-generation branch July 31, 2026 22:53
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.

2 participants