AL-Go version
9.1
Describe the issue
When a project uses "workspaceCompilation": { "enabled": true }, the CompileApps action (CompileApps/Compile.ps1 + .Modules/CompileFromWorkspace.psm1) correctly disables the built-in code analyzers (CodeCop, AppSourceCop, PTECop, UICop) for test app and BCPT test app folders when enableCodeAnalyzersOnTestApps is false. However, it does not disable custom analyzers configured via customCodeCops for those same folders. As a result, custom analyzer DLLs keep running against test apps even though the setting says they shouldn't.
Expected behavior
With enableCodeAnalyzersOnTestApps: false, no analyzers (neither built-in cops nor custom cops) should run against testFolders / bcptTestFolders during compilation - matching the documented setting description ("the code analyzers will be enabled when building test apps as well") and the existing behavior of the classic Run-AlPipeline container pipeline.
Steps to reproduce
- Configure a project with
"customCodeCops": [ ... ] and "enableCodeAnalyzersOnTestApps": false (default).
- Enable
"workspaceCompilation": { "enabled": true } at the repo or project level.
- Add a test app folder (
testFolders) that would trigger one of the custom analyzer rules if it ran.
- Run CI/CD (or the
CompileApps action directly).
- Observe the custom analyzer diagnostic/warning/error still appears for the test app, even though
enableCodeAnalyzersOnTestApps is false.
Additional context (logs, screenshots, etc.)
Root cause (AI Driven - Sonnet 5)
CompileApps/Compile.ps1 (v9.1)
$buildParams = @{
...
Analyzers = (Get-CodeAnalyzers -Settings $settings)
CustomAnalyzers = (Get-CustomAnalyzers -Settings $settings -CompilerFolder $compilerFolder)
}
if ($testFoldersToBuild.Count -gt 0) {
if (-not ($settings.enableCodeAnalyzersOnTestApps)) {
$buildParams.Analyzers = @() # <-- only Analyzers is cleared
}
$testAppFiles = Build-AppsInWorkspace @buildParams -Folders $testFoldersToBuild -OutFolder $testAppOutputFolder -AppType 'testApp'
}
if ($bcptTestFoldersToBuild.Count -gt 0) {
if (-not ($settings.enableCodeAnalyzersOnTestApps)) {
$buildParams.Analyzers = @() # <-- same issue here
}
$bcptTestAppFiles = Build-AppsInWorkspace @buildParams -Folders $bcptTestFoldersToBuild -OutFolder $testAppOutputFolder -AppType 'bcptApp'
}
$buildParams.CustomAnalyzers is set once, before the app-folder compile step, and is never reset/cleared for the test or BCPT branches.
.Modules/CompileFromWorkspace.psm1 -> CompileAppsInWorkspace
Confirms CustomAnalyzers is passed straight through to alc.exe workspace compile ... --customanalyzers ... with no enableCodeAnalyzersOnTestApps awareness at all:
if ($CustomAnalyzers -and $CustomAnalyzers.Count -gt 0) {
$arguments += "--customanalyzers"
$arguments += ($CustomAnalyzers -join ",")
}
Suggested fix (AI Driven - Sonnet 5)
In CompileApps/Compile.ps1, when enableCodeAnalyzersOnTestApps is false, also clear $buildParams.CustomAnalyzers alongside $buildParams.Analyzers in both the testFoldersToBuild and bcptTestFoldersToBuild branches:
if (-not ($settings.enableCodeAnalyzersOnTestApps)) {
$buildParams.Analyzers = @()
$buildParams.CustomAnalyzers = @()
}
AL-Go version
9.1
Describe the issue
When a project uses
"workspaceCompilation": { "enabled": true }, theCompileAppsaction (CompileApps/Compile.ps1+.Modules/CompileFromWorkspace.psm1) correctly disables the built-in code analyzers (CodeCop, AppSourceCop, PTECop, UICop) for test app and BCPT test app folders whenenableCodeAnalyzersOnTestAppsisfalse. However, it does not disable custom analyzers configured viacustomCodeCopsfor those same folders. As a result, custom analyzer DLLs keep running against test apps even though the setting says they shouldn't.Expected behavior
With
enableCodeAnalyzersOnTestApps: false, no analyzers (neither built-in cops nor custom cops) should run againsttestFolders/bcptTestFoldersduring compilation - matching the documented setting description ("the code analyzers will be enabled when building test apps as well") and the existing behavior of the classicRun-AlPipelinecontainer pipeline.Steps to reproduce
"customCodeCops": [ ... ]and"enableCodeAnalyzersOnTestApps": false(default)."workspaceCompilation": { "enabled": true }at the repo or project level.testFolders) that would trigger one of the custom analyzer rules if it ran.CompileAppsaction directly).enableCodeAnalyzersOnTestAppsisfalse.Additional context (logs, screenshots, etc.)
Root cause (AI Driven - Sonnet 5)
CompileApps/Compile.ps1(v9.1)$buildParams.CustomAnalyzersis set once, before the app-folder compile step, and is never reset/cleared for the test or BCPT branches..Modules/CompileFromWorkspace.psm1->CompileAppsInWorkspaceConfirms
CustomAnalyzersis passed straight through toalc.exe workspace compile ... --customanalyzers ...with noenableCodeAnalyzersOnTestAppsawareness at all:Suggested fix (AI Driven - Sonnet 5)
In
CompileApps/Compile.ps1, whenenableCodeAnalyzersOnTestAppsisfalse, also clear$buildParams.CustomAnalyzersalongside$buildParams.Analyzersin both thetestFoldersToBuildandbcptTestFoldersToBuildbranches: