diff --git a/src/solutions/devhub_DevelopmentHub_AzureDevOps/Extract/Workflows/Whenasolutionmergeisapproved-Mergethesolution-5004652F-F9B3-EA11-A812-000D3A86AD99.json b/src/solutions/devhub_DevelopmentHub_AzureDevOps/Extract/Workflows/Whenasolutionmergeisapproved-Mergethesolution-5004652F-F9B3-EA11-A812-000D3A86AD99.json index d265094..caddcc6 100644 --- a/src/solutions/devhub_DevelopmentHub_AzureDevOps/Extract/Workflows/Whenasolutionmergeisapproved-Mergethesolution-5004652F-F9B3-EA11-A812-000D3A86AD99.json +++ b/src/solutions/devhub_DevelopmentHub_AzureDevOps/Extract/Workflows/Whenasolutionmergeisapproved-Mergethesolution-5004652F-F9B3-EA11-A812-000D3A86AD99.json @@ -1 +1 @@ -{"properties":{"connectionReferences":{"shared_commondataserviceforapps":{"runtimeSource":"embedded","connection":{"connectionReferenceLogicalName":"devhub_sharedcommondataserviceforapps_f7ca3"},"api":{"name":"shared_commondataserviceforapps"}},"shared_approvals":{"runtimeSource":"embedded","connection":{"connectionReferenceLogicalName":"devhub_sharedapprovals_6d3fc"},"api":{"name":"shared_approvals"}},"shared_visualstudioteamservices":{"runtimeSource":"embedded","connection":{"connectionReferenceLogicalName":"devhub_sharedvisualstudioteamservices_d7fcb"},"api":{"name":"shared_visualstudioteamservices"}}},"definition":{"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#","contentVersion":"1.0.0.0","parameters":{"$connections":{"defaultValue":{},"type":"Object"},"$authentication":{"defaultValue":{},"type":"SecureObject"}},"triggers":{"When_a_solution_merge_is_approved":{"type":"OpenApiConnectionWebhook","inputs":{"host":{"connectionName":"shared_commondataserviceforapps","operationId":"SubscribeWebhookTrigger","apiId":"/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters":{"subscriptionRequest/message":3,"subscriptionRequest/entityname":"devhub_solutionmerge","subscriptionRequest/scope":4,"subscriptionRequest/filteringattributes":"statuscode","subscriptionRequest/filterexpression":"statuscode eq 353400000"},"authentication":"@parameters('$authentication')"},"description":"Using devhub_approvedon rather than statuscode as the flow wasn't triggering with statuscode as a filtering attribute"}},"actions":{"Merge_development_solution":{"actions":{"Get_the_last_approved_solution_merge":{"runAfter":{},"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_commondataserviceforapps","operationId":"ListRecords","apiId":"/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters":{"entityName":"devhub_solutionmerges","$select":"devhub_name","$filter":"devhub_solutionmergeid ne @{triggerOutputs()?['body/devhub_solutionmergeid']} and (statuscode eq 353400000 or statuscode eq 353400003 or statuscode eq 353400002 or statuscode eq 353400006 or statuscode eq 353400007)","$orderby":"devhub_approvedon desc","$top":1},"authentication":"@parameters('$authentication')"}},"If_another_solution_merge_is_in_progress":{"actions":{"Create_a_note_stating_the_solution_merge_is_queued":{"runAfter":{},"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_commondataserviceforapps","operationId":"CreateRecord","apiId":"/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters":{"entityName":"annotations","item/subject":"Solution merge queued","item/notetext":"This solution merge has been queued behind '@{outputs('Get_the_last_approved_solution_merge')?['body/value'][0]['devhub_name']}'.","item/objectid_devhub_solutionmerge@odata.bind":"devhub_solutionmerges(@{triggerOutputs()?['body/devhub_solutionmergeid']})"},"authentication":"@parameters('$authentication')"}},"Cancel_the_flow":{"runAfter":{"Queue_the_solution_merge":["Succeeded"]},"type":"Terminate","inputs":{"runStatus":"Cancelled"}},"Queue_the_solution_merge":{"runAfter":{"Create_a_note_stating_the_solution_merge_is_queued":["Succeeded"]},"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_commondataserviceforapps","operationId":"PerformBoundAction","apiId":"/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters":{"entityName":"devhub_solutionmerges","actionName":"Microsoft.Dynamics.CRM.devhub_QueueSolutionMerge","recordId":"@triggerOutputs()?['body/devhub_solutionmergeid']"},"authentication":"@parameters('$authentication')"}}},"runAfter":{"Get_the_last_approved_solution_merge":["Succeeded"]},"expression":{"not":{"equals":["@outputs('Get_the_last_approved_solution_merge')?['body/value']?[0]?['devhub_solutionmergeid']","@null"]}},"type":"If"},"Get_the_target_environment":{"runAfter":{"If_another_solution_merge_is_in_progress":["Succeeded"]},"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_commondataserviceforapps","operationId":"GetItem","apiId":"/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters":{"entityName":"devhub_solutions","recordId":"@triggerOutputs()?['body/_devhub_targetsolution_value']","$select":"devhub_solutionid,devhub_uniquename","$expand":"devhub_StagingEnvironment($select=devhub_environmentid,devhub_tenantid,devhub_clientid,devhub_clientsecret,devhub_url),devhub_Repository($expand=devhub_Project($select=devhub_name);$select=devhub_sourcecontrolstrategy,devhub_extractbuilddefinitionid,devhub_targetbranch)"},"authentication":"@parameters('$authentication')"}},"Update_the_solution_merge_status_to_merging":{"runAfter":{"Get_the_target_environment":["Succeeded"]},"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_commondataserviceforapps","operationId":"UpdateRecord","apiId":"/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters":{"entityName":"devhub_solutionmerges","recordId":"@triggerOutputs()?['body/devhub_solutionmergeid']","item/statuscode":353400003},"authentication":"@parameters('$authentication')"}},"Get_the_developed_issue":{"runAfter":{"Update_the_solution_merge_status_to_merging":["Succeeded"]},"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_commondataserviceforapps","operationId":"GetItem","apiId":"/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters":{"entityName":"devhub_issues","recordId":"@outputs('Update_the_solution_merge_status_to_merging')?['body/_devhub_issue_value']","$select":"devhub_developmentsolution,devhub_type,devhub_azuredevopsworkitemid,devhub_name"},"authentication":"@parameters('$authentication')"}},"Export_the_development_solution":{"runAfter":{"Get_the_developed_issue":["Succeeded"]},"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_commondataserviceforapps","operationId":"PerformUnboundAction","apiId":"/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters":{"actionName":"ExportSolution","item/SolutionName":"@outputs('Get_the_developed_issue')?['body/devhub_developmentsolution']","item/Managed":false,"item/ExportAutoNumberingSettings":false,"item/ExportCalendarSettings":false,"item/ExportCustomizationSettings":false,"item/ExportEmailTrackingSettings":false,"item/ExportGeneralSettings":false,"item/ExportMarketingSettings":false,"item/ExportOutlookSynchronizationSettings":false,"item/ExportRelationshipRoles":false,"item/ExportIsvConfig":false,"item/ExportSales":false,"item/ExportExternalApplications":false},"authentication":"@parameters('$authentication')"}},"Get_access_token_for_staging_environment":{"runAfter":{"Export_the_development_solution":["Succeeded"]},"type":"Workflow","inputs":{"host":{"workflowReferenceName":"db657a26-1d37-eb11-a813-000d3a0b97ca"},"body":{"text":"@outputs('Get_the_target_environment')?['body/devhub_stagingenvironment/devhub_tenantid']","text_1":"@outputs('Get_the_target_environment')?['body/devhub_stagingenvironment/devhub_clientid']","text_2":"@outputs('Get_the_target_environment')?['body/devhub_stagingenvironment/devhub_clientsecret']","text_3":"@outputs('Get_the_target_environment')?['body/devhub_stagingenvironment/devhub_url']"}}},"Import_development_solution":{"runAfter":{"Get_access_token_for_staging_environment":["Succeeded"]},"type":"Http","inputs":{"method":"POST","uri":"@{outputs('Get_the_target_environment')?['body/devhub_stagingenvironment/devhub_url']}/api/data/v9.1/ImportSolution","headers":{"Content-Type":"application/json"},"body":{"CustomizationFile":"@{outputs('Export_the_development_solution')?['body/ExportSolutionFile']}","OverwriteUnmanagedCustomizations":true,"PublishWorkflows":true,"ImportJobId":"@{variables('importJobId')}"},"authentication":{"type":"Raw","value":"Bearer @{outputs('Get_access_token_for_staging_environment')?['Body']?['access_token']}"},"retryPolicy":{"type":"none"}}},"Query_import_job_until_done":{"actions":{"Parse_import_job_JSON":{"runAfter":{"Get_import_job":["Succeeded"]},"type":"ParseJson","inputs":{"content":"@body('Get_import_job')","schema":{"type":"object","properties":{"progress":{"type":"number"},"data":{"type":"string"},"completedon":{"type":["string","null"]}}}}},"Get_import_job":{"runAfter":{},"type":"Http","inputs":{"method":"GET","uri":"@{outputs('Get_the_target_environment')?['body/devhub_stagingenvironment/devhub_url']}/api/data/v9.1/importjobs(@{variables('importJobId')})","authentication":{"type":"Raw","value":"Bearer @{outputs('Get_access_token_for_staging_environment')?['Body']?['access_token']}"},"retryPolicy":{"type":"none"}}},"Set_importJobComplete":{"runAfter":{"Parse_import_job_JSON":["Succeeded"]},"type":"SetVariable","inputs":{"name":"importJobComplete","value":"@not(equals(body('Parse_import_job_JSON')?['completedon'], null))"}},"If_incomplete":{"actions":{"Delay":{"runAfter":{},"type":"Wait","inputs":{"interval":{"count":30,"unit":"Second"}}}},"runAfter":{"Set_importJobComplete":["Succeeded"]},"expression":{"equals":["@variables('importJobComplete')","@false"]},"type":"If"}},"runAfter":{"Import_development_solution":["Succeeded","TimedOut","Failed"]},"expression":"@equals(variables('importJobComplete'), true)","limit":{"count":40,"timeout":"PT30M "},"type":"Until"},"If_importing_the_development_solution_failed":{"actions":{"Create_a_note_stating_the_solution_import_failed":{"runAfter":{},"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_commondataserviceforapps","operationId":"CreateRecord","apiId":"/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters":{"entityName":"annotations","item/subject":"Solution import failed","item/notetext":"The import into the staging environment failed with the following error:\n\n@{xpath(xml(body('Parse_import_job_JSON')?['data']), 'string(/importexportxml/solutionManifests/solutionManifest/result/@errortext)')}","item/objectid_devhub_solutionmerge@odata.bind":"devhub_solutionmerges(@{triggerOutputs()?['body/devhub_solutionmergeid']})"},"authentication":"@parameters('$authentication')"}},"Fail_the_flow":{"runAfter":{"Update_the_solution_merge_to_failed":["Succeeded"]},"type":"Terminate","inputs":{"runStatus":"Failed","runError":{"message":"The development solution import failed"}}},"Update_the_solution_merge_to_failed":{"runAfter":{"Create_a_note_stating_the_solution_import_failed":["Succeeded"]},"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_commondataserviceforapps","operationId":"UpdateRecord","apiId":"/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters":{"entityName":"devhub_solutionmerges","recordId":"@triggerOutputs()?['body/devhub_solutionmergeid']","item/statuscode":353400002},"authentication":"@parameters('$authentication')"}}},"runAfter":{"Query_import_job_until_done":["Succeeded"]},"expression":{"equals":["@xpath(xml(body('Parse_import_job_JSON')?['data']), 'string(/importexportxml/solutionManifests/solutionManifest/result/@result)')","failure"]},"type":"If"},"Get_solutions":{"runAfter":{"If_importing_the_development_solution_failed":["Succeeded"]},"type":"Http","inputs":{"method":"GET","uri":"@{outputs('Get_the_target_environment')?['body/devhub_stagingenvironment/devhub_url']}/api/data/v9.1/solutions?$filter=uniquename eq '@{outputs('Get_the_developed_issue')?['body/devhub_developmentsolution']}' or uniquename eq '@{outputs('Get_the_target_environment')?['body/devhub_uniquename']}'&$select=uniquename&$expand=solution_solutioncomponent($select=objectid,componenttype,rootcomponentbehavior)","authentication":{"type":"Raw","value":"Bearer @{outputs('Get_access_token_for_staging_environment')?['Body']?['access_token']}"},"retryPolicy":{"type":"none"}}},"Parse_solutions_JSON":{"runAfter":{"Get_solutions":["Succeeded"]},"type":"ParseJson","inputs":{"content":"@body('Get_solutions')","schema":{"type":"object","properties":{"@@odata.context":{"type":"string"},"value":{"type":"array","items":{"type":"object","properties":{"@@odata.etag":{"type":"string"},"uniquename":{"type":"string"},"solutionid":{"type":"string"},"solution_solutioncomponent":{"type":"array"},"solution_solutioncomponent@odata.nextLink":{"type":"string"}},"required":["@@odata.etag","uniquename","solutionid","solution_solutioncomponent","solution_solutioncomponent@odata.nextLink"]}}}}}},"Filter_development_solution":{"runAfter":{"Parse_solutions_JSON":["Succeeded"]},"type":"Query","inputs":{"from":"@body('Parse_solutions_JSON')?['value']","where":"@equals(item()?['uniquename'], outputs('Get_the_developed_issue')?['body/devhub_developmentsolution'])"}},"Filter_target_solution":{"runAfter":{"Set_developmentSolutionComponents":["Succeeded"]},"type":"Query","inputs":{"from":"@body('Parse_solutions_JSON')?['value']","where":"@equals(item()?['uniquename'], outputs('Get_the_target_environment')?['body/devhub_uniquename'])"}},"Apply_to_each_development_solution_component":{"foreach":"@variables('developmentSolutionComponents')","actions":{"Find_target_solution_component_for_same_object_ID":{"runAfter":{},"type":"Query","inputs":{"from":"@variables('targetSolutionComponents')","where":"@equals(item()?['objectid'], items('Apply_to_each_development_solution_component')?['objectid'])"}},"If_matching_target_solution_component":{"actions":{},"runAfter":{"Find_target_solution_component_for_same_object_ID":["Succeeded"]},"else":{"actions":{"Add_solution_component":{"runAfter":{},"type":"Http","inputs":{"method":"POST","uri":"@{outputs('Get_the_target_environment')?['body/devhub_stagingenvironment/devhub_url']}/api/data/v9.1/AddSolutionComponent","headers":{"Content-Type":"application/json"},"body":{"ComponentId":"@{string(item()?['objectid'])}","ComponentType":"@items('Apply_to_each_development_solution_component')?['componenttype']","SolutionUniqueName":"@{outputs('Get_the_target_environment')?['body/devhub_uniquename']}","AddRequiredComponents":false,"DoNotIncludeSubcomponents":"@if(equals(item()?['rootcomponentbehavior'], 0), false, true)","IncludedComponentSettingsValues":"@if(equals(item()?['rootcomponentbehaviour'], 2), createArray(), null)"},"authentication":{"type":"Raw","value":"Bearer @{outputs('Get_access_token_for_staging_environment')?['Body']?['access_token']}"}}}}},"expression":{"greater":["@length(body('Find_target_solution_component_for_same_object_ID'))",0]},"type":"If"}},"runAfter":{"Set_targetSolutionComponents":["Succeeded"]},"type":"Foreach"},"Get_the_post-merge_solution_version":{"runAfter":{"Apply_to_each_development_solution_component":["Succeeded"]},"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_commondataserviceforapps","operationId":"PerformBoundAction","apiId":"/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters":{"entityName":"devhub_solutionmerges","actionName":"Microsoft.Dynamics.CRM.devhub_GetPostMergeSolutionVersion","recordId":"@triggerOutputs()?['body/devhub_solutionmergeid']"},"authentication":"@parameters('$authentication')"}},"Update_target_solution_version":{"runAfter":{"Get_the_post-merge_solution_version":["Succeeded"]},"type":"Http","inputs":{"method":"PATCH","uri":"@{outputs('Get_the_target_environment')?['body/devhub_stagingenvironment/devhub_url']}/api/data/v9.1/solutions(@{first(body('Filter_target_solution'))?['solutionid']})","headers":{"Content-Type":"application/json"},"body":{"version":"@{outputs('Get_the_post-merge_solution_version')?['body/MajorVersion']}.@{outputs('Get_the_post-merge_solution_version')?['body/MinorVersion']}.@{outputs('Get_the_post-merge_solution_version')?['body/PatchVersion']}"},"authentication":{"type":"Raw","value":"Bearer @{outputs('Get_access_token_for_staging_environment')?['Body']?['access_token']}"}}},"Publish":{"runAfter":{"Update_target_solution_version":["Succeeded"]},"type":"Http","inputs":{"method":"POST","uri":"@{outputs('Get_the_target_environment')?['body/devhub_stagingenvironment/devhub_url']}/api/data/v9.1/PublishAllXml","headers":{"Content-Type":"application/json"},"authentication":{"type":"Raw","value":"Bearer @{outputs('Get_access_token_for_staging_environment')?['Body']?['access_token']}"}}},"If_there_are_manual_merge_activities":{"actions":{"Update_the_solution_merge_status_to_awaiting_manual_merge":{"runAfter":{},"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_commondataserviceforapps","operationId":"UpdateRecord","apiId":"/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters":{"entityName":"devhub_solutionmerges","recordId":"@triggerOutputs()?['body/devhub_solutionmergeid']","item/statuscode":353400006},"authentication":"@parameters('$authentication')"}},"Start_and_wait_for_an_approval":{"runAfter":{"Get_the_solution_merge_creator":["Succeeded"]},"type":"OpenApiConnectionWebhook","inputs":{"host":{"connectionName":"shared_approvals","operationId":"StartAndWaitForAnApproval","apiId":"/providers/Microsoft.PowerApps/apis/shared_approvals"},"parameters":{"approvalType":"CustomResponse","WebhookApprovalCreationInput/responseOptions":["Merged"],"WebhookApprovalCreationInput/title":"Solution merge awaiting manual merge activities - @{triggerOutputs()?['body/devhub_name']}","WebhookApprovalCreationInput/assignedTo":"@outputs('Get_the_solution_merge_creator')?['body/internalemailaddress']","WebhookApprovalCreationInput/enableNotifications":true,"WebhookApprovalCreationInput/enableReassignment":true},"authentication":"@parameters('$authentication')"}},"Get_the_solution_merge_creator":{"runAfter":{"Update_the_solution_merge_status_to_awaiting_manual_merge":["Succeeded"]},"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_commondataserviceforapps","operationId":"GetItem","apiId":"/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters":{"entityName":"systemusers","recordId":"@triggerOutputs()?['body/_createdby_value']","$select":"internalemailaddress,personalemailaddress"},"authentication":"@parameters('$authentication')"}}},"runAfter":{"Publish":["Succeeded"]},"expression":{"equals":["@triggerOutputs()?['body/devhub_manualmergeactivities']",true]},"type":"If"},"Delete_development_solution":{"runAfter":{"Create_the_commit_or_pull_request":["Succeeded"]},"type":"Http","inputs":{"method":"DELETE","uri":"@{outputs('Get_the_target_environment')?['body/devhub_stagingenvironment/devhub_url']}/api/data/v9.1/solutions(@{first(body('Filter_development_solution'))?['solutionid']})","headers":{"Content-Type":"application/json"},"authentication":{"type":"Raw","value":"Bearer @{outputs('Get_access_token_for_staging_environment')?['Body']?['access_token']}"}}},"Set_developmentSolutionComponents":{"runAfter":{"Filter_development_solution":["Succeeded"]},"type":"SetVariable","inputs":{"name":"developmentSolutionComponents","value":"@first(body('Filter_development_solution'))['solution_solutioncomponent']"}},"Set_targetSolutionComponents":{"runAfter":{"Filter_target_solution":["Succeeded"]},"type":"SetVariable","inputs":{"name":"targetSolutionComponents","value":"@first(body('Filter_target_solution'))['solution_solutioncomponent']"}},"Get_devhub_AzureDevOpsOrganization":{"runAfter":{"If_there_are_manual_merge_activities":["Succeeded"]},"type":"Workflow","inputs":{"host":{"workflowReferenceName":"9bc32b76-754b-ea11-a812-000d3a0b8d0b"},"body":{"text":"devhub_AzureDevOpsOrganization"}}},"Create_the_commit_or_pull_request":{"runAfter":{"Get_devhub_AzureDevOpsOrganization":["Succeeded"]},"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_visualstudioteamservices","operationId":"QueueNewBuild","apiId":"/providers/Microsoft.PowerApps/apis/shared_visualstudioteamservices"},"parameters":{"account":"@outputs('Get_devhub_AzureDevOpsOrganization')?['Body']?['environment_variable_value']","project":"@body('Get_the_target_environment')?['devhub_Repository']?['devhub_Project']?['devhub_name']","buildDefId":"@body('Get_the_target_environment')['devhub_Repository']?['devhub_extractbuilddefinitionid']","buildDetails/parameters":"{\n \"solutionMergeId\": \"@{triggerOutputs()?['body/devhub_solutionmergeid']}\",\n \"clientId\": \"@{outputs('Get_the_target_environment')?['body/devhub_stagingenvironment/devhub_clientid']}\",\n \"tenantId\": \"@{outputs('Get_the_target_environment')?['body/devhub_stagingenvironment/devhub_tenantid']}\",\n \"clientSecret\": \"@{outputs('Get_the_target_environment')?['body/devhub_stagingenvironment/devhub_clientsecret']}\",\n \"devEnvironmentUrl\": \"https://@{uriHost(body('Get_the_target_environment')?['@odata.id'])}\"\n}"},"authentication":"@parameters('$authentication')"}}},"runAfter":{"Initialize_targetSolutionComponents":["Succeeded"]},"type":"Scope"},"Initialize_importJobId":{"runAfter":{},"type":"InitializeVariable","inputs":{"variables":[{"name":"importJobId","type":"string","value":"@{guid()}"}]}},"Initialize_importJobProgress":{"runAfter":{"Initialize_importJobId":["Succeeded"]},"type":"InitializeVariable","inputs":{"variables":[{"name":"importJobComplete","type":"boolean","value":"@false"}]}},"Initialize_developmentSolutionComponents":{"runAfter":{"Initialize_importJobProgress":["Succeeded"]},"type":"InitializeVariable","inputs":{"variables":[{"name":"developmentSolutionComponents","type":"array"}]}},"Initialize_targetSolutionComponents":{"runAfter":{"Initialize_developmentSolutionComponents":["Succeeded"]},"type":"InitializeVariable","inputs":{"variables":[{"name":"targetSolutionComponents","type":"array"}]}},"Set_solution_merge_status_to_'Failed'_(merge_development_solution)":{"runAfter":{"Merge_development_solution":["Failed","TimedOut"]},"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_commondataserviceforapps","operationId":"UpdateRecord","apiId":"/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters":{"entityName":"devhub_solutionmerges","recordId":"@triggerOutputs()?['body/devhub_solutionmergeid']","item/statecode":0,"item/statuscode":353400002},"authentication":"@parameters('$authentication')"}},"Create_a_failure_note_on_the_solution_merge_(merge_development_solution)":{"runAfter":{"Set_solution_merge_status_to_'Failed'_(merge_development_solution)":["Succeeded"]},"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_commondataserviceforapps","operationId":"CreateRecord","apiId":"/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters":{"entityName":"annotations","item/subject":"Failed to merge","item/notetext":"Failed to merge the development solution with the target solution. Please refer to the flow run for more detail. \n\n","item/objectid_devhub_solutionmerge@odata.bind":"devhub_solutionmerges(@{triggerOutputs()?['body/devhub_solutionmergeid']})"},"authentication":"@parameters('$authentication')"}},"Terminate":{"runAfter":{"Create_a_failure_note_on_the_solution_merge_(merge_development_solution)":["Succeeded"]},"type":"Terminate","inputs":{"runStatus":"Failed","runError":{"message":"Failed to merge the development solution with the target solution."}}}},"outputs":{}}},"schemaVersion":"1.0.0.0"} \ No newline at end of file +{"properties": {"connectionReferences": {"shared_commondataserviceforapps": {"runtimeSource": "embedded","connection": {"connectionReferenceLogicalName": "devhub_sharedcommondataserviceforapps_f7ca3"},"api": {"name": "shared_commondataserviceforapps"}},"shared_approvals": {"runtimeSource": "embedded","connection": {"connectionReferenceLogicalName": "devhub_sharedapprovals_6d3fc"},"api": {"name": "shared_approvals"}},"shared_visualstudioteamservices": {"runtimeSource": "embedded","connection": {"connectionReferenceLogicalName": "devhub_sharedvisualstudioteamservices_d7fcb"},"api": {"name": "shared_visualstudioteamservices"}}},"definition": {"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#","contentVersion": "1.0.0.0","parameters": {"$connections": {"defaultValue": {},"type": "Object"},"$authentication": {"defaultValue": {},"type": "SecureObject"}},"triggers": {"When_a_solution_merge_is_approved": {"type": "OpenApiConnectionWebhook","inputs": {"host": {"connectionName": "shared_commondataserviceforapps","operationId": "SubscribeWebhookTrigger","apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters": {"subscriptionRequest/message": 3,"subscriptionRequest/entityname": "devhub_solutionmerge","subscriptionRequest/scope": 4,"subscriptionRequest/filteringattributes": "statuscode","subscriptionRequest/filterexpression": "statuscode eq 353400000"},"authentication": "@parameters('$authentication')"},"description": "Using devhub_approvedon rather than statuscode as the flow wasn't triggering with statuscode as a filtering attribute"}},"actions": {"Merge_development_solution": {"actions": {"Get_the_last_approved_solution_merge": {"runAfter": {},"type": "OpenApiConnection","inputs": {"host": {"connectionName": "shared_commondataserviceforapps","operationId": "ListRecords","apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters": {"entityName": "devhub_solutionmerges","$select": "devhub_name","$filter": "devhub_solutionmergeid ne @{triggerOutputs()?['body/devhub_solutionmergeid']} and (statuscode eq 353400000 or statuscode eq 353400003 or statuscode eq 353400002 or statuscode eq 353400006 or statuscode eq 353400007)","$orderby": "devhub_approvedon desc","$top": 1},"authentication": "@parameters('$authentication')"}},"If_another_solution_merge_is_in_progress": {"actions": {"Create_a_note_stating_the_solution_merge_is_queued": {"runAfter": {},"type": "OpenApiConnection","inputs": {"host": {"connectionName": "shared_commondataserviceforapps","operationId": "CreateRecord","apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters": {"entityName": "annotations","item/subject": "Solution merge queued","item/notetext": "This solution merge has been queued behind '@{outputs('Get_the_last_approved_solution_merge')?['body/value'][0]['devhub_name']}'.","item/objectid_devhub_solutionmerge@odata.bind": "devhub_solutionmerges(@{triggerOutputs()?['body/devhub_solutionmergeid']})"},"authentication": "@parameters('$authentication')"}},"Cancel_the_flow": {"runAfter": {"Queue_the_solution_merge": ["Succeeded"]},"type": "Terminate","inputs": {"runStatus": "Cancelled"}},"Queue_the_solution_merge": {"runAfter": {"Create_a_note_stating_the_solution_merge_is_queued": ["Succeeded"]},"type": "OpenApiConnection","inputs": {"host": {"connectionName": "shared_commondataserviceforapps","operationId": "PerformBoundAction","apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters": {"entityName": "devhub_solutionmerges","actionName": "Microsoft.Dynamics.CRM.devhub_QueueSolutionMerge","recordId": "@triggerOutputs()?['body/devhub_solutionmergeid']"},"authentication": "@parameters('$authentication')"}}},"runAfter": {"Get_the_last_approved_solution_merge": ["Succeeded"]},"expression": {"not": {"equals": ["@outputs('Get_the_last_approved_solution_merge')?['body/value']?[0]?['devhub_solutionmergeid']","@null"]}},"type": "If"},"Get_the_target_environment": {"runAfter": {"If_another_solution_merge_is_in_progress": ["Succeeded"]},"type": "OpenApiConnection","inputs": {"host": {"connectionName": "shared_commondataserviceforapps","operationId": "GetItem","apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters": {"entityName": "devhub_solutions","recordId": "@triggerOutputs()?['body/_devhub_targetsolution_value']","$select": "devhub_solutionid,devhub_uniquename","$expand": "devhub_StagingEnvironment($select=devhub_environmentid,devhub_tenantid,devhub_clientid,devhub_clientsecret,devhub_url),devhub_Repository($expand=devhub_Project($select=devhub_name);$select=devhub_sourcecontrolstrategy,devhub_extractbuilddefinitionid,devhub_targetbranch)"},"authentication": "@parameters('$authentication')"}},"Update_the_solution_merge_status_to_merging": {"runAfter": {"Get_the_target_environment": ["Succeeded"]},"type": "OpenApiConnection","inputs": {"host": {"connectionName": "shared_commondataserviceforapps","operationId": "UpdateRecord","apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters": {"entityName": "devhub_solutionmerges","recordId": "@triggerOutputs()?['body/devhub_solutionmergeid']","item/statuscode": 353400003},"authentication": "@parameters('$authentication')"}},"Get_the_developed_issue": {"runAfter": {"Update_the_solution_merge_status_to_merging": ["Succeeded"]},"type": "OpenApiConnection","inputs": {"host": {"connectionName": "shared_commondataserviceforapps","operationId": "GetItem","apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters": {"entityName": "devhub_issues","recordId": "@outputs('Update_the_solution_merge_status_to_merging')?['body/_devhub_issue_value']","$select": "devhub_developmentsolution,devhub_type,devhub_azuredevopsworkitemid,devhub_name"},"authentication": "@parameters('$authentication')"}},"Export_the_development_solution": {"runAfter": {"Get_the_developed_issue": ["Succeeded"]},"type": "OpenApiConnection","inputs": {"host": {"connectionName": "shared_commondataserviceforapps","operationId": "PerformUnboundAction","apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters": {"actionName": "ExportSolution","item/SolutionName": "@outputs('Get_the_developed_issue')?['body/devhub_developmentsolution']","item/Managed": false,"item/ExportAutoNumberingSettings": false,"item/ExportCalendarSettings": false,"item/ExportCustomizationSettings": false,"item/ExportEmailTrackingSettings": false,"item/ExportGeneralSettings": false,"item/ExportMarketingSettings": false,"item/ExportOutlookSynchronizationSettings": false,"item/ExportRelationshipRoles": false,"item/ExportIsvConfig": false,"item/ExportSales": false,"item/ExportExternalApplications": false},"authentication": "@parameters('$authentication')"}},"Get_access_token_for_staging_environment": {"runAfter": {"Export_the_development_solution": ["Succeeded"]},"type": "Workflow","inputs": {"host": {"workflowReferenceName": "db657a26-1d37-eb11-a813-000d3a0b97ca"},"body": {"text": "@outputs('Get_the_target_environment')?['body/devhub_stagingenvironment/devhub_tenantid']","text_1": "@outputs('Get_the_target_environment')?['body/devhub_stagingenvironment/devhub_clientid']","text_2": "@outputs('Get_the_target_environment')?['body/devhub_stagingenvironment/devhub_clientsecret']","text_3": "@outputs('Get_the_target_environment')?['body/devhub_stagingenvironment/devhub_url']"}}},"Import_development_solution": {"runAfter": {"Get_access_token_for_staging_environment": ["Succeeded"]},"type": "Http","inputs": {"method": "POST","uri": "@{outputs('Get_the_target_environment')?['body/devhub_stagingenvironment/devhub_url']}/api/data/v9.1/ImportSolution","headers": {"Content-Type": "application/json"},"body": {"CustomizationFile": "@{outputs('Export_the_development_solution')?['body/ExportSolutionFile']}","OverwriteUnmanagedCustomizations": true,"PublishWorkflows": true,"ImportJobId": "@{variables('importJobId')}"},"authentication": {"type": "Raw","value": "Bearer @{outputs('Get_access_token_for_staging_environment')?['Body']?['access_token']}"},"retryPolicy": {"type": "none"}}},"Query_import_job_until_done": {"actions": {"Parse_import_job_JSON": {"runAfter": {"Get_import_job": ["Succeeded"]},"type": "ParseJson","inputs": {"content": "@body('Get_import_job')","schema": {"type": "object","properties": {"progress": {"type": "number"},"data": {"type": "string"},"completedon": {"type": ["string","null"]}}}}},"Get_import_job": {"runAfter": {},"type": "Http","inputs": {"method": "GET","uri": "@{outputs('Get_the_target_environment')?['body/devhub_stagingenvironment/devhub_url']}/api/data/v9.1/importjobs(@{variables('importJobId')})","authentication": {"type": "Raw","value": "Bearer @{outputs('Get_access_token_for_staging_environment')?['Body']?['access_token']}"},"retryPolicy": {"type": "none"}}},"Set_importJobComplete": {"runAfter": {"Parse_import_job_JSON": ["Succeeded"]},"type": "SetVariable","inputs": {"name": "importJobComplete","value": "@not(equals(body('Parse_import_job_JSON')?['completedon'], null))"}},"If_incomplete": {"actions": {"Delay": {"runAfter": {},"type": "Wait","inputs": {"interval": {"count": 30,"unit": "Second"}}}},"runAfter": {"Set_importJobComplete": ["Succeeded"]},"expression": {"equals": ["@variables('importJobComplete')","@false"]},"type": "If"}},"runAfter": {"Import_development_solution": ["Succeeded","TimedOut","Failed"]},"expression": "@equals(variables('importJobComplete'), true)","limit": {"count": 40,"timeout": "PT30M "},"type": "Until"},"If_importing_the_development_solution_failed": {"actions": {"Create_a_note_stating_the_solution_import_failed": {"runAfter": {},"type": "OpenApiConnection","inputs": {"host": {"connectionName": "shared_commondataserviceforapps","operationId": "CreateRecord","apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters": {"entityName": "annotations","item/subject": "Solution import failed","item/notetext": "The import into the staging environment failed with the following error:\n\n@{xpath(xml(body('Parse_import_job_JSON')?['data']), 'string(/importexportxml/solutionManifests/solutionManifest/result/@errortext)')}","item/objectid_devhub_solutionmerge@odata.bind": "devhub_solutionmerges(@{triggerOutputs()?['body/devhub_solutionmergeid']})"},"authentication": "@parameters('$authentication')"}},"Fail_the_flow": {"runAfter": {"Update_the_solution_merge_to_failed": ["Succeeded"]},"type": "Terminate","inputs": {"runStatus": "Failed","runError": {"message": "The development solution import failed"}}},"Update_the_solution_merge_to_failed": {"runAfter": {"Create_a_note_stating_the_solution_import_failed": ["Succeeded"]},"type": "OpenApiConnection","inputs": {"host": {"connectionName": "shared_commondataserviceforapps","operationId": "UpdateRecord","apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters": {"entityName": "devhub_solutionmerges","recordId": "@triggerOutputs()?['body/devhub_solutionmergeid']","item/statuscode": 353400002},"authentication": "@parameters('$authentication')"}}},"runAfter": {"Query_import_job_until_done": ["Succeeded"]},"expression": {"equals": ["@xpath(xml(body('Parse_import_job_JSON')?['data']), 'string(/importexportxml/solutionManifests/solutionManifest/result/@result)')","failure"]},"type": "If"},"Get_solutions": {"runAfter": {"If_importing_the_development_solution_failed": ["Succeeded"]},"type": "Http","inputs": {"method": "GET","uri": "@{outputs('Get_the_target_environment')?['body/devhub_stagingenvironment/devhub_url']}/api/data/v9.1/solutions?$filter=uniquename eq '@{outputs('Get_the_developed_issue')?['body/devhub_developmentsolution']}' or uniquename eq '@{outputs('Get_the_target_environment')?['body/devhub_uniquename']}'&$select=uniquename&$expand=solution_solutioncomponent($select=objectid,componenttype,rootcomponentbehavior)","authentication": {"type": "Raw","value": "Bearer @{outputs('Get_access_token_for_staging_environment')?['Body']?['access_token']}"},"retryPolicy": {"type": "none"}}},"Parse_solutions_JSON": {"runAfter": {"Get_solutions": ["Succeeded"]},"type": "ParseJson","inputs": {"content": "@body('Get_solutions')","schema": {"type": "object","properties": {"@@odata.context": {"type": "string"},"value": {"type": "array","items": {"type": "object","properties": {"@@odata.etag": {"type": "string"},"uniquename": {"type": "string"},"solutionid": {"type": "string"},"solution_solutioncomponent": {"type": "array"},"solution_solutioncomponent@odata.nextLink": {"type": "string"}},"required": ["@@odata.etag","uniquename","solutionid","solution_solutioncomponent","solution_solutioncomponent@odata.nextLink"]}}}}}},"Filter_development_solution": {"runAfter": {"Parse_solutions_JSON": ["Succeeded"]},"type": "Query","inputs": {"from": "@body('Parse_solutions_JSON')?['value']","where": "@equals(item()?['uniquename'], outputs('Get_the_developed_issue')?['body/devhub_developmentsolution'])"}},"Filter_target_solution": {"runAfter": {"Set_developmentSolutionComponents": ["Succeeded"]},"type": "Query","inputs": {"from": "@body('Parse_solutions_JSON')?['value']","where": "@equals(item()?['uniquename'], outputs('Get_the_target_environment')?['body/devhub_uniquename'])"}},"Apply_to_each_development_solution_component": {"foreach": "@variables('developmentSolutionComponents')","actions": {"Find_target_solution_component_for_same_object_ID": {"runAfter": {},"type": "Query","inputs": {"from": "@variables('targetSolutionComponents')","where": "@equals(item()?['objectid'], items('Apply_to_each_development_solution_component')?['objectid'])"}},"If_matching_target_solution_component": {"actions": {},"runAfter": {"Find_target_solution_component_for_same_object_ID": ["Succeeded"]},"else": {"actions": {"Add_solution_component": {"runAfter": {},"type": "Http","inputs": {"method": "POST","uri": "@{outputs('Get_the_target_environment')?['body/devhub_stagingenvironment/devhub_url']}/api/data/v9.1/AddSolutionComponent","headers": {"Content-Type": "application/json"},"body": {"ComponentId": "@{string(item()?['objectid'])}","ComponentType": "@items('Apply_to_each_development_solution_component')?['componenttype']","SolutionUniqueName": "@{outputs('Get_the_target_environment')?['body/devhub_uniquename']}","AddRequiredComponents": false,"DoNotIncludeSubcomponents": "@if(equals(item()?['rootcomponentbehavior'], 0), false, true)","IncludedComponentSettingsValues": "@if(equals(item()?['rootcomponentbehaviour'], 2), createArray(), null)"},"authentication": {"type": "Raw","value": "Bearer @{outputs('Get_access_token_for_staging_environment')?['Body']?['access_token']}"}}}}},"expression": {"greater": ["@length(body('Find_target_solution_component_for_same_object_ID'))",0]},"type": "If"}},"runAfter": {"Set_targetSolutionComponents": ["Succeeded"]},"type": "Foreach"},"Get_the_post-merge_solution_version": {"runAfter": {"Apply_to_each_development_solution_component": ["Succeeded"]},"type": "OpenApiConnection","inputs": {"host": {"connectionName": "shared_commondataserviceforapps","operationId": "PerformBoundAction","apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters": {"entityName": "devhub_solutionmerges","actionName": "Microsoft.Dynamics.CRM.devhub_GetPostMergeSolutionVersion","recordId": "@triggerOutputs()?['body/devhub_solutionmergeid']"},"authentication": "@parameters('$authentication')"}},"Update_target_solution_version": {"runAfter": {"Get_the_post-merge_solution_version": ["Succeeded"]},"type": "Http","inputs": {"method": "PATCH","uri": "@{outputs('Get_the_target_environment')?['body/devhub_stagingenvironment/devhub_url']}/api/data/v9.1/solutions(@{first(body('Filter_target_solution'))?['solutionid']})","headers": {"Content-Type": "application/json"},"body": {"version": "@{outputs('Get_the_post-merge_solution_version')?['body/MajorVersion']}.@{outputs('Get_the_post-merge_solution_version')?['body/MinorVersion']}.@{outputs('Get_the_post-merge_solution_version')?['body/PatchVersion']}"},"authentication": {"type": "Raw","value": "Bearer @{outputs('Get_access_token_for_staging_environment')?['Body']?['access_token']}"}}},"Publish": {"runAfter": {"Update_target_solution_version": ["Succeeded"]},"type": "Http","inputs": {"method": "POST","uri": "@{outputs('Get_the_target_environment')?['body/devhub_stagingenvironment/devhub_url']}/api/data/v9.1/PublishAllXml","headers": {"Content-Type": "application/json"},"authentication": {"type": "Raw","value": "Bearer @{outputs('Get_access_token_for_staging_environment')?['Body']?['access_token']}"}}},"If_there_are_manual_merge_activities": {"actions": {"Update_the_solution_merge_status_to_awaiting_manual_merge": {"runAfter": {},"type": "OpenApiConnection","inputs": {"host": {"connectionName": "shared_commondataserviceforapps","operationId": "UpdateRecord","apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters": {"entityName": "devhub_solutionmerges","recordId": "@triggerOutputs()?['body/devhub_solutionmergeid']","item/statuscode": 353400006},"authentication": "@parameters('$authentication')"}},"Start_and_wait_for_an_approval": {"runAfter": {"Get_the_solution_merge_approver": ["Succeeded"]},"type": "OpenApiConnectionWebhook","inputs": {"host": {"connectionName": "shared_approvals","operationId": "StartAndWaitForAnApproval","apiId": "/providers/Microsoft.PowerApps/apis/shared_approvals"},"parameters": {"approvalType": "CustomResponse","WebhookApprovalCreationInput/responseOptions": ["Merged"],"WebhookApprovalCreationInput/title": "Solution merge awaiting manual merge activities - @{triggerOutputs()?['body/devhub_name']}","WebhookApprovalCreationInput/assignedTo": "@{outputs('Get_the_solution_merge_creator')?['body/internalemailaddress']}; @{outputs('Get_the_solution_merge_approver')?['body/internalemailaddress']};","WebhookApprovalCreationInput/enableNotifications": true,"WebhookApprovalCreationInput/enableReassignment": true},"authentication": "@parameters('$authentication')"}},"Get_the_solution_merge_creator": {"runAfter": {"Update_the_solution_merge_status_to_awaiting_manual_merge": ["Succeeded"]},"type": "OpenApiConnection","inputs": {"host": {"connectionName": "shared_commondataserviceforapps","operationId": "GetItem","apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters": {"entityName": "systemusers","recordId": "@triggerOutputs()?['body/_createdby_value']","$select": "internalemailaddress,personalemailaddress"},"authentication": "@parameters('$authentication')"}},"Get_the_solution_merge_approver": {"runAfter": {"Get_the_solution_merge_creator": ["Succeeded"]},"type": "OpenApiConnection","inputs": {"host": {"connectionName": "shared_commondataserviceforapps","operationId": "GetItem","apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters": {"entityName": "systemusers","recordId": "@triggerOutputs()?['body/_devhub_approvedby_value']","$select": "internalemailaddress,personalemailaddress"},"authentication": "@parameters('$authentication')"}}},"runAfter": {"Publish": ["Succeeded"]},"expression": {"equals": ["@triggerOutputs()?['body/devhub_manualmergeactivities']",true]},"type": "If"},"Delete_development_solution": {"runAfter": {"Create_the_commit_or_pull_request": ["Succeeded"]},"type": "Http","inputs": {"method": "DELETE","uri": "@{outputs('Get_the_target_environment')?['body/devhub_stagingenvironment/devhub_url']}/api/data/v9.1/solutions(@{first(body('Filter_development_solution'))?['solutionid']})","headers": {"Content-Type": "application/json"},"authentication": {"type": "Raw","value": "Bearer @{outputs('Get_access_token_for_staging_environment')?['Body']?['access_token']}"}}},"Set_developmentSolutionComponents": {"runAfter": {"Filter_development_solution": ["Succeeded"]},"type": "SetVariable","inputs": {"name": "developmentSolutionComponents","value": "@first(body('Filter_development_solution'))['solution_solutioncomponent']"}},"Set_targetSolutionComponents": {"runAfter": {"Filter_target_solution": ["Succeeded"]},"type": "SetVariable","inputs": {"name": "targetSolutionComponents","value": "@first(body('Filter_target_solution'))['solution_solutioncomponent']"}},"Get_devhub_AzureDevOpsOrganization": {"runAfter": {"If_there_are_manual_merge_activities": ["Succeeded"]},"type": "Workflow","inputs": {"host": {"workflowReferenceName": "9bc32b76-754b-ea11-a812-000d3a0b8d0b"},"body": {"text": "devhub_AzureDevOpsOrganization"}}},"Create_the_commit_or_pull_request": {"runAfter": {"Get_devhub_AzureDevOpsOrganization": ["Succeeded"]},"type": "OpenApiConnection","inputs": {"host": {"connectionName": "shared_visualstudioteamservices","operationId": "QueueNewBuild","apiId": "/providers/Microsoft.PowerApps/apis/shared_visualstudioteamservices"},"parameters": {"account": "@outputs('Get_devhub_AzureDevOpsOrganization')?['Body']?['environment_variable_value']","project": "@body('Get_the_target_environment')?['devhub_Repository']?['devhub_Project']?['devhub_name']","buildDefId": "@body('Get_the_target_environment')['devhub_Repository']?['devhub_extractbuilddefinitionid']","buildDetails/parameters": "{\n \"solutionMergeId\": \"@{triggerOutputs()?['body/devhub_solutionmergeid']}\",\n \"clientId\": \"@{outputs('Get_the_target_environment')?['body/devhub_stagingenvironment/devhub_clientid']}\",\n \"tenantId\": \"@{outputs('Get_the_target_environment')?['body/devhub_stagingenvironment/devhub_tenantid']}\",\n \"clientSecret\": \"@{outputs('Get_the_target_environment')?['body/devhub_stagingenvironment/devhub_clientsecret']}\",\n \"devEnvironmentUrl\": \"https://@{uriHost(body('Get_the_target_environment')?['@odata.id'])}\"\n}"},"authentication": "@parameters('$authentication')"}}},"runAfter": {"Initialize_targetSolutionComponents": ["Succeeded"]},"type": "Scope"},"Initialize_importJobId": {"runAfter": {},"type": "InitializeVariable","inputs": {"variables": [{"name": "importJobId","type": "string","value": "@{guid()}"}]}},"Initialize_importJobProgress": {"runAfter": {"Initialize_importJobId": ["Succeeded"]},"type": "InitializeVariable","inputs": {"variables": [{"name": "importJobComplete","type": "boolean","value": "@false"}]}},"Initialize_developmentSolutionComponents": {"runAfter": {"Initialize_importJobProgress": ["Succeeded"]},"type": "InitializeVariable","inputs": {"variables": [{"name": "developmentSolutionComponents","type": "array"}]}},"Initialize_targetSolutionComponents": {"runAfter": {"Initialize_developmentSolutionComponents": ["Succeeded"]},"type": "InitializeVariable","inputs": {"variables": [{"name": "targetSolutionComponents","type": "array"}]}},"Set_solution_merge_status_to_'Failed'_(merge_development_solution)": {"runAfter": {"Merge_development_solution": ["Failed","TimedOut"]},"type": "OpenApiConnection","inputs": {"host": {"connectionName": "shared_commondataserviceforapps","operationId": "UpdateRecord","apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters": {"entityName": "devhub_solutionmerges","recordId": "@triggerOutputs()?['body/devhub_solutionmergeid']","item/statecode": 0,"item/statuscode": 353400002},"authentication": "@parameters('$authentication')"}},"Create_a_failure_note_on_the_solution_merge_(merge_development_solution)": {"runAfter": {"Set_solution_merge_status_to_'Failed'_(merge_development_solution)": ["Succeeded"]},"type": "OpenApiConnection","inputs": {"host": {"connectionName": "shared_commondataserviceforapps","operationId": "CreateRecord","apiId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"},"parameters": {"entityName": "annotations","item/subject": "Failed to merge","item/notetext": "Failed to merge the development solution with the target solution. Please refer to the flow run for more detail. \n\n","item/objectid_devhub_solutionmerge@odata.bind": "devhub_solutionmerges(@{triggerOutputs()?['body/devhub_solutionmergeid']})"},"authentication": "@parameters('$authentication')"}},"Terminate": {"runAfter": {"Create_a_failure_note_on_the_solution_merge_(merge_development_solution)": ["Succeeded"]},"type": "Terminate","inputs": {"runStatus": "Failed","runError": {"message": "Failed to merge the development solution with the target solution."}}}},"outputs": {}}},"schemaVersion": "1.0.0.0"} diff --git a/tests/DevelopmentHub.Tests.Ui/power-apps-bindings.yml b/tests/DevelopmentHub.Tests.Ui/power-apps-bindings.yml index a14190f..dab1f93 100644 --- a/tests/DevelopmentHub.Tests.Ui/power-apps-bindings.yml +++ b/tests/DevelopmentHub.Tests.Ui/power-apps-bindings.yml @@ -1,6 +1,7 @@ url: DEVELOPMENTHUB_TEST_URL browserOptions: browserType: Chrome + driversPath: ChromeWebDriver headless: true width: 1920 height: 1080 @@ -8,4 +9,4 @@ browserOptions: users: - username: DEVELOPMENTHUB_ADMIN_USERNAME password: DEVELOPMENTHUB_ADMIN_PASSWORD - alias: "an admin" \ No newline at end of file + alias: "an admin"