microsoft / AL-Go

The plug-and-play DevOps solution for Business Central app development on GitHub
MIT License
302 stars 125 forks source link

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

Open ivandjordjevic opened 5 days ago

ivandjordjevic commented 5 days ago

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

ivandjordjevic commented 5 days ago

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

ivandjordjevic commented 19 hours ago

@freddydk - can you provide some guidance please?

freddydk commented 19 hours ago

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.