Skip to content

Fix issue 2267: appsourcecop.json is not created for testapps#2283

Open
spetersenms wants to merge 3 commits into
microsoft:mainfrom
spetersenms:spetersen/AppSourceCopFix
Open

Fix issue 2267: appsourcecop.json is not created for testapps#2283
spetersenms wants to merge 3 commits into
microsoft:mainfrom
spetersenms:spetersen/AppSourceCopFix

Conversation

@spetersenms

@spetersenms spetersenms commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

❔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

  • Add tests (E2E, unit tests)
  • Update RELEASENOTES.md
  • Update documentation (e.g. for new settings or scenarios)
  • Add telemetry

Copilot AI review requested due to automatic review settings June 17, 2026 08:53
@spetersenms spetersenms requested a review from a team as a code owner June 17, 2026 08:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-AppSourceCopJson to include testFolders and bcptTestFolders when code analyzers are enabled for test apps.

Comment thread Actions/CompileApps/Compile.ps1
Comment thread Actions/CompileApps/Compile.ps1
if ($settings.enableCodeAnalyzersOnTestApps) {
$appSourceCopFolders += @($settings.testFolders) + @($settings.bcptTestFolders)
}
New-AppSourceCopJson -AppFolders $appSourceCopFolders -BaselineApps $baselineApps -BaselinePackageCachePath $packageCachePath -CompilerFolder $compilerFolder -Settings $settings

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue exist in both places. Here is a PR for container helper: microsoft/navcontainerhelper#4163

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: appsourcecop.json is not created for testapps even if enableCodeAnalyzersOnTestApps=true

4 participants