Skip to content

fix(agent): gate PSU Event Hub import and make it non-fatal#1817

Merged
Benoît Cortier (CBenoit) merged 2 commits into
masterfrom
fix/psu-compat
Jun 5, 2026
Merged

fix(agent): gate PSU Event Hub import and make it non-fatal#1817
Benoît Cortier (CBenoit) merged 2 commits into
masterfrom
fix/psu-compat

Conversation

@CBenoit
Copy link
Copy Markdown
Member

The PowerShell Universal Event Hub compatibility import ran on every agent startup. It could enable an experimental feature solely from the presence of a third-party PSU config file or PSU_ environment variable, and could abort startup entirely if such a file or variable was malformed.

The import is now gated at the call site behind both the enable_unstable debug flag and an already-enabled PsuEventHub configuration. It never enables the feature on its own: a stray PSU config or PSU_ variable can no longer bring the feature into existence. When the feature is explicitly enabled but defines no connections of its own, the legacy PSU configuration is used to fill them in; any explicit configuration always wins. The import is also best-effort: any failure is logged and ignored instead of blocking startup.

The foreign-format PSU parsing is additionally moved out of the agent config module into a dedicated psu_event_hub::compat module to keep legacy migration code separate from the native agent configuration.

The PowerShell Universal Event Hub compatibility import ran on every agent
startup. It could enable an experimental feature solely from the presence of a
third-party PSU config file or `PSU_` environment variable, and could abort
startup entirely if such a file or variable was malformed.

The import is now gated at the call site behind both the `enable_unstable`
debug flag and an already-enabled PsuEventHub configuration. It never enables
the feature on its own: a stray PSU config or `PSU_` variable can no longer
bring the feature into existence. When the feature is explicitly enabled but
defines no connections of its own, the legacy PSU configuration is used to fill
them in; any explicit configuration always wins. The import is also best-effort:
any failure is logged and ignored instead of blocking startup.

The foreign-format PSU parsing is additionally moved out of the agent config
module into a dedicated `psu_event_hub::compat` module to keep legacy
migration code separate from the native agent configuration.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens the Devolutions Agent’s PowerShell Universal (PSU) Event Hub compatibility import so it cannot implicitly enable the feature and cannot block agent startup when legacy PSU artifacts are malformed. It also moves PSU foreign-format parsing out of the main config module into a dedicated compatibility module.

Changes:

  • Gate PSU compat import behind both debug.enable_unstable and an already-enabled PsuEventHub config; treat import failures as non-fatal (log and continue).
  • Extract PSU legacy parsing/merge logic into psu_event_hub::compat, with dedicated tests.
  • Rename the PSU PowerShell worker config field from power_shell to powershell (while keeping JSON compatibility via rename = "PowerShell").

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
devolutions-agent/src/config.rs Gates compat import at startup and makes it best-effort; updates DTO field naming/serde attributes.
devolutions-agent/src/psu_event_hub/mod.rs Adjusts runtime usage to the renamed powershell field.
devolutions-agent/src/psu_event_hub/compat.rs New module implementing PSU legacy config import + env overrides + tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread devolutions-agent/src/psu_event_hub/compat.rs
Comment thread devolutions-agent/src/config.rs Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@CBenoit Benoît Cortier (CBenoit) enabled auto-merge (squash) June 5, 2026 12:44
@CBenoit Benoît Cortier (CBenoit) merged commit 610275a into master Jun 5, 2026
42 checks passed
@CBenoit Benoît Cortier (CBenoit) deleted the fix/psu-compat branch June 5, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants