Fix issue 2267: appsourcecop.json is not created for testapps#2283
Fix issue 2267: appsourcecop.json is not created for testapps#2283spetersenms wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes workspace-compilation failures for test/BCPT apps when AppSourceCop is enabled by ensuring AppSourceCop.json is generated for test app folders as well (when enableCodeAnalyzersOnTestApps=true), aligning the configuration generation with analyzer execution.
Changes:
- Extend the folder list passed to
New-AppSourceCopJsonto includetestFoldersandbcptTestFolderswhen code analyzers are enabled for test apps.
| if ($settings.enableCodeAnalyzersOnTestApps) { | ||
| $appSourceCopFolders += @($settings.testFolders) + @($settings.bcptTestFolders) | ||
| } | ||
| New-AppSourceCopJson -AppFolders $appSourceCopFolders -BaselineApps $baselineApps -BaselinePackageCachePath $packageCachePath -CompilerFolder $compilerFolder -Settings $settings |
There was a problem hiding this comment.
This would only modify the logic when workspace compilation is enabled. From the logs in the linked issue it seems like that is not the case in their build. In their case the compilation seems to happen as part of Run-ALPipeline
There was a problem hiding this comment.
There was a problem hiding this comment.
The issue exist in both places. Here is a PR for container helper: microsoft/navcontainerhelper#4163
❔What, Why & How
In the workspace compilation action, the AppSourceCop analyzer was applied to test/bcpt apps when enableCodeAnalyzersOnTestApps was set, but New-AppSourceCopJson was only called for app folders. This caused test apps to fail with AS0054.
Related to issue: #2267
✅ Checklist