DIGITALLNature / DigitallPower

DIGITALLPOWER - the dotnet tool for the PowerPlatform from DIGITALL. A swiss army knife for all ALM issues where PAC still has weaknesses.
Microsoft Public License
7 stars 0 forks source link

Add feature to enable modern flows based on configuration #39

Closed ObersteinM closed 1 year ago

ObersteinM commented 1 year ago

This allows for automated de-/activation of specific flows based on a given config. Additionally it allows for assigning the flows to a specified owner. For activation the option exists to use impersonation to factor in flow connection that are either not shared with the executing application user yet or an application user is not yet setup.

Sample config:

{
    "owner": "defaultflowowner@domainname.com",
    "impersonate": "defaultapplicationuser@domainname.com",
    "solutionfilter": [
        "matchingSolution",
        "matchPattern%"
    ],
    "publisherfilter": [
        "matchingPublisher",
        "matchPattern%"
    ],
    "flows": {
        "Flow that should be disabled": {
            "disabled": true
        },
        "Flow that should be enabled": { },
        "Flow with detailed config":  {
            "disabled": true,
            "owner": "flowowner@domainname.com",
            "impersonate": "applicationuser@domainname.com"
        }
    }
}

Most of the config is optional and can be omitted (an empty config {} would be taken as vaild and assume all flows in the system should be activated). In general the following steps are performed:

  1. Load all modern flows that fit with any of the given solution or publisher filter
    • If no filters are provided this will run on all flows
    • The filters use fetchxml like filter and therefore allow for patterns
  2. Loop through all found flows and update them
    • If no config entry for the flow is found assume we want the flow in the activated state
    • Uses top level owner and impersonate user if not explicitly specified in flow config
    • Only updates attributes that needs updating
    • Only uses impersonation on activation of flows

Special interpretation exist for the configuration of owner and impersonation on flow level:

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 1.7.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: