Skip to content

Commit

Permalink
Version number fixes (plus a few small bugs) (#3700)
Browse files Browse the repository at this point in the history
Three version number fixes:

- Bump version
- As minimum, always use the generic tag version which was available
when shipping BcContainerHelper
- Add awareness of Windows 11 24H2
- Issue 3697 Running tests fails with 401 when running on a BC25 sandbox
container with AAD authentication

Fixes #3694 
Fixes #3697

---------

Co-authored-by: freddydk <[email protected]>
  • Loading branch information
freddydk and freddydk authored Oct 4, 2024
1 parent a776b3a commit 8e33c9e
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ jobs:
$modulePath = Join-Path $ENV:GITHUB_WORKSPACE "BcContainerHelper.psm1"
Import-Module $modulePath -DisableNameChecking
$labels = Get-BcContainerImageLabels -imageName 'mcr.microsoft.com/businesscentral:ltsc2022'
Set-Content -Path (Join-Path $path 'LatestGenericTagVersion.txt') -value $labels.tag
$functionsToExport = (get-module -Name BcContainerHelper).ExportedFunctions.Keys | Sort-Object
$aliasesToExport = (get-module -Name BcContainerHelper).ExportedAliases.Keys | Sort-Object
Expand Down
12 changes: 9 additions & 3 deletions ContainerHandling/New-NavContainer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,10 @@ try {

$isServerHost = $os.ProductType -eq 3

if ($os.BuildNumber -eq 22631) {
if ($os.BuildNumber -eq 26100) {
$hostOs = "24H2"
}
elseif ($os.BuildNumber -eq 22631) {
$hostOs = "23H2"
}
elseif ($os.BuildNumber -eq 22621) {
Expand Down Expand Up @@ -781,7 +784,7 @@ try {
$imageName = $bestImageName
if ($artifactUrl) {
$genericTagVersion = [Version](Get-BcContainerGenericTag -containerOrImageName $imageName)
if ($genericTagVersion -lt [Version]"1.0.2.20") {
if ($genericTagVersion -lt [Version]$LatestGenericTagVersion) {
Write-Host "Generic image is version $genericTagVersion - pulling a newer image"
$pullit = $true
}
Expand Down Expand Up @@ -1310,7 +1313,7 @@ try {
}
Write-Host "Using $isolation isolation"

if ($isolation -eq "process" -and !$isServerHost -and ($os.BuildNumber -eq 22621 -or $os.BuildNumber -eq 22631) -and $useSSL) {
if ($isolation -eq "process" -and !$isServerHost -and ($os.BuildNumber -eq 22621 -or $os.BuildNumber -eq 22631 -or $os.BuildNumber -eq 26100) -and $useSSL) {
Write-Host -ForegroundColor Red "WARNING: Using SSL when running Windows 11 with process isolation might not work due to a bug in Windows 11. Please use HyperV isolation or disable SSL."
}

Expand Down Expand Up @@ -1566,6 +1569,9 @@ try {
$AadTenantId = $AadTenant
if (!$AadTenantId) { $AadTenantId = "Common" }
$customWebSettings += @("AadApplicationId=$AadAppId","AadAuthorityUri=https://login.microsoftonline.com/$AADTenantId")
if ($version.Major -ge 25) {
$customWebSettings += @("AadValidAudience=https://api.businesscentral.dynamics.com")
}
}
}

Expand Down
5 changes: 4 additions & 1 deletion ContainerHandling/New-NavImage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@ try {
$baseImage = $bestGenericImageName
}

if ($os.BuildNumber -eq 22631) {
if ($os.BuildNumber -eq 26100) {
$hostOs = "24H2"
}
elseif ($os.BuildNumber -eq 22631) {
$hostOs = "23H2"
}
elseif ($os.BuildNumber -eq 22621) {
Expand Down
2 changes: 1 addition & 1 deletion HelperFunctions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@ function GetAppInfo {
"application" = "$(if($manifest.PSObject.Properties.Name -eq 'application'){$manifest.application})"
"platform" = "$(if($manifest.PSObject.Properties.Name -eq 'platform'){$manifest.Platform})"
"propagateDependencies" = ($manifest.PSObject.Properties.Name -eq 'PropagateDependencies') -and $manifest.PropagateDependencies
"dependencies" = @(if($manifest.PSObject.Properties.Name -eq 'dependencies'){$manifest.dependencies | ForEach-Object { @{ "id" = $_.id; "name" = $_.name; "publisher" = $_.publisher; "version" = $_.version }}})
"dependencies" = @(if($manifest.PSObject.Properties.Name -eq 'dependencies'){$manifest.dependencies | ForEach-Object { if ($_.PSObject.Properties.Name -eq 'id') { $id = $_.id } else { $id = $_.AppId }; @{ "id" = $id; "name" = $_.name; "publisher" = $_.publisher; "version" = $_.version }}})
}
Write-Host " (succeeded using altool)"
}
Expand Down
3 changes: 2 additions & 1 deletion InitializeModule.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ else {
$isAdministrator = ((id -u) -eq 0)
}

$BcContainerHelperVersion = Get-Content (Join-Path $PSScriptRoot "Version.txt")
$BcContainerHelperVersion = (Get-Content (Join-Path $PSScriptRoot "Version.txt")).Trim()
$LatestGenericTagVersion = (Get-Content (Join-Path $PSScriptRoot "LatestGenericTagVersion.txt")).Trim()
if (!$silent) {
Write-Host "$($moduleName.SubString(0,$moduleName.Length-5)) version $BcContainerHelperVersion"
}
Expand Down
1 change: 1 addition & 0 deletions LatestGenericTagVersion.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0.2.46
6 changes: 6 additions & 0 deletions ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
6.0.26
As minimum, always use the generic tag version which was available when shipping BcContainerHelper
Add awareness of Windows 11 24H2
Issue #3697 Running tests fails with 401 when running on a BC25 sandbox container with AAD authentication
Issue #3701 Compile-AppWithBcCompilerFolder, ALTool returns dependencies.appId for older apps

6.0.25
Fix issue where generateDependencyArtifact doesn't result in dependencies if useCompilerFolder is true or filesonly containers are used in Run-AlPipeline
Issue 3686 PowerShell container shortcuts for >= BC24 using wrong PowerShell version
Expand Down
2 changes: 1 addition & 1 deletion Version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.0.25-dev
6.0.26-dev

0 comments on commit 8e33c9e

Please sign in to comment.