fix(build): stabilize net8 packaging resolution and module build pipeline#155
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
PR Review: fix(build): stabilize net8 packaging resolution and module build pipelineOverall this is a well-structured PR with clear, targeted fixes and solid test coverage. Here are my observations by area: System.IO.Packaging version selection (PSPublishModule.csproj / PowerForge.csproj)Positive. Splitting the combined Minor note: once a net9 TFM is added in future, a third block will be needed; a comment or TODO referencing this maintenance concern would help future contributors. LineEndingConverter – bare \r handlingCorrect fix. The old normalization path: text.Replace("\r\n", "\n").Replace("\n", "\r\n")left classic Mac ( NormalizeMixedPowerShellLineEndings (ModuleBuildPipeline.cs)Minor naming issue. The method is called The hardcoded ComputeExcludedLibraries – BFS change (ModuleBuilder.cs)This is the most behaviorally significant change in the PR and warrants a closer look. Before: the BFS cascaded unconditionally – if a PowerShell runtime library After: only deps whose own IDs are PowerShell runtime libraries are added to the exclusion set; non-PS transitive deps are kept. The included test validates the reference-assemblies case ( Question/concern: For runtime SDK packages like Reflection-based private-method tests (ModuleBuilderDependencyCopyTests.cs)var method = typeof(ModuleBuilder).GetMethod("ComputeExcludedLibraries", BindingFlags.Static | BindingFlags.NonPublic);Testing private methods via reflection is fragile: the test breaks silently if the method is renamed, extracted, or inlined, and it does not appear in normal public-API coverage. Consider either:
The same applies to RefreshManifestOnly / RefreshPSD1Only featureWell-implemented. The flag consistently gates all non-manifest phases (binary publish, bootstrapper generation, merge, signing, artefacts, publishes, documentation, tests, installs) in a single Plan-time block, which is the right place for it. The One small thing: UseCiStrictDefaults extraction (WebPipelineRunner.cs)Good refactor. Extracting the repeated WebVerifyPolicy warning code classificationBackward compatible. The OR-with-fallback pattern (code-prefix first, then legacy message text) is the right approach. Tests cover both paths. Minor style note: in Sitemap canonicalization (WebSitemapGenerator.cs)The new Module documentation (Module/Docs/*.md)The addition of Summary
The critical items to address before merge are the BFS change coverage question and the reflection-based tests. The naming issue is minor but worth a note. |
…PSGallery publish
|
Added a follow-up fix for PSGallery publishing with PSResourceGet:\n\n- normalize ExternalModuleDependencies during repository publish\n- for PSResourceGet + PSGallery, automatically remove inbox PowerShell modules (for example Microsoft.PowerShell.Utility, Microsoft.PowerShell.Management, Microsoft.PowerShell.Diagnostics) before publish\n- keep normal dependency checks for real required dependencies\n- added tests: ModulePublisherExternalDependenciesTests\n\nThis addresses the Publish-PSResource dependency-not-found failure for inbox modules. |
PR Review: fix(build): stabilize net8 packaging resolution and module build pipelineOverall this is a solid, well-scoped PR. The core fixes are correct and the new Core packaging fix (PSPublishModule.csproj / PowerForge.csproj)The split of the LineEndingConverter.csThe CR-only fix is minimal and correct: // Before
if (target == "\r\n") return text.Replace("\r\n", "\n").Replace("\n", "\r\n");
// After
if (target == "\r\n") return text.Replace("\r\n", "\n").Replace("\r", "\n").Replace("\n", "\r\n");The two-step normalisation (collapse everything to LF, then expand to target) is idiomatic and handles mixed ModuleBuildPipeline.cs —
|
| Area | Verdict |
|---|---|
| Core net8/net10 packaging fix | Correct |
| CR-only line ending fix | Correct |
| RefreshManifestOnly feature | Well-implemented |
| Dependency exclusion cascade fix | Correct, well-tested |
| PSGallery inbox module filtering | Practical and scoped correctly |
| Schema/doc mismatch (ShowCategories/LinkTaxonomy) | Should be resolved before merge |
| Staging CRLF normalization perf | Consider onlyMixed: true |
| Reflection-based private tests | Low priority; consider InternalsVisibleTo |
The schema mismatch is the only item I'd flag as worth addressing before merge, since it will produce misleading validation errors for users following the new documentation.
…ernal dep validation
|
Updated approach to a global fix:\n\n- added custom dependency precheck for RequiredModules before publish (repository-aware)\n- switched PSResourceGet publish call to -SkipDependenciesCheck\n- this avoids false failures from ExternalModuleDependencies (for example inbox/RSAT modules such as ActiveDirectory)\n- preserved manifest metadata (no longer strips external dependencies before publish)\n\nNew tests cover required-module version matching rules used by the precheck. |
PR Review: fix(build): stabilize net8 packaging resolution and module build pipelineOverall this is a well-structured PR with clear intent and solid test coverage for the key fixes. Below are observations by area. System.IO.Packaging version split (
|
| Area | Status |
|---|---|
| System.IO.Packaging TFM split | ✅ Correct fix |
| CR-only line ending handling | ✅ Correct, tested |
| Staging CRLF normalization | ✅ Works; hardcoded excludes worth revisiting |
| Dependency exclusion BFS fix | ✅ Correct fix, well-tested |
| Top-level binary inclusion on deps path | |
| RefreshManifestOnly pipeline | ✅ Comprehensive, minor style nits |
| Custom dependency pre-check | |
| Test approach (reflection) | InternalsVisibleTo preferred over NonPublic reflection |
Good work overall — the core packaging fix and line-ending hardening are solid. The main actionable items are the network-failure escape hatch for the dependency pre-check and the hardcoded exclude directories in staging normalization.
|
Follow-up pushed in 0c7eaeb: clear stale RequiredModules in staged manifest when MergeMissing filters configured required modules to empty. Added regression test in ModulePipelineApprovedModulesTests. |
PR Review: fix(build): stabilize net8 packaging resolution and module build pipelineOverall this is a well-structured PR with a clear primary bug fix and solid supporting improvements. The test coverage is notably improved. A few items worth discussing below. The core fix
Correctness concernsSchema gap: The C# "ShowCategories": { "type": "boolean" },
"showCategories": { "type": "boolean" },
"LinkTaxonomy": { "type": "boolean" },
"linkTaxonomy": { "type": "boolean" }
Old behavior: This is presumably intentional (catches binaries the deps graph misses), and
The method is named "NormalizeMixed..." but uses
When the current page cannot be matched in the sorted collection ( Design observations
The change from
Switching to
Good refactoring — removing the repeated Minor items
SummaryThe primary fix (per-framework |
|
Added another follow-up in 885c55d:
This supports runtime-required inbox modules while avoiding false PSGallery dependency failures under PSResourceGet. |
PR Review: fix(build): stabilize net8 packaging resolution and module build pipelineOverall this is a well-scoped PR with clear intent, solid test coverage for the core fixes, and good documentation hygiene. Here are my findings grouped by severity. Bug / Correctness
The fix adds a guard before cascading into transitive excludes: foreach (var depKey in deps)
{
var depId = GetLibraryIdFromTargetKey(depKey);
if (!IsPowerShellRuntimeLibraryId(depId)) continue; // only cascade if dep is itself a PS runtime lib
if (excluded.Add(depKey)) queue.Enqueue(depKey);
}This means transitive deps of a PS runtime lib are only excluded when they themselves are PS runtime libs. The test validates the intended behaviour (non-PS transitive deps like
Previously Potential Issues
The method wraps the entire normalization in a broad Additionally,
Each required module triggers a separate
Switching from Minor / StyleSchema missing
Naming inconsistency: The config key read from the build segment is
var mergedScripts = plan.BuildSpec.RefreshManifestOnly ? false : ApplyMerge(plan, buildResult);C# idiomatic form for this pattern is Module docs: empty Parameters without enum values now emit Positives
|
|
Implemented legacy behavior restore in 9d26d7c:
Added regression tests in ModulePipelineRegressionParityTests to verify both planning and manifest output behavior for:
This keeps your existing build script unchanged while restoring import/runtime semantics. |
PR Review: fix(build): stabilize net8 packaging resolution and module build pipelineOverall this is a solid PR with good test coverage for the new functionality. The core net8 fix is clean and targeted. A few observations below, ranging from potential issues to minor notes. Core Bug Fix: net8/net10
|
|
Added fix for repository publish packaging in 4beb3b0. Issue:
Fix:
Tests:
|
PR Review: fix(build): stabilize net8 packaging resolution and module build pipelineOverall this is a well-structured PR with clear intent, good test coverage for the key changes, and properly updated lock files. The fixes are targeted and the new Core bug fix —
|
PR Review: fix(build): stabilize net8 packaging resolution and module build pipelineOverall this is a solid, well-motivated PR with good test coverage. The Bugs / Correctness
// PowerForge/Services/ModuleBuilder.cs
if (plan is not null)
{
IncludeTopLevelBinaryFiles(plan.RootFileNames, publishDir); // <-- always runs now
return plan;
}Previously,
foreach (var depKey in deps)
{
var depId = GetLibraryIdFromTargetKey(depKey);
if (!IsPowerShellRuntimeLibraryId(depId)) continue; // new guard
if (excluded.Add(depKey)) queue.Enqueue(depKey);
}The guard prevents cascade into non-PowerShell libraries, which is the right fix. The test Code Quality
The method is called
Token[] tokens; // declared but never read
ParseError[] errors;
var ast = Parser.ParseFile(filePath, out tokens, out errors);
var ast = Parser.ParseFile(filePath, out _, out errors);
var slash = key.IndexOf('/');
return slash > 0 ? key.Substring(0, slash) : key;
|
| Area | Verdict |
|---|---|
System.IO.Packaging version split |
Correct and necessary fix |
ComputeExcludedLibraries cascade guard |
Correct fix; minor edge case not tested |
CreateCopyPlan unconditional top-level inclusion |
Needs confirmation of intent |
NormalizeMixedPowerShellLineEndings naming/behavior |
Minor naming inconsistency |
TryGetPsDataStringArray unused tokens |
Minor — use discard |
EditorialPostNav AllItems fallback |
Correctness risk on paginated collections |
| Test coverage | Good; a few gap cases noted above |
Overall the PR is ready to merge pending confirmation on the CreateCopyPlan behavior change intent and the line-ending normalization scope. The core packaging fix is clean and well-validated.
…ilience * Adjusted `PrivateData.PSData.ExternalModuleDependencies` to clarify that external modules are not packaged into artifacts. * Updated `packages.lock.json` to resolve `Microsoft.NET.Sdk.WebAssembly.Pack` to version `10.0.3`.
PR Review — fix(build): stabilize net8 packaging resolution and module build pipelineOverall this is a solid PR with a clear root-cause fix, good test coverage, and several useful refactors. Below are my observations, split by category. Core Bug Fix —
|
| New Test File | What It Covers |
|---|---|
LineEndingConverterTests.cs |
CR-only → CRLF normalization regression |
ModuleBuilderDependencyCopyTests.cs |
Excluded library BFS, top-level fallback copy |
ModulePipelineRefreshManifestOnlyTests.cs |
Plan phase gating, install/publish skip, project root sync |
ModulePipelineRegressionParityTests.cs |
Extended regression suite (509 → 648 lines) |
Coverage looks appropriate for the changes introduced. The ModulePublisher.cs validation additions (ValidateRequiredModulesForRepositoryPublish and friends) are internal static for testability — worth adding unit tests for DoesVersionMatchRequiredModule edge cases (exact match, wildcard, range).
Summary
The root cause fix is correct and clearly targeted. The refactors are well-scoped and improve maintainability. The main items worth addressing before merge:
- Log exception details in the
NormalizeMixedPowerShellLineEndingscatch block. - Document (in code) the rationale for
skipDependenciesCheck: true. - Use unique temp paths in
PrepareModulePackageForRepositoryPublishto avoid stale-dir accumulation. - Add unit tests for
ValidateRequiredModulesForRepositoryPublish/DoesVersionMatchRequiredModuleedge cases.
- Load project-root PSD1 metadata as baseline when Manifest segment is absent - Keep dependency fields engine-controlled to avoid stale module dependency carry-over - Add regression test for baseline metadata import behavior
…/baseline - Harden ReadTopLevelString normalization against nullable flow under net472 - Guard ScriptsToProcess single-string normalization before Trim() - Unblocks dotnet publish for PSPublishModule net472 target
PR Review: fix(build): stabilize net8 packaging resolution and module build pipelineOverall this is a solid, well-scoped PR with real bug fixes, meaningful refactoring, and good test coverage. Below are observations grouped by area. System.IO.Packaging version split (core fix)The split of the shared <!-- net8.0 -->
<PackageReference Include="System.IO.Packaging" Version="8.0.1" />
<!-- net10.0 -->
<PackageReference Include="System.IO.Packaging" Version="10.0.1" />The original single condition LineEndingConverter.NormalizeEndings — bug fixThe fix to handle lone // Before: missed lone \r
if (target == "\r\n") return text.Replace("\r\n", "\n").Replace("\n", "\r\n");
// After: normalizes \r\n → \n, then \r → \n, then \n → \r\n
if (target == "\r\n") return text.Replace("\r\n", "\n").Replace("\r", "\n").Replace("\n", "\r\n");The three-step chain is the idiomatic safe approach. Good fix. NormalizeMixedPowerShellLineEndings — design noteThe staging normalization always forces CRLF (
CreateCopyPlan / IncludeTopLevelBinaryFiles refactorThe extraction of Worth double-checking: are there scenarios where a top-level binary correctly excluded by the deps JSON (e.g., a PS host assembly) might now be inadvertently re-included by ComputeExcludedLibraries — transitive dependency traversal fixThe added early-continue guard: var depId = GetLibraryIdFromTargetKey(depKey);
if (!IsPowerShellRuntimeLibraryId(depId)) continue;
if (excluded.Add(depKey)) queue.Enqueue(depKey);Correctly restricts BFS traversal to PS-runtime library subtrees. Previously, the BFS would enqueue and traverse all transitive dependencies of any PS-runtime library, potentially marking unrelated assemblies as excluded. This is a meaningful correctness fix for modules with complex dependency graphs. ManifestEditor.InsertKeyValue — leading newline fixThe var needsLeadingNewLine = closingPos > 0 && content[closingPos-1] != '\r' && content[closingPos-1] != '\n';
var insertText = (needsLeadingNewLine ? NewLine : string.Empty) + indent + key + " = " + valueExpression + NewLine;Correct and safe. The check at RefreshManifestOnly / RefreshPSD1Only flowThe new pipeline mode is a good feature addition and the refactoring is well-structured:
One concern: Test coverageThe new test files are well-structured and cover the main scenarios:
Temp directory cleanup via One note: DocsThe new Summary
No blocking issues. The suggestions above are either minor polish or documentation improvements. |
PR #155 Review: fix(build): stabilize net8 packaging resolution and module build pipelineGood work on this PR. The scope is broad (7,000+ net lines) but the changes are logically cohesive. Below are my observations, grouped by severity. Correctness / Bugs1. In 2.
3. On Linux (case-sensitive) filesystems this could silently skip valid files when casing doesn't match exactly. Since both paths derive from Design Observations4.
5. Changed from 6. Each required module triggers a separate 7. Duplicate normalization helpers across partial classes
8. External modules mirrored into RequiredModules — undocumented behavior change The new code in Minor / Nits9. Both methods call Test CoverageThe new tests are well-structured and cover the key scenarios:
One gap: no test for the unconditional CRLF normalization in SummaryThe core fixes (System.IO.Packaging per-TFM versioning, CR-only line ending handling, dependency cascade BFS fix) are correct and well-tested. The main risks worth addressing before merging are the unconditional CRLF normalization (item 2) and the path comparison case sensitivity in Review generated by Claude Code |
Code Review — PR #155: fix(build): stabilize net8 packaging resolution and module build pipelineOverall this is a well-structured PR with a clear primary fix, a meaningful new feature, and solid test coverage. Below is a detailed breakdown. ✅ StrengthsCore packaging fix is correct and clean.
Line ending fix is correct. // Before:
if (target == "\r\n") return text.Replace("\r\n", "\n").Replace("\n", "\r\n");
// After:
if (target == "\r\n") return text.Replace("\r\n", "\n").Replace("\r", "\n").Replace("\n", "\r\n");The intermediate Bug fix: duplicate if (plan.ExternalModuleDependencies is { Length: > 0 })
ManifestEditor.TrySetPsDataStringArray(..., "ExternalModuleDependencies", ...);
if (plan.ExternalModuleDependencies is { Length: > 0 }) // ← duplicate
ManifestEditor.TrySetPsDataStringArray(..., "ExternalModuleDependencies", ...);This is now correctly consolidated into
var depId = GetLibraryIdFromTargetKey(depKey);
if (!IsPowerShellRuntimeLibraryId(depId)) continue;correctly stops propagation at the boundary. The Test coverage is thorough. 🔍 Issues and Observations1. Duplicate
|
| Area | Assessment |
|---|---|
| Core packaging fix | ✅ Correct, minimal |
| LineEndingConverter fix | ✅ Correct, tested |
| RefreshPSD1Only feature | ✅ Well-structured, tested end-to-end |
| ManifestEditor additions | ✅ Solid, minor edge-case note on regex scope |
| ModuleBuilder BFS fix | ✅ Correct, regression test added |
| ModulePublisher changes | ✅ Good, consider negative test for AlwaysExcludedRootFiles |
| Duplicate NormalizeArray | |
| Double RefreshManifestFromPlan call | |
| Test coverage | ✅ Comprehensive for changed behaviour |
| Documentation | ✅ Clear and well-referenced |
The packaging fix is the critical path item here and it's solid. The feature additions are well-tested. The two items worth addressing before merge are the duplicate NormalizeArray/NormalizeStringArray and considering whether the double RefreshManifestFromPlan call is the right long-term shape for the post-format patch step.
Summary
Validation
Notes