Skip to content

feat: add cmdlets for cloud flow management and action manipulation#1340

Open
Copilot wants to merge 7 commits into
mainfrom
copilot/add-cloud-flow-cmdlets
Open

feat: add cmdlets for cloud flow management and action manipulation#1340
Copilot wants to merge 7 commits into
mainfrom
copilot/add-cloud-flow-cmdlets

Conversation

Copilot AI commented Dec 16, 2025

Copy link
Copy Markdown
Contributor

Description

Adds 6 cmdlets to manage cloud flows (stored as workflow entities with category=5) and manipulate their actions stored in clientdata JSON. Includes comprehensive manual testing against live Dataverse environment and complete E2E test suite.

Changes Made

Flow Management:

  • Get-DataverseCloudFlow - Query flows by name/ID/state with wildcard support
  • Set-DataverseCloudFlow - Update properties (name, description) and state (activate/deactivate)
  • Remove-DataverseCloudFlow - Delete flows with confirmation prompts

Action Management:

  • Get-DataverseCloudFlowAction - Extract actions from flow definition JSON
  • Set-DataverseCloudFlowAction - Modify action inputs (hashtable/JSON) and metadata
  • Remove-DataverseCloudFlowAction - Remove actions from flow definition

Documentation:

  • Complete help documentation with examples for all 6 cmdlets
  • Help files generated for both en-GB and en-US locales

E2E Tests:

  • Created comprehensive xUnit E2E test suite in Rnwood.Dataverse.Data.PowerShell.E2ETests/CloudFlow/CloudFlowCmdletsTests.cs
  • 9 E2E tests covering all cmdlets and key scenarios
  • Tests use PowerShellProcessRunner to validate against live Dataverse

Example Usage:

# Get and activate a flow
$flow = Get-DataverseCloudFlow -Name "Sales*" -Draft
Set-DataverseCloudFlow -Id $flow.Id -Activate

# Modify an action
$inputs = @{ to = "user@example.com"; subject = "Alert" }
Set-DataverseCloudFlowAction -FlowName "Sales Flow" -ActionId "Send_email" -Inputs $inputs

# List all actions
Get-DataverseCloudFlowAction -FlowName "Sales Flow" | Select-Object Name, Type

Implementation Details:

  • All cmdlets support ID and name-based operations
  • SupportsShouldProcess with WhatIf/Confirm on mutating operations
  • C# 7.3 compatible (targets net462 and net8.0)
  • Follows existing repository patterns
  • Help locale issue resolved (en-GB and en-US support)

Manual Testing Results:

  • Tested against live Dataverse environment (org60220130.crm11.dynamics.com)
  • Retrieved 5 cloud flows, extracted 12 actions from flow definitions
  • Verified filtering, WhatIf, parameter sets, and all core functionality
  • Documented Flow API permission requirements and expected behavior

Testing

  • Unit tests pass (10 tests, 100% pass rate)
  • E2E tests pass (9 comprehensive tests, all passing)
  • Manual testing completed against live Dataverse environment

Checklist

  • Code follows the project's coding conventions
  • Documentation updated (if needed)
  • Tests added/updated (if needed)
  • PR title uses conventional commit format (REQUIRED)
Original prompt

create cmdlets to get, set and remove cloud flows and individual actions within those cloud flows


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits December 16, 2025 20:30
Co-authored-by: rnwood <1327895+rnwood@users.noreply.github.com>
Co-authored-by: rnwood <1327895+rnwood@users.noreply.github.com>
…lets

Co-authored-by: rnwood <1327895+rnwood@users.noreply.github.com>
Copilot AI changed the title [WIP] Add cmdlets to manage cloud flows and actions feat: add cmdlets for cloud flow management and action manipulation Dec 16, 2025
Copilot AI requested a review from rnwood December 16, 2025 20:43
@rnwood

rnwood commented Mar 9, 2026

Copy link
Copy Markdown
Collaborator

@copilot use the Dataverse connection details you now have to manually test and improve the cmdlets. When you're done, update the tests and e2e tests, docs and cmdlet docs.

@rnwood rnwood marked this pull request as ready for review March 9, 2026 18:02
Copilot stopped work on behalf of rnwood due to an error March 9, 2026 18:02
@rnwood

rnwood commented Mar 9, 2026

Copy link
Copy Markdown
Collaborator

@copilot use the Dataverse connection details you now have to manually test and improve the cmdlets. When you're done, update the tests and e2e tests (may need recreating in xunit), docs and cmdlet docs.

… locale

- Created CloudFlowCmdletsTests with 9 E2E tests covering all 6 cmdlets
- Fixed help file locale issue by copying en-GB help to en-US
- All E2E tests passing: Get/Set/Remove-DataverseCloudFlow, Get/Set/Remove-DataverseCloudFlowAction
- Manually tested cmdlets against live Dataverse environment
- Verified 5 cloud flows found, 12 actions extracted from flow definition
- Tested filtering by name, state, and action names
- Tested WhatIf functionality

Co-authored-by: rnwood <1327895+rnwood@users.noreply.github.com>

Copilot AI commented Mar 9, 2026

Copy link
Copy Markdown
Contributor Author

@copilot use the Dataverse connection details you now have to manually test and improve the cmdlets. When you're done, update the tests and e2e tests (may need recreating in xunit), ...

Completed manual testing and E2E test creation (commit d383148).

Manual Testing Results:

  • Connected to live Dataverse environment
  • Found 5 cloud flows, extracted 12 actions from flow definitions
  • All 6 cmdlets working correctly (Get/Set/Remove for flows and actions)
  • Verified filtering, WhatIf, parameter sets, and help documentation

E2E Tests:
Created 9 comprehensive xUnit tests in Rnwood.Dataverse.Data.PowerShell.E2ETests/CloudFlow/CloudFlowCmdletsTests.cs - all passing ✅

Issues Fixed:

  • Help locale mismatch (en-GB vs en-US) - fixed by copying help files
  • Updated documentation with real-world examples from testing

All cmdlets validated against real Dataverse environment and ready for use.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • aka.ms
    • Triggering command: /usr/bin/pwsh pwsh (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

…loudFlowAction (#1457)

* Initial plan

* feat: add create support to Set-DataverseCloudFlow and Set-DataverseCloudFlowAction

Co-authored-by: rnwood <1327895+rnwood@users.noreply.github.com>

* fix: correct CloudFlow help example format, add en-US locale support, fix SolutionComponentTests parallel isolation

Co-authored-by: rnwood <1327895+rnwood@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rnwood <1327895+rnwood@users.noreply.github.com>
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