Skip to content

Resolve relative customCodeCops paths in workspace compilation#2239

Merged
aholstrup1 merged 3 commits intomainfrom
aholstrup1/issue-2235-bug-pipelineinitialize-ps1-is-not-execu-08c550
May 6, 2026
Merged

Resolve relative customCodeCops paths in workspace compilation#2239
aholstrup1 merged 3 commits intomainfrom
aholstrup1/issue-2235-bug-pipelineinitialize-ps1-is-not-execu-08c550

Conversation

@aholstrup1
Copy link
Copy Markdown
Collaborator

❔What, Why & How

Get-CustomAnalyzers now resolves relative customCodeCops entries to absolute paths against the project folder before they are passed to altool workspace compile.

altool only resolves the first comma-separated --customanalyzers entry to absolute when dispatching alc.exe; the rest stayed relative and alc.exe resolved them against the per-app project folder, where .alcops did not exist — yielding AL1006 errors for every analyzer except the first. URL entries and already-rooted paths are unchanged. The non-workspace Run-AlPipeline path is untouched.

Note: the issue title was about PipelineInitialize.ps1 not firing under workspace compilation. That part is by design — PipelineInitialize is a Run-AlPipeline lifecycle hook. The right hook for compile-time setup with workspace compilation is PreCompileApp.ps1. Once users switch to PreCompileApp.ps1, this fix unblocks the multi-analyzer scenario.

Related to issue: #2235

✅ Checklist

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

…ation

altool's workspace compile only resolves the first comma-separated --customanalyzers entry to an absolute path when dispatching alc.exe; the remaining entries stay relative and alc.exe resolves them against the per-app project folder where '.alcops' does not exist, yielding AL1006 errors.

Resolve relative entries against the project folder up front in Get-CustomAnalyzers so altool always receives rooted paths.
Copilot AI review requested due to automatic review settings May 5, 2026 16:33
@aholstrup1 aholstrup1 requested a review from a team as a code owner May 5, 2026 16:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 so multiple relative customCodeCops entries are resolved consistently before being passed to altool. It fits into AL-Go’s workspace compilation path by correcting how custom analyzer DLL paths are prepared for the compiler.

Changes:

  • Updated Get-CustomAnalyzers to convert relative analyzer paths to absolute paths based on the project folder.
  • Added unit tests covering rooted paths, relative paths, missing files, and default project-folder behavior.
  • Added a release note for issue #2235.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
Actions/.Modules/CompileFromWorkspace.psm1 Implements project-folder resolution for relative customCodeCops entries and updates function help text.
Tests/CompileFromWorkspace.Test.ps1 Adds coverage for rooted, relative, and deferred analyzer-path resolution scenarios.
RELEASENOTES.md Documents the workspace compilation fix for multi-analyzer relative paths.

Comment thread Actions/.Modules/CompileFromWorkspace.psm1
@aholstrup1 aholstrup1 enabled auto-merge (squash) May 6, 2026 11:11
@aholstrup1 aholstrup1 merged commit a53b9be into main May 6, 2026
8 checks passed
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.

4 participants