Skip to content

Commit 01c2f96

Browse files
authored
Dependencies to pre-published apps doesn't work in AL-Go for GitHub (#1661)
This pull request includes changes to improve the handling of missing dependencies in the `RunPipeline.ps1` script If an app has a dependency on an app, which is pre-published to the container, you cannot specify that app in installApps, in fact, you cannot install it at all. This fix enables allows you to have dependencies to microsoft apps (from the current version) without having to add these to installApps - just add the dependency. Fixes #1530 --------- Co-authored-by: freddydk <[email protected]>
1 parent ba007b4 commit 01c2f96

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

Actions/RunPipeline/RunPipeline.ps1

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,11 +380,26 @@ try {
380380
$runAlPipelineParams += @{
381381
"InstallMissingDependencies" = {
382382
Param([Hashtable]$parameters)
383-
$parameters.missingDependencies | ForEach-Object {
384-
$appid = $_.Split(':')[0]
385-
$appName = $_.Split(':')[1]
383+
foreach($missingDependency in $parameters.missingDependencies) {
384+
$appid = $missingDependency.Split(':')[0]
385+
$appName = $missingDependency.Split(':')[1]
386386
$version = $appName.SubString($appName.LastIndexOf('_')+1)
387387
$version = [System.Version]$version.SubString(0,$version.Length-4)
388+
389+
# If dependency app is already installed, skip it
390+
# If dependency app is already published, synchronize and install it
391+
if ($parameters.ContainsKey('containerName')) {
392+
$appInfo = Get-BcContainerAppInfo -containerName $parameters.containerName -tenantSpecificProperties | Where-Object { $_.AppId -eq $appid }
393+
if ($appInfo) {
394+
# App already exists
395+
if (-not $appInfo.isInstalled) {
396+
Sync-BcContainerApp -containerName $parameters.containerName -tenant $parameters.tenant -appPublisher $appInfo.Publisher -appName $appInfo.Name -appVersion "$($appInfo.version)"
397+
Install-BcContainerApp -containerName $parameters.containerName -tenant $parameters.tenant -appPublisher $appInfo.Publisher -appName $appInfo.Name -appVersion "$($appInfo.version)"
398+
}
399+
continue
400+
}
401+
}
402+
388403
$publishParams = @{
389404
"nuGetServerUrl" = $gitHubPackagesCredential.serverUrl
390405
"nuGetToken" = GetAccessToken -token $gitHubPackagesCredential.token -permissions @{"packages"="read";"contents"="read";"metadata"="read"} -repositories @()

RELEASENOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- Issue 1655 GithubPackageContext does not work together with private trustedNuGetFeeds
88
- Issue 1627 AL-Go should throw an error or a warning if you create a release, which is older than the latest release
99
- Issue 1657 When no files modified on Git, deployment fails
10+
- Issue 1530 Dependency Field Service Integration does not get published in container while Installing apps
1011

1112
## v7.0
1213

0 commit comments

Comments
 (0)