Skip to content

Make PowerShell tooling dependencies feature-scoped#422

Merged
PrzemyslawKlys merged 16 commits into
mainfrom
codex/optional-tool-dependencies
Jun 6, 2026
Merged

Make PowerShell tooling dependencies feature-scoped#422
PrzemyslawKlys merged 16 commits into
mainfrom
codex/optional-tool-dependencies

Conversation

@PrzemyslawKlys
Copy link
Copy Markdown
Member

Summary

  • remove Pester and PowerShellGet from PSPublishModule import-time RequiredModules
  • add build-time feature tool preflight for enabled test and PowerShell repository publish segments
  • keep normal builds/imports clean unless tests or repository publishing are configured

Validation

  • dotnet test .\PowerForge.Tests\PowerForge.Tests.csproj -c Release --filter "ModulePipelineHostedOperationsTests|PSPublishModuleManifestContractTests|PrivateGalleryBootstrapReadinessTests|ModuleDependencyInstallerExactVersionTests"
  • .\Build\Build-Module.ps1 -NoBuild
  • generated pipeline config check: RequiredModules=0, Tests=0, Publishes=0 for current PSPublishModule build
  • built artifact import check: RequiredModules=0 and Import-IsolatedModule available

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 81f19583be

ℹ️ 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".

Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Dependencies.cs
Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Dependencies.cs Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f7a9a5202b

ℹ️ 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".

Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Dependencies.cs
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a14f986ee4

ℹ️ 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".

Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Dependencies.cs Outdated
Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Dependencies.cs
Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Dependencies.cs
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f2d3a8b127

ℹ️ 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".

Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Plan.cs Outdated
Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Dependencies.cs
Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Dependencies.cs Outdated
Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Plan.cs Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8603ede1ca

ℹ️ 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".

Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Dependencies.cs
Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Dependencies.cs Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 33a49ca8bc

ℹ️ 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".

Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Run.cs
Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Dependencies.cs Outdated
Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Dependencies.cs Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4cec9755b8

ℹ️ 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".

Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Dependencies.cs Outdated
Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Dependencies.cs Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7e65821f67

ℹ️ 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".

Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Dependencies.cs Outdated
Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Run.Helpers.cs
Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Dependencies.cs Outdated
Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Dependencies.cs Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ef0902b57b

ℹ️ 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".

Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Dependencies.cs Outdated
Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Dependencies.cs Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 36856faf50

ℹ️ 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".

Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Dependencies.cs Outdated
Comment thread Module/PSPublishModule.psd1
Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Dependencies.cs
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1c67a26347

ℹ️ 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".

Comment thread PowerForge.PowerShell/Services/ModuleTestSuiteService.cs Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 954c0df167

ℹ️ 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".

Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Dependencies.cs Outdated
Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Dependencies.cs Outdated
Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Dependencies.cs
Comment thread Module/PSPublishModule.psd1
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2111bf2f64

ℹ️ 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".

Comment thread PowerForge.PowerShell/Services/ModulePipelineRunner.Dependencies.cs
@PrzemyslawKlys PrzemyslawKlys merged commit 4de8114 into main Jun 6, 2026
6 checks passed
@PrzemyslawKlys PrzemyslawKlys deleted the codex/optional-tool-dependencies branch June 6, 2026 16:50
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7c77555724

ℹ️ 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(docs))
docs = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
if (!string.IsNullOrWhiteSpace(docs))
return Path.Combine(docs!, "PowerShell", "Modules");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Install Windows PowerShell bootstrap into the 5.1 module path

On Windows hosts where the direct bootstrap runs without a usable user PSModulePath entry and the runner falls back to powershell.exe (the supported PowerShell 5.1 case), this installs PSResourceGet under Documents\PowerShell\Modules, which Windows PowerShell 5.1 does not probe by default (Documents\WindowsPowerShell\Modules is the user path). The direct install can therefore appear to succeed, but the next PowerShellGet/PSResourceGet operation still cannot import the bootstrapped module; choose the destination based on the executable/edition or include the WindowsPowerShell user module path for 5.1.

Useful? React with 👍 / 👎.

Comment on lines +243 to +247
if (skip.Contains(RepositoryToolModuleName) ||
dependencies.Any(static dependency =>
dependency is not null &&
!string.IsNullOrWhiteSpace(dependency.Name) &&
IsRepositoryToolModule(dependency.Name)))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Bootstrap PSResourceGet when PowerShellGet is requested

When Invoke-ModuleTestSuite is run on a clean host with AdditionalModules (or manifest dependencies) that include PowerShellGet, this branch suppresses the PSResourceGet bootstrap solely because a repository-tool dependency is present. ModuleDependencyInstaller cannot direct-bootstrap PowerShellGet itself when both repository clients are missing, so the install fails before test dependencies can be fetched; only suppress the bootstrap when PSResourceGet is already requested, or install PSResourceGet before an explicit PowerShellGet dependency.

Useful? React with 👍 / 👎.

Comment on lines +232 to +236
var hasInstallTarget = dependencies.Any(dependency =>
dependency is not null &&
!string.IsNullOrWhiteSpace(dependency.Name) &&
!IsRepositoryToolModule(dependency.Name) &&
!skip.Contains(dependency.Name));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Skip test-suite bootstrap when dependencies are satisfied

On an offline or locked-down host that already has the requested test-suite modules installed but has no repository client, this predicate still returns true just because a non-repository dependency is listed. The previous EnsureInstalled call would mark those modules as satisfied, but the new bootstrap runs first and can fail or mutate the host even though no download is needed; check NeedsInstall/installed metadata before bootstrapping PSResourceGet here.

Useful? React with 👍 / 👎.

ModuleName = 'Pester'
ModuleVersion = '5.7.1'
})
RequiredModules = @()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the Pester minimum for standalone test suites

After removing Pester from the manifest, standalone Invoke-ModuleTestSuite and validation test-suite runs no longer inherit the previous Pester >= 5.7.1 requirement; ModuleTestSuiteService adds the default Pester dependency without a minimum version, so a host with an older Pester already installed is treated as satisfied and runs tests under that old engine. The pipeline preflight still uses PesterMinimumVersion, so keep the same minimum in the standalone dependency path before dropping the manifest requirement.

Useful? React with 👍 / 👎.

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