Unify PSPublishModule self-build around JSON configuration#629
Unify PSPublishModule self-build around JSON configuration#629PrzemyslawKlys wants to merge 47 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 546199be52
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5f6b14f701
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
PSPublishModule/PowerForge/Services/PowerForgeReleaseService.cs
Lines 919 to 921 in 966f00d
On Windows PowerShell 5.1, executing or planning a scaffolded JSON-first release with an artifact path such as CustomModule/Output/<TagModuleVersionWithPreRelease> still fails here because the net472 Path.GetFullPath implementation rejects the angle brackets before ExpandModuleArtifactPaths can replace them. The scaffold now successfully emits this tokenized path, so release preparation needs the same token-protection logic used by the scaffolder.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Fixed the review-body artifact-token finding in 800f0bf. Path token protection is now a shared PowerForge utility used by both scaffolding and unified release path normalization. A real Windows PowerShell 5.1/net472 scaffold-and-plan run preserved and accepted |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 800f0bf2d0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0325ab9c76
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab2b782140
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 97cef84b19
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 11367ae20b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8adb8eb6b8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3a92a390c8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c41fc0948a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9639fe1d9a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 80bf902b8f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: edcd503653
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 55c05f22df
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ecc370b6c5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1dd84600b8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
PSPublishModule/PowerForge/Services/PowerForgeReleaseService.cs
Lines 4593 to 4597 in 36c28d3
When a unified Tools.DotNetPublish configuration has target or installer signing enabled, Studio's pre-signing build sets EnableSigning=false, but this predicate treats only true as an override. The configured signing options consequently remain enabled and the DotNet tool build signs locally—or fails for lack of its certificate—before the signing checkpoint. Treat any non-null EnableSigning value as an override so false clears target and installer signing.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8dd290a286
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3b8bf91298
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 413f5b0aac
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ba8e24fe3d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fc8ffa37fa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!string.IsNullOrWhiteSpace(repository.ModuleBuildScriptPath)) | ||
| { | ||
| receipts.AddRange(await ExecuteModulePublishAsync(repository, signingResult, cancellationToken)); | ||
| var moduleReceipts = await ExecuteModulePublishAsync( | ||
| repository, | ||
| signingResult, | ||
| cancellationToken, | ||
| unifiedOwnsGitHub); |
There was a problem hiding this comment.
Honor package-first module publication ordering
When a module owns package lanes and its ConfigurationRelease.PublishOrder places NuGet before PowerShell Gallery, this call publishes the module destinations first; the checkpointed package plans do not run until the later calls at lines 197/215. This reverses the ordering enforced by ModulePipelineRunner.PublishOperations.cs:27-49, so the module can become public before its packages and remain as a partial release if a subsequent NuGet push fails. Execute the staged package and module destinations according to the checkpointed publish order.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Valid for PowerForge Studio's staged-publish adapter, but not a shared PowerForge/module/CLI path. Per the maintainer's scope update, Studio runtime publishing is temporarily excluded from the supported product gate and this PR no longer claims Studio readiness. Not fixed in b7392c0; leaving this thread open intentionally.
| publishSet.Context, | ||
| cancellationToken); | ||
| var receipts = new List<ReleasePublishReceipt>(); | ||
| foreach (var publishConfig in publishSet.Configurations.Where(config => config.Enabled)) |
There was a problem hiding this comment.
Stop remaining module destinations after a failed publish
When multiple enabled module publish segments exist and an early repository or GitHub operation returns a failed receipt, this loop continues executing every later external destination. The caller checks for failure only after ExecuteModulePublishAsync returns, so a failed Gallery push can still create a GitHub release (or vice versa), unlike the normal module pipeline where the first publish exception stops the loop. Return as soon as a destination produces a failed receipt.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Valid for PowerForge Studio's staged-publish adapter, but not a shared PowerForge/module/CLI path. Per the maintainer's scope update, Studio runtime publishing is temporarily excluded from the supported product gate and this PR no longer claims Studio readiness. Not fixed in b7392c0; leaving this thread open intentionally.
| var explicitModuleAssets = (unified.ModuleAssets ?? []) | ||
| .Concat(string.IsNullOrWhiteSpace(unified.ModulePlan.StagingPath) | ||
| ? [] | ||
| : [unified.ModulePlan.StagingPath!]) | ||
| .ToArray(); |
There was a problem hiding this comment.
Checkpoint staged module and package release copies
When unified release staging is enabled, GitHub publication uses each ReleaseAssetEntry.StagedPath, but this module adapter captures only the original module assets and staging directory; the package adapter likewise captures its original outputs. Signing refreshes the staged copies, but RefreshUnifiedArchives skips creating a receipt when that staged path was absent from the manifest, and integrity validation hashes only paths with receipts. Replacing a staged module or package ZIP after signing can therefore change the uploaded payload undetected; include every staged publication path in the signing artifacts.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Valid for PowerForge Studio's signing-checkpoint adapter, but not the supported PowerForge/module/CLI build path. Studio runtime publication is temporarily excluded from the product gate. Not fixed in b7392c0; leaving this thread open intentionally.
| return new PowerForgeModuleReleasePlanSummary | ||
| { | ||
| ModuleName = context.Spec.Build.Name, | ||
| ModuleVersion = context.EffectiveVersion, |
There was a problem hiding this comment.
Resolve direct JSON X-patterns before manifest matching
For a directly discovered powerforge.json whose build or manifest version uses an X-pattern such as 3.0.X, this stores the unresolved configuration value in the expected plan. The completed manifest contains the resolved exact version, so ModuleManifestMatchesPlan compares 3.0.123 with 3.0.X, rejects every signed manifest, and staged Gallery/GitHub publication reports that no publishable module was captured. Persist the resolved build version or treat the configured pattern as a version constraint when matching.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Valid for Studio's direct-JSON publish projection. The canonical PowerForge/module JSON build path resolves the version through the shared release engine and is covered by the core smoke; Studio runtime publishing is temporarily out of scope. Not fixed in b7392c0; leaving this thread open intentionally.
| await Task.CompletedTask.ConfigureAwait(false); | ||
| try | ||
| { | ||
| var metadata = new ModuleManifestMetadataReader().Read(manifestPath); |
There was a problem hiding this comment.
Keep module identity separate from RootModule
For a valid module whose manifest name differs from its binary RootModule—for example Contoso.Tools.psd1 with RootModule = 'bin/Contoso.Engine.dll'—this reader reports Contoso.Engine as the module name. JSON-backed releases then fail the expected-name match, while script-backed releases later search for Contoso.Engine.psd1; either path prevents publishing the signed Contoso.Tools package. Derive package identity from the manifest filename or configured module name rather than the RootModule payload.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Valid for Studio's manifest-projection adapter. It does not affect the canonical PowerForge/module/CLI path, and Studio runtime publishing is temporarily excluded from this PR's readiness gate. Not fixed in b7392c0; leaving this thread open intentionally.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e12b345dec
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
PSPublishModule/PowerForge/Services/PowerForgeReleaseService.cs
Lines 653 to 660 in 211e614
When an X-pattern package version is coordinated with a module, the first plan resolves and applies an exact module/tool version, but this second package run passes that value only as ReleaseVersionFloor. If another publisher advances the feed between those two calls, ApplyReleaseVersionFloor explicitly accepts the newly resolved higher version, so the packages can be built and pushed at (for example) 3.0.6 while the already-built module, tool plan, and unified GitHub tag remain at 3.0.5. Persist the planned exact package version into the execution request rather than rerunning pattern resolution with a minimum floor.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
PSPublishModule/PowerForge/Services/PowerForgeReleaseService.cs
Lines 659 to 660 in a514ae6
When the checked-in full publish pushes the coordinated NuGet packages successfully but the later deferred Gallery or unified GitHub publication fails, the resolved version exists only on this in-memory request. Rerunning with the configured 3.0.X patterns performs the force-plan again, observes the just-published packages, and advances to the next version instead of resuming the failed destinations, leaving an orphaned package version and rebuilding the release under a different identity. Persist the exact coordinated version and completed destinations before the first remote push, as the previous synchronized module-release checkpoint did.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eaf4ee3255
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 114535011a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (ShouldPublishUnifiedGitHub(spec, request, moduleSelected)) | ||
| { | ||
| request.CancellationToken.ThrowIfCancellationRequested(); | ||
| var unified = PublishUnifiedGitHubRelease(spec, configDirectory, builtResult, sharedReleaseVersion); |
There was a problem hiding this comment.
Pass the token into unified GitHub uploads
When cancellation arrives after this pre-check during a staged unified GitHub upload, PublishUnifiedGitHubRelease invokes the default _publishGitHubRelease delegate, which is initialized with the non-cancellable PublishRelease(publishRequest) overload, so the upload continues until completion or network timeout and may mutate the release after Studio reports cancellation. Fresh evidence beyond the corrected staged publisher delegates is that this newly added PublishBuiltReleaseOutputs path carries the token only up to this call; thread it through the unified/tool GitHub helpers and invoke the publisher's cancellation-aware overload.
Useful? React with 👍 / 👎.
| var modulePublication = ExecuteModuleRequest( | ||
| deferredModulePublishRequest, | ||
| ConfigurationGateMode.Publish, | ||
| includeModulePublishing: true, | ||
| noDotnetBuild: true, |
There was a problem hiding this comment.
Reuse staged JSON output without staging it again
For a JSON-backed module deferred behind packages, tools, or Apple publication, this second invocation receives the same populated staging path produced by the Build invocation. Fresh evidence after the earlier staging-reuse fix is that the real JSON pipeline still calls ModuleBuildPipeline.StageToStaging on every invocation, and that method rejects any existing non-empty staging directory before NoDotnetBuild can reuse its payload; the added regression test mocks _executeModuleBuild, so it does not exercise this failure. The Publish invocation therefore fails after prerequisite destinations may already have published; add a true reuse-staging path that bypasses the second staging copy.
Useful? React with 👍 / 👎.
| if (!builtResult.Success) | ||
| return builtResult; | ||
|
|
||
| RewriteReleaseSummaryFiles(builtResult); |
There was a problem hiding this comment.
Keep signed release summaries immutable after upload
When staged publication includes Outputs.ManifestJsonPath or Outputs.ChecksumsPath, this post-publication rewrite changes the already signed and uploaded files: the manifest gains the GitHub publication result and a new createdUtc, and the checksum file is then recalculated from that new manifest. The local checkpoint consequently no longer matches either its signing receipts or the assets on GitHub, so a later retry can fail integrity validation and local consumers verify different metadata from release consumers. Do not rewrite checkpointed metadata after upload, or replace the remote assets through a newly approved integrity checkpoint.
Useful? React with 👍 / 👎.
Summary
Build/Build-Project.ps1entry pointpowerforge.jsonand letBuild/release.jsoncoordinate module, NuGet, native tools, shared versions, and the unified GitHub releaseModule.ConfigPathexecution with typed runtime overrides, exact local assembly loading, structured JSON behavior, and shared progress/elapsed summariesBuild-Module {}DSL for consumer repositoriesMaintainer usage
-Publishenables module signing using the certificate declared inpowerforge.json. Use-ModuleNoSignonly when an unsigned release is intentional.Studio scope
PowerForge Studio remains compile-visible and its shared release/checkpoint contracts retain focused regression coverage. Studio's product smoke, WPF/UI suite, and staged-publish runtime are temporarily excluded from the required product gate because Studio is not currently treated as a functional release product. The required gate covers PowerForge, PowerForge.Web, and PSPublishModule.
Migration
The repository-local
Build/Build-Module.ps1,Build/Build-Release.ps1, andModule/Build/Build-Module.ps1entry points are removed. External module repositories can continue using the PowerShell DSL; this cleanup applies to PSPublishModule's own self-build.