Skip to content

Commit d95fd4e

Browse files
authored
Nuget bug fixes (#3280)
Fixes microsoft/AL-Go#858 Dumps all installed appnames along with appids Fixes wrong type of TrustedNuGetFeeds --------- Co-authored-by: freddydk <[email protected]>
1 parent 7da9154 commit d95fd4e

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

AppHandling/Run-AlPipeline.ps1

+7-8
Original file line numberDiff line numberDiff line change
@@ -450,21 +450,20 @@ function GetInstalledAppIds {
450450
if ($useCompilerFolder) {
451451
$existingAppFiles = @(Get-ChildItem -Path (Join-Path $packagesFolder '*.app') | Select-Object -ExpandProperty FullName)
452452
$installedApps = @(GetAppInfo -AppFiles $existingAppFiles -compilerFolder $compilerFolder -cacheAppinfoPath (Join-Path $packagesFolder 'cache_AppInfo.json'))
453-
$installedAppIds = @($installedApps | ForEach-Object { $_.AppId } )
454453
$compilerFolderAppFiles = @(Get-ChildItem -Path (Join-Path $compilerFolder 'symbols/*.app') | Select-Object -ExpandProperty FullName)
455-
$installedAppIds += @(GetAppInfo -AppFiles $compilerFolderAppFiles -compilerFolder $compilerFolder -cacheAppinfoPath (Join-Path $compilerFolder 'symbols/cache_AppInfo.json') | ForEach-Object { $_.AppId } )
454+
$installedApps += @(GetAppInfo -AppFiles $compilerFolderAppFiles -compilerFolder $compilerFolder -cacheAppinfoPath (Join-Path $compilerFolder 'symbols/cache_AppInfo.json'))
456455

457456
}
458457
elseif (!$filesOnly) {
459-
$installedAppIds = @(Invoke-Command -ScriptBlock $GetBcContainerAppInfo -ArgumentList $Parameters | ForEach-Object { $_.AppId })
458+
$installedApps = @(Invoke-Command -ScriptBlock $GetBcContainerAppInfo -ArgumentList $Parameters)
460459
}
461460
else {
462-
$installedAppIds = @()
461+
$installedApps = @()
463462
}
464-
Write-Host "::group::Installed AppIds"
465-
$installedAppIds | ForEach-Object { Write-Host "- $_" }
463+
Write-Host "::group::Installed Apps"
464+
$installedApps | ForEach-Object { Write-Host "- $($_.AppId):$($_.Name)" }
466465
Write-Host "::endgroup::"
467-
return $installedAppIds
466+
return $installedApps.AppId
468467
}
469468

470469
$telemetryScope = InitTelemetryScope -name $MyInvocation.InvocationName -parameterValues $PSBoundParameters -includeParameters @()
@@ -1397,7 +1396,7 @@ if ($gitHubActions) { Write-Host "::endgroup::" }
13971396
}
13981397

13991398

1400-
if ($InstallMissingDependencies) {
1399+
if ((($testCountry) -or !($appFolders -or $testFolders -or $bcptTestFolders)) -and ($InstallMissingDependencies)) {
14011400
$Parameters = @{
14021401
"containerName" = $containerName
14031402
"tenant" = $tenant

NuGet/Find-BcNuGetPackage.ps1

+4-4
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ Function Find-BcNuGetPackage {
5353

5454
$bestmatch = $null
5555
# Search all trusted feeds for the package
56-
foreach($feed in (@(@{ "Url" = $nuGetServerUrl; "Token" = $nuGetToken; "Patterns" = @('*'); "Fingerprints" = @() })+$bcContainerHelperConfig.TrustedNuGetFeeds)) {
56+
foreach($feed in (@([PSCustomObject]@{ "Url" = $nuGetServerUrl; "Token" = $nuGetToken; "Patterns" = @('*'); "Fingerprints" = @() })+$bcContainerHelperConfig.TrustedNuGetFeeds)) {
5757
if ($feed -and $feed.Url) {
5858
Write-Host "Search NuGetFeed $($feed.Url)"
59-
if (!$feed.ContainsKey('Token')) { $feed.Token = '' }
60-
if (!$feed.ContainsKey('Patterns')) { $feed.Patterns = @('*') }
61-
if (!$feed.ContainsKey('Fingerprints')) { $feed.Fingerprints = @() }
59+
if (!($feed.PSObject.Properties.Name -eq 'Token')) { $feed | Add-Member -MemberType NoteProperty -Name 'Token' -Value '' }
60+
if (!($feed.PSObject.Properties.Name -eq 'Patterns')) { $feed | Add-Member -MemberType NoteProperty -Name 'Patterns' -Value @('*') }
61+
if (!($feed.PSObject.Properties.Name -eq 'Fingerprints')) { $feed | Add-Member -MemberType NoteProperty -Name 'Fingerprints' -Value @() }
6262
$nuGetFeed = [NuGetFeed]::Create($feed.Url, $feed.Token, $feed.Patterns, $feed.Fingerprints)
6363
$packageIds = $nuGetFeed.Search($packageName)
6464
if ($packageIds) {

0 commit comments

Comments
 (0)