A few weeks ago, I was reading on some strategies to do “code” reviews for power platform solutions. My goal was to figure how to review a solution that was being pushed via Power Platform Pipelines and give the developer and project lead a scoring for how it performed. This got me reading more into Power Apps Code Review tool created by Power CAT powerapps-tools/Tools/Apps/Microsoft.PowerApps.CodeReview at master · microsoft/powerapps-tools · GitHub. This provided a framework for getting Canvas apps reviewed and ranked but wanted to automate the reviews so that it would do the review as it was being promoted in the pipeline.
The basic architecture will be like this
When a new push to test occurs, a review of the solution will occur. After the review, the output is sent to the PPPM Solution History table. From here we can add the score to the notification sent to the project lead before approving the solution into production.
Solution History Table
Within the PPPM solution, create a new table called Power Platform Solutions History
Power Apps Code Review Tool
The Power Apps Code Review tool is comprised of two apps (MDA and a canvas). The MDA is where all the rules and the reviews can be reviewed. The canvas app is where the an amazing showcase for what a canvas app can do. It provides a great interface for Code Reviews Checklists, App Checker, App Overview, Code Review, and Review Results
Within the app I made an update to help with deep linking.
- Within the AppOnStart I set the AppID to the environment variable the equals the environment variable andy_PowerAppsReviewAppID
Set( AppID, LookUp('Environment Variable Values', 'Schema Name' = "andy_PowerAppsReviewAppID").Value );
- Within the AppStartScreen I updated the If statement to navigate to the SolutionDetailsScreen
If(!IsBlank(Param("reviewid")), SolutionDetailsScreen)
- Within the OnVisible of the SolutionDetailsScreen, add an if statement that will set the variable ActiveSolutionReviewID to be either reviewid or SolutionReviewID. Then update the var SelectedSolutionReview and collection SolutionReviewApps.
// Set ActiveSolutionReviewID based on whether the parameter is blank Set( ActiveSolutionReviewID, If( IsBlank(Param("reviewid")), SolutionReviewID, Param("reviewid") ) ); // Set SelectedSolutionReview using ActiveSolutionReviewID Set( SelectedSolutionReview, LookUp( PatchedSolutionReviews, Rev_SolutionReview = GUID(ActiveSolutionReviewID) ) ); // Populate SolutionReviewApps using ActiveSolutionReviewID ClearCollect( SolutionReviewApps, Filter( Rev_Apps, Rev_Apps_SolutionReview.Rev_SolutionReview = GUID(ActiveSolutionReviewID) && Chx_AppType <> AppType.'Model Driven App' ) );
- The Solution score button in the upper right needs to be updated as well to use the new variable
Round( LookUp( Rev_SolutionReview, Rev_SolutionReview = GUID(ActiveSolutionReviewID) ).Nb_SolutionScore * 100, 0 ) & "%"
- I also updated the header back button to be hidden if the review is not blank. This way the user can only navigate to the report they were sent.
Pipeline Flow Configuration
1.2 - When a push to test happens
The trigger for the flow will be When an action is performed
To ensure that the trigger only occurs when a push to test occurs, a trigger condition needs to be set. For me, it is the deploy to test stage
@equals(triggerOutputs()?['body/OutputParameters/DeploymentStageName'], 'STAGENAME')
Next will be a Scope with two Dataverse Get row ID actions
The first will get the stage run information using the stage run id from the trigger
triggerOutputs()?['body/InputParameters/StageRunId']
The other will get the Deployment Artifact from the action above
outputs('Get_a_row_by_ID_-_Deployment_Stage_Runs')?['body/_artifactid_value']
A child flow will be triggered that starts the actual app review
A scope with a condition based on the review status of the app review
Within the True side, add two Dataverse Actions.
The first will get the GUID of the solutions tracking table in the production environment using the name of the Artifact
The second adds a row to the Solution History table in Production table
1.2.1 - Start App Review
The 1.2.1 flow is the child flow called from the 1.2.1 flow and start the actual app review
- The trigger will be a manual trigger that asks for the StageRunID, ArtifactID, ArtifactName, ArtifactVersion
- Next, add a Boolean variable called varStatus
- To get the artifact out of the pipeline a HTTP action
- Within a Scope action four Dataverse Actions are added
- The first will add a new row to the Solution Review table
- The second will upload the file to the Solution Review table
- The third adds a new row to the Review Request table
- The fourth will set the review status of In Progress
- After the Scope another scope is added with a Do Until Action and a Dataverse Action
- The Do until will keep running until varStatus is equal to true
- Within the Do until add a delay action, this will give the review time to run
- Next add a Get row by ID of the Solution Review table
- Add a condition that checks to see if the status of the review is done
- If it equals Done or Error and not In Progress then it will set the variable varStatus to true
- The last action within the scope will get the Solution Review record via ID
- The last action within the flow will be to respond to the parent flow with the app review score, the review status, and the reviewid
This was a really interesting post to write. I have always wanted to do “reviews” with my teams that do not have ADO or another connected system. In the next post, I will go over how I build a method for doing reviews on Power Automate flows using Power Platform Pipelines.