microsoft/AL-Go

[Bug]: Multi-Project Repository Test App Dependencies Not Resolved

ivandjordjevic opened this issue · 10 comments

AL-Go version

v6.1

Describe the issue

We are migrating from Azure DevOps to GitHub, consolidating 11 apps into a single repository where each app represents a separate project. Each project will include its main app and a corresponding test app. The repository has two levels of dependencies among projects in total.

Setting useProjectDependencies to true resolves dependencies for main apps across projects, however it fails to resolve and install test app dependencies.

For example, we have Projects P1 [app + test], P2 [app + test], and P0 [app + test], where both P1 and P2 depend on P0. During CICD, the main app dependency for P0 is correctly downloaded for P1 and P2, but the P0 test app dependency is missing. The "Downloaded dependencies test apps" log is empty for P1 and P2, resulting in test app compilation failures for dependent projects.

2024-11-27T11:13:36.9077118Z Downloaded dependencies: D:\a\test-sr365-core\test-sr365-core\.dependencies\thisbuild-sr365-platform-Apps\Sparkrock Inc._Platform_25.0.20.0.app
2024-11-27T11:13:36.9099509Z Downloaded dependencies apps: D:\a\test-sr365-core\test-sr365-core\.dependencies\thisbuild-sr365-platform-Apps\Sparkrock Inc._Platform_25.0.20.0.app
2024-11-27T11:13:36.9106376Z Downloaded dependencies test apps: 
2024-11-27T11:13:36.9347779Z Applying settings from D:\a\test-sr365-core\test-sr365-core\.github\AL-Go-Settings.json
2024-11-27T11:13:36.9366724Z No settings found in D:\a\test-sr365-core\test-sr365-core\.AL-Go\settings.json
2024-11-27T11:13:36.9377793Z No settings found in D:\a\test-sr365-core\test-sr365-core\.github\CICD.settings.json
2024-11-27T11:13:36.9388943Z No settings found in D:\a\test-sr365-core\test-sr365-core\.AL-Go\CICD.settings.json
2024-11-27T11:13:36.9400041Z No settings found in D:\a\test-sr365-core\test-sr365-core\.AL-Go\ivandjordjevic.settings.json
2024-11-27T11:13:36.9532876Z Enabling Microsoft telemetry...
2024-11-27T11:13:37.4947815Z ##[group]Run microsoft/AL-Go-Actions/RunPipeline@v6.1

Error Message:


Error Message: No apps to publish, StackTrace: at Publish-BcNuGetPackageToContainer, C:\ProgramData\BcContainerHelper\6.0.28\BcContainerHelper\NuGet\Publish-BcNuGetPackageToContainer.ps1: line 93 <- at <ScriptBlock>, D:\a\_actions\microsoft\AL-Go-Actions\v6.1\RunPipeline\RunPipeline.ps1: line 341 <- at <ScriptBlock>, D:\a\_actions\microsoft\AL-Go-Actions\v6.1\RunPipeline\RunPipeline.ps1: line 324 <- at <ScriptBlock>, C:\ProgramData\BcContainerHelper\6.0.28\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 1753 <- at <ScriptBlock>, C:\ProgramData\BcContainerHelper\6.0.28\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 1740 <- at <ScriptBlock>, C:\ProgramData\BcContainerHelper\6.0.28\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 1608 <- at <ScriptBlock>, C:\ProgramData\BcContainerHelper\6.0.28\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 1601 <- at <ScriptBlock>, C:\ProgramData\BcContainerHelper\6.0.28\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 1057 <- at Run-AlPipeline, C:\ProgramData\BcContainerHelper\6.0.28\BcContainerHelper\AppHandling\Run-AlPipeline.ps1: line 1019 <- at <ScriptBlock>, D:\a\_actions\microsoft\AL-Go-Actions\v6.1\RunPipeline\RunPipeline.ps1: line 395 <- at <ScriptBlock>, D:\a\_temp\62514675-713d-4ae8-888d-937846060a80.ps1: line 3 <- at <ScriptBlock>, D:\a\_actions\microsoft\AL-Go-Actions\v6.1\Invoke-AlGoAction.ps1: line 17 <- at <ScriptBlock>, D:\a\_temp\62514675-713d-4ae8-888d-937846060a80.ps1: line 2 <- at <ScriptBlock>, <No file>: line 1

Successful base project log:
platform-job-logs.txt

Failing dependent project error log:
Build sr365-finance-job-logs.txt

Expected behavior

The Test app is installed for dependent project allowing further compilation, installation and run for the Next Project Test App.

Steps to reproduce

  • Set up a multi-project repository with projects. Each project includes an app folder, a test folder, and a .AL-Go folder.
  • Define dependencies between apps in the app.json files
  • Set useProjectDependencies to true at the repository level in the AL-Go-Settings.json file.
  • Update system AL-Go files
  • Run the CICD pipeline
  • Get the error

If I set the doNotBuildTests to true, everything builds successfully.

@freddydk - can you provide some guidance please?

I will create a repro of this, but I am pretty sure that this is indeed a bug - the only dependencies carried over between projects are app dependencies - we would need to carry over test dependencies as well - and we probably need this for another feature as well.

@freddydk Is there going to be a fix any time soon, or we should look for workarounds?

I managed to do a repro here: https://github.com/BusinessCentralApps/buildorder/actions/runs/12230019393

I am not sure however that it is the same problem.
I have:

Project BO-IT contains 2 apps: IT and IT.Test
Project BO-W1 contains 2 apps: W1 and W1.Test
Project Common contains 3 apps: Common, Common.Test, Licensing

IT.Test (test app) depends on W1.Test (test app)
W1.Test (test app) depends on Common.Test (test app) - this app is not included (and not needed) when building IT.Test - but it is needed when publishing IT.Test to the container and here it cannot be found.

Is this the same problem you see?

@freddydk - yes, that is the scenario. Although, our pipeline failed at Installing test app dependencies step... :

Image

...where this one https://github.com/BusinessCentralApps/buildorder/actions/runs/12230019393 failed at 'Installing test apps'
Image

But it's for the very same reason I guess.

This is indeed a bug - but in BcContainerHelper.