Skip to content

Unify asynchronous PowerShell cmdlet lifecycle#32

Merged
PrzemyslawKlys merged 24 commits into
masterfrom
codex/canonical-async-pscmdlet
Jul 26, 2026
Merged

Unify asynchronous PowerShell cmdlet lifecycle#32
PrzemyslawKlys merged 24 commits into
masterfrom
codex/canonical-async-pscmdlet

Conversation

@PrzemyslawKlys

@PrzemyslawKlys PrzemyslawKlys commented Jul 25, 2026

Copy link
Copy Markdown
Member

Summary - synchronize the repo-local AsyncPSCmdlet with the canonical implementation in EvotecIT/PSPublishModule#630 - start asynchronous hooks on the PowerShell pipeline thread and marshal post-await output, prompts, and errors back to it - add safe terminating errors, ShouldContinue, credential prompts, cancellation, scheduler/context isolation, and extensible disposal - keep the source copy local to this repository; no runtime or package dependency is introduced - preserve repository-specific helpers and extension points where present ## Compatibility Cmdlet names and parameters are unchanged. Asynchronous hooks must remain async end to end and must not block with Task.Wait, Task.Result, or Task.WaitAll. ## Verification IISParser.PowerShell Release build on .NET Framework and .NET 8; file-validation helpers remain intact. ## Review follow-through The synchronized source now includes nullable typed prompt replies, complete interaction overloads, public terminating-error compatibility, late-callback rejection, cancellation-on-dispose, and immediate pump-failure propagation while retaining IISParser file/error helpers.

Final async lifecycle semantics

Synchronous PowerShell calls restore the host synchronization context before queued work is drained or the base API is invoked. Queue admission and hook completion are serialized, preserving records admitted before completion while rejecting stale producers afterward. Reentrant drains preserve FIFO order, including context-free captured callbacks made while a lazy queued item is actively being pumped.

Hook completion wakes the pump immediately. Direct downstream stops cancel work already started with the cmdlet token, cancellation-source disposal waits until cancellation callbacks return, and derived synchronous EndProcessing overrides can continue interacting with the pipeline after calling the base implementation. Pipeline-thread ownership uses volatile publication, captured callbacks drop cleanly after stop, and progress snapshots retain optional runtime Total values.

Queued host interactions now atomically arbitrate cancellation against the pipeline claim: canceled unclaimed requests never enter the host, while a claimed prompt keeps its reply observed. Completed and failing synchronous hooks drain all causally reentrant records, and a synchronous pipeline stop cancels the shared token before rethrow.

PSPublishModule remains the canonical source owner. Consumer repositories retain namespace-adjusted local source copies and their repository-specific interfaces, helpers, formatting, and split-file conventions without adding a runtime package dependency.

Final validation

IISParser.PowerShell Release build passed at the exact head.

@codecov-commenter

codecov-commenter commented Jul 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.54%. Comparing base (18a52c0) to head (b8fe24c).

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #32   +/-   ##
=======================================
  Coverage   91.54%   91.54%           
=======================================
  Files           5        5           
  Lines         213      213           
  Branches       38       38           
=======================================
  Hits          195      195           
  Misses          8        8           
  Partials       10       10           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Copy link
Copy Markdown

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: f6311a0957

ℹ️ 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 IISParser.PowerShell/AsyncPSCmdlet.cs Outdated
Comment thread IISParser.PowerShell/AsyncPSCmdlet.cs Outdated

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

Copy link
Copy Markdown

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: 166b4f7f0e

ℹ️ 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 IISParser.PowerShell/AsyncPSCmdlet.cs Outdated
Comment thread IISParser.PowerShell/AsyncPSCmdlet.cs Outdated
Comment thread IISParser.PowerShell/AsyncPSCmdlet.cs Outdated

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

Copy link
Copy Markdown

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: 3a0182f7c2

ℹ️ 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 IISParser.PowerShell/AsyncPSCmdlet.cs Outdated
Comment thread IISParser.PowerShell/AsyncPSCmdlet.cs

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

Copy link
Copy Markdown

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: 690bb96bcd

ℹ️ 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 IISParser.PowerShell/AsyncPSCmdlet.cs Outdated
Comment thread IISParser.PowerShell/AsyncPSCmdlet.cs Outdated
Comment thread IISParser.PowerShell/AsyncPSCmdlet.cs

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

Copy link
Copy Markdown

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: 262554a666

ℹ️ 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 IISParser.PowerShell/AsyncPSCmdlet.cs Outdated

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

Copy link
Copy Markdown

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: 7579856dd8

ℹ️ 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 IISParser.PowerShell/AsyncPSCmdlet.Pipeline.cs Outdated

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

Copy link
Copy Markdown

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: 7c2b6e1edd

ℹ️ 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 IISParser.PowerShell/AsyncPSCmdlet.cs Outdated

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

Copy link
Copy Markdown

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: 73f642c56d

ℹ️ 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 IISParser.PowerShell/AsyncPSCmdlet.cs Outdated
Comment thread IISParser.PowerShell/AsyncPSCmdlet.cs

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

Copy link
Copy Markdown

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: 57b79732a5

ℹ️ 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 IISParser.PowerShell/AsyncPSCmdlet.Pipeline.cs Outdated
Comment thread IISParser.PowerShell/AsyncPSCmdlet.Pipeline.cs Outdated

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

Copy link
Copy Markdown

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: f8a207f880

ℹ️ 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 IISParser.PowerShell/AsyncPSCmdlet.Pipeline.cs Outdated

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

Copy link
Copy Markdown

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: 46c5ff2109

ℹ️ 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 IISParser.PowerShell/AsyncPSCmdlet.Execution.cs Outdated

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

Copy link
Copy Markdown

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: c5af21ca97

ℹ️ 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 IISParser.PowerShell/AsyncPSCmdlet.cs Outdated
@PrzemyslawKlys
PrzemyslawKlys merged commit 0ade50b into master Jul 26, 2026
8 checks passed
@PrzemyslawKlys
PrzemyslawKlys deleted the codex/canonical-async-pscmdlet branch July 26, 2026 09:11
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