microsoft / coe-starter-kit

Other
739 stars 216 forks source link

[ALM Accelerator - BUG]: The Solution Branch is not being created for the new repository #8875

Open Srikanth-Singapuram opened 2 weeks ago

Srikanth-Singapuram commented 2 weeks ago

Describe the issue

The Solution Branch is not being created for the new repository because of this the export pipeline is not establishing build policies. However, when I utilize the default repository to create a new feature branch, the new solution branch is successfully generated. I am uncertain about the underlying cause of this issue.

I have followed the same steps

image

Expected Behavior

No response

What component are you experiencing the issue with?

ALM Accelerator Canvas App

What solution version are you using?

1.0.20240305.1

Steps To Reproduce

No response

Anything else?

No response

mikefactorial commented 2 weeks ago

@Srikanth-Singapuram there's usually a message in the pipeline run log that would indicate what the error is in cases like this somewhere in the Update Deployment Settings step. It won't fail but an error will be logged. There was an update to Azure DevOps this year that requires additional permissions to be set that I don't believe are documented in the ALM Setup docs that affected how the Build Policy is created that you may be running into. Check here https://github.com/microsoft/coe-starter-kit/issues/7930#issuecomment-2024283993

mikefactorial commented 2 weeks ago

@RajeevPentyala I made an update for this a while back in the Project setup wizard in this PR https://github.com/microsoft/coe-starter-kit/pull/7959/files#r1734540303. Not sure if that will ever get added to a release but at the very least should update the docs to include this new required permission here https://github.com/MicrosoftDocs/power-platform/blob/main/power-platform/guidance/alm-accelerator/setup-components-manually.md#set-permissions-for-the-project-build-service

Srikanth-Singapuram commented 2 weeks ago

@mikefactorial I appreciate your prompt reply. I did not identify any errors related to the failure in creating the solution branch. However, I observed the following discrepancy, which may be the cause of the issue due to a failing condition. The log on the left side indicates the solution branch created from the default repository, while the log on the right side shows the failure to create the solution branch for the new repository. We possess the "Queue builds" permission for the pipeline "export-solution-to-git."

CC- @RajeevPentyala

image

image

image

mikefactorial commented 2 weeks ago

@Srikanth-Singapuram thanks for the additional details. There is an assumption, unfortunately. in the pipelines that the default branch is called "main". Looking back at your original screenshot I see now that the default in this case is "master" that's likely the cause of the issue.

Srikanth-Singapuram commented 2 weeks ago

@mikefactorial Indeed, you are correct. In the PowerShell script, we are evaluating the condition "if($refBranch.name -eq 'refs/heads/main')". Instead, we could incorporate an "or" condition to include the value "refs/heads/master".

image

When we initiate the REST API request for the Default Repository. image

When we initiate the REST API request for the new Repository. image