Hey Nic/team, please excuse the ai-generated template response, but I think it's done a more thorough job than I could have in my tiredness... happy to provide more detail (i.e. relevant yml excerpt for my github action) if that'll be helpful. Essentially, the TL;DR is: SF JIT plugin installation of code-analyzer is causing issues on parallel runs, mitigated by using the argument PARALLEL_PROCESS_NUMBER=1, but that has implications for all other linters running.
Describe the bug
When running MegaLinter Salesforce flavor in GitHub Actions with Salesforce code-analyzer descriptors enabled (code-analyzer-apex, code-analyzer-aura, code-analyzer-lwc), descriptor execution is intermittently flaky due to plugin install/runtime errors.
This appears to be related to parallel execution and shared SF plugin path state, not actual code violations.
To Reproduce
Configure a GitHub Actions workflow to run:
oxsecurity/megalinter/flavors/salesforce@beta
PULL_REQUEST: true
VALIDATE_ALL_CODEBASE: false
Ensure Salesforce code-analyzer descriptors are enabled (default for this flavor at beta).
Run on ubuntu-latest against a PR with Salesforce metadata (Apex/LWC/Aura files present in repo is sufficient).
Observe intermittent errors in one or more Salesforce descriptors, while others may pass in the same run.
Re-run the same workflow; failing descriptor may change (apex/lwc/aura), indicating nondeterministic behavior.
Expected behavior
Salesforce code-analyzer descriptors should run reliably and report only analyzer findings.
No plugin installation corruption/module resolution errors should occur.
Screenshots
N/A (log excerpts below)
Additional context
Observed error patterns include:
ENOENT in .../node_modules/@salesforce/plugin-code-analyzer/...
MODULE_NOT_FOUND referencing @salesforce/sf-plugins-core
TAR_ENTRY_ERROR ENOENT ...
JitPluginInstallError: Could not install @salesforce/plugin-code-analyzer
Important signal:
Failing runs log: Processing linters on [2] parallel cores
After setting PARALLEL_PROCESS_NUMBER=1, logs show Processing linters on [1] parallel cores and Apex/Aura/LWC descriptors complete successfully.
This suggests parallel execution contention on shared SF plugin install path (/github/home/.local/share/sf/node_modules/@salesforce/plugin-code-analyzer) during JIT plugin install/use.
Potential fix directions:
serialize Salesforce code-analyzer descriptors by default, or
isolate plugin install directories per descriptor/run.
Hey Nic/team, please excuse the ai-generated template response, but I think it's done a more thorough job than I could have in my tiredness... happy to provide more detail (i.e. relevant yml excerpt for my github action) if that'll be helpful. Essentially, the TL;DR is: SF JIT plugin installation of code-analyzer is causing issues on parallel runs, mitigated by using the argument PARALLEL_PROCESS_NUMBER=1, but that has implications for all other linters running.
Describe the bug
When running MegaLinter Salesforce flavor in GitHub Actions with Salesforce code-analyzer descriptors enabled (code-analyzer-apex, code-analyzer-aura, code-analyzer-lwc), descriptor execution is intermittently flaky due to plugin install/runtime errors.
This appears to be related to parallel execution and shared SF plugin path state, not actual code violations.
To Reproduce
Configure a GitHub Actions workflow to run:
oxsecurity/megalinter/flavors/salesforce@beta
PULL_REQUEST: true
VALIDATE_ALL_CODEBASE: false
Ensure Salesforce code-analyzer descriptors are enabled (default for this flavor at beta).
Run on ubuntu-latest against a PR with Salesforce metadata (Apex/LWC/Aura files present in repo is sufficient).
Observe intermittent errors in one or more Salesforce descriptors, while others may pass in the same run.
Re-run the same workflow; failing descriptor may change (apex/lwc/aura), indicating nondeterministic behavior.
Expected behavior
Salesforce code-analyzer descriptors should run reliably and report only analyzer findings.
No plugin installation corruption/module resolution errors should occur.
Screenshots
N/A (log excerpts below)
Additional context
Observed error patterns include:
ENOENT in .../node_modules/@salesforce/plugin-code-analyzer/...
MODULE_NOT_FOUND referencing @salesforce/sf-plugins-core
TAR_ENTRY_ERROR ENOENT ...
JitPluginInstallError: Could not install @salesforce/plugin-code-analyzer
Important signal:
Failing runs log: Processing linters on [2] parallel cores
After setting PARALLEL_PROCESS_NUMBER=1, logs show Processing linters on [1] parallel cores and Apex/Aura/LWC descriptors complete successfully.
This suggests parallel execution contention on shared SF plugin install path (/github/home/.local/share/sf/node_modules/@salesforce/plugin-code-analyzer) during JIT plugin install/use.
Potential fix directions:
serialize Salesforce code-analyzer descriptors by default, or
isolate plugin install directories per descriptor/run.