How‑to — Structurer le dépôt et versionner la solution
Nous mettons la solution Dataverse sous contrôle Git via pac solution unpack/pack pour suivre chaque changement XML.
Arborescence Git
Une structure claire facilite CI/CD et revues.
solutions/
Marlk_SalesCore/
Other/Solution.xml
Customizations.xml
plugins/
Marlk.SalesCore.Plugins/
src/*.cs
tests/*.cs
pipelines/
build.yml
release.yml
ops/
scripts/*.ps1
Script PowerShell — Export & Unpack
Un script réutilisable standardise l’export depuis DEV.
param(
[string]$SolutionName = 'Marlk_SalesCore',
[string]$OutDir = 'artifacts'
)
$ErrorActionPreference = 'Stop'
mkdir $OutDir -Force | Out-Null
pac auth select --name DevAuth
pac solution export --name $SolutionName --path "$OutDir/$SolutionName.zip" --managed false --processCanvasApps false
pac solution unpack --zipfile "$OutDir/$SolutionName.zip" --folder "solutions/$SolutionName" --allowDelete true
Write-Host "Export & Unpack completed"
Script PowerShell — Pack
Le pack recompose la solution à partir des sources XML.
param(
[string]$SolutionName = 'Marlk_SalesCore',
[string]$OutDir = 'artifacts'
)
$ErrorActionPreference = 'Stop'
mkdir $OutDir -Force | Out-Null
pac solution pack --zipfile "$OutDir/$SolutionName.zip" --folder "solutions/$SolutionName" --packagetype Unmanaged
Write-Host "Pack completed"
Custom API — extrait XML (Customizations.xml)
Nous documentons la définition minimale pour revue.
<CustomAPIs>
<CustomAPI>
<Name>mar_custom_CalculateOpportunityMargin</Name>
<DisplayName>Calculate Opportunity Margin</DisplayName>
<IsFunction>false</IsFunction>
<BindingType>Global</BindingType>
<AllowedCustomProcessingStepType>SyncOnly</AllowedCustomProcessingStepType>
<ExecutePrivilegeName />
<CustomAPIRequestParameters>
<CustomAPIRequestParameter>
<Name>opportunityid</Name>
<Type>Guid</Type>
<IsOptional>false</IsOptional>
</CustomAPIRequestParameter>
<CustomAPIRequestParameter>
<Name>applydiscount</Name>
<Type>Boolean</Type>
<IsOptional>true</IsOptional>
</CustomAPIRequestParameter>
</CustomAPIRequestParameters>
<CustomAPIResponseProperties>
<CustomAPIResponseProperty>
<Name>marginamount</Name>
<Type>Money</Type>
</CustomAPIResponseProperty>
<CustomAPIResponseProperty>
<Name>marginrate</Name>
<Type>Decimal</Type>
</CustomAPIResponseProperty>
</CustomAPIResponseProperties>
</CustomAPI>
</CustomAPIs>
Git – conventions
Nous appliquons des pratiques simples et efficaces.
- Commits Conventional Commits (
feat:,fix:,chore:). - PR avec reviewers et build validation.
- Tags SemVer (
v1.2.0).