Capgemini / Capgemini/powerapps-project-template

Update solution changes detected method in PR/pipelines

Open
#99 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C#
Stars
33
Forks
9
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**

Looking at the powershell script [File](https://github.com/Capgemini/powerapps-project-template/blob/fe1f4157b2b4fc61b872517077da5f03e9049e5e/src/generators/app/templates/source/pipelines/scripts/Add-BuildTagForEachUpdatedSolution.ps1) here for how we detect which solutions have changed to manage incrementing the solution/s versioning.

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

the current method uses "$resultArray = git show --name-only" , git show generally looks at commit/s in our use.
A Pull request can have multiple commits which I understand can limit your merge options to "squash merge"
if run post Pull request (build), solution/s version will not be tracked in the repo.

**Describe the solution you'd like**

A separate "Build" as part of the PR policy to manage solution versioning (reason below) .

Note, in the event, two active PRs with the same solution/s there is a chance of them both incrementing to the same version number without being detected, this will prevent the last one to merge into master/main from being deployed succesfully as they could have the same version number. to prevent this, the pull request build policy should be set to "Build expiration" "Immediately when master is updated" so that for the last one to merge into master/main versioning build will be re-ran and incremented

Replace "$resultArray = git show --name-only" with the below, which will instead highlight changes between the pull request source branch and the target branch

$targetbranch = $env:SYSTEM_PULLREQUEST_TARGETBRANCH.replace('refs/heads/', '')
$resultArray = git diff --name-only origin/$targetbranch

add to update solution version number in extracted solutions Solution.xml (source branch) (making sure it does not loop, for example when updated on source branch, it does not re-trigger and increment)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.