Skip to content

Preserve source development loaders during documentation builds - #1171

Merged
PrzemyslawKlys merged 1 commit into
mainfrom
fix/docs-preserve-loader-guard
Oct 25, 2026
Merged

PrzemyslawKlys merged 1 commit into
mainfrom
fix/docs-preserve-loader-guard

Conversation

@PrzemyslawKlys

@PrzemyslawKlys PrzemyslawKlys commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

I reproduced ConsoleMonster's documentation build removing exactly the five-line System.Management.Automation host-assembly guard from its generated development loader when using PSPublishModule 3.0.168. Current main already includes that guard, but documentation mode still regenerates the source bootstrapper through the normal build path; an older generator can therefore overwrite a newer committed loader.

This skips source development-loader regeneration in documentation mode. Staging still gets the loader needed for documentation, and the source manifest's exports can still refresh. Normal builds continue to regenerate or clear development loaders. The source .psm1 stays byte-for-byte unchanged, including when development binaries are Off for the docs run.

  • Added pipeline regressions for Auto, Environment, and Off, covering retained loader content, encoding and line endings. All three fail before the fix.
  • Added the preservation checks and existing development-loader/manifest/docs-sync tests to Linux CI, and documented the docs/build boundary.
  • Configuration-only checks found the same exposure in PSParseHTML (HtmlTinkerX), DbaClientX and FabricClientX: each enables development binaries, Auto, ReplaceSingleFile, and assembly-load-context loading.

Validation:

  • Release builds of PSPublishModule for net8.0 and net10.0 succeeded.
  • All 53 focused loader/manifest/docs-sync tests passed, including the host-contract import integration test. The three new cases fail against the original pipeline.
  • In a disposable ConsoleMonster checkout at master ab25431fe4f79fc487643f8c0e1765da056f72f8, I ran Module/Build/Build-Module.ps1 -RunMode Documentation -SignModule:$false -SkipInstall:$true with the source-built fixed module. The build passed with 137 Markdown command pages matching 137 MAML entries. The committed and regenerated .psm1 SHA-256 hashes match exactly.
  • An expanded local test selection encountered separate macOS failures involving EphemeralKeySet, case-sensitive filesystem assumptions, and a backslash lifecycle-action working directory. I stopped that selection after repeated platform failures; it is not a passing full-suite result. A broader portable selection finished with 821 passed, 3 skipped and one binary-documentation snapshot line-ending failure. I reproduced that failure, the lifecycle-action path failure and the case-sensitive destination test failure against the original pipeline as well.
  • Source-engine qualification used a disposable PowerShell 7.6 host; the installed PowerShell 7.5 runtime cannot load the current engine's metadata dependencies.

For ConsoleMonster, updating Website/.powerforge/engine-lock.json alone does not update the module builder. Module/Build/Build-Module.ps1 imports PSPublishModule by name, so the documentation process needs a PSPublishModule release containing this fix (or an explicit local source build for qualification). The website lock currently selects a59da372d66af663a6591a9e7d4d9aa3abc4547c; its engine update is a separate consumer step. This PR does not publish a package.

Summary by CodeRabbit

  • Bug Fixes
    • Documentation runs now preserve the source module loader exactly as it is, including development-loading logic and host-assembly checks. Manifest exports may still be refreshed.
    • Source loader regeneration or removal of development-loading logic remains part of build runs.
  • Documentation
    • Clarified how documentation and build runs affect the source module loader.

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a14d4d9f-2d6b-4135-8706-0b0b7ab9a30f
Commits

Reviewing files that changed from the base of the PR and between 3dd33f4 and d28743c.

Files selected for processing: 5
  • .github/workflows/BuildModule.yml
  • Docs/PSPublishModule.DevelopmentBootstrapper.md
  • Docs/PSPublishModule.ModuleDocumentation.md
  • PowerForge.PowerShell/Services/ModulePipelineRunner.MergeAndTests.cs
  • PowerForge.Tests/ModulePipelineScriptExecutionSeamTests.DocumentationBootstrapper.cs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

Documentation mode now skips source development bootstrapper handling. Tests cover loader preservation across three development-binary modes, and the Linux build workflow runs the related test groups.

Changes: Documentation Loader Preservation

Layer / File(s) Summary
Preserve the source loader in documentation mode
PowerForge.PowerShell/Services/ModulePipelineRunner.MergeAndTests.cs, Docs/PSPublishModule.DevelopmentBootstrapper.md, Docs/PSPublishModule.ModuleDocumentation.md
The pipeline skips source development bootstrapper handling in Documentation mode. The documentation states that this mode preserves the source .psm1 loader.
Test loader preservation across development-binary modes
PowerForge.Tests/ModulePipelineScriptExecutionSeamTests.DocumentationBootstrapper.cs, .github/workflows/BuildModule.yml
A test theory checks byte-for-byte loader preservation for three development-binary modes. The Linux build workflow runs the related test groups.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · up to d2874

Documentation builds preserve the source loader, with regression coverage for the supported development-binary modes. No merge-blocking issue is identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (3 skipped: 3 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title states the main change: documentation builds now leave source development loaders (the source .psm1 bootstrapper) unchanged. The raw summary confirms this: TryRegenerateSourceDevelopmentBoot…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title states the main change: documentation builds now leave source development loaders (the source .psm1 bootstrapper) unchanged. The raw summary confirms this: TryRegenerateSourceDevelopmentBootstrapperFromManifest returns early for Documentation gate mode, the docs describe byte-for-byte preservation, and a regression test covers Auto, Environment, and Off modes. The CI workflow change and docs updates support the same change. No unrelated or misleading content was found.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@PrzemyslawKlys
PrzemyslawKlys merged commit 28e8fff into main Oct 25, 2026
10 checks passed
@PrzemyslawKlys
PrzemyslawKlys deleted the fix/docs-preserve-loader-guard branch October 25, 2026 07:12
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.

1 participant