HodorNV / ALOps

ALOps
55 stars 24 forks source link

Loading LinterCop fails when using ALOps Compile #762

Closed epernst closed 1 month ago

epernst commented 1 month ago

Describe the bug When using custom codecop LinterCop, then it fails to run any code cops: warning AL1003: An instance of analyzer BusinessCentral.LinterCop.Design.Rule0001FlowFieldsShouldNotBeEditable cannot be created from C:\bcartifacts.cache\onprem\14.44.49619.0\vsix\extension\bin\Analyzers\BusinessCentral.LinterCop.dll

Before BC v24 was released this worked fine, but now we are getting this on all builds, no matter which BC version. Our own scripts using Compile-AppInBcContainer works fine.

We download the LinterCop.dll using their script in a previous step.

the used yaml

Starting: Compile USTC Foundation
==============================================================================
Task         : ALOps App Compiler
Description  : Compile AL Extension(s) for Business Central
Version      : 2.0.6120
Author       : Hodor
Help         : Compile Business Central extension(s) from AL code.
==============================================================================
##[debug]VstsTaskSdk 0.11.0 commit 7ff27a3e0bdd6f7b06690ae5f5b63cb84d0f23f4
##[debug]INPUT_PWSH (empty)
##[debug] Converted to bool: False
##[debug]INPUT_USEDOCKER (empty)
##[debug] Converted to bool: False
##[debug]Entering C:\a\_tasks\ALOpsAppCompiler_6ccb97e4-cd3b-4f5c-82d0-3b733949d45d\2.0.6120\ddd76ae9-94a1-46d3-955a-df2aba8723bd.ps1.
******************************************************************************
*** ALOps v2 - Preview                                                     ***
******************************************************************************
##[debug]INPUT_SASTOKEN (empty)
##[debug]Processed: ##vso[task.setvariable variable=sastoken_secret;issecret=true]
*** Importing required ALOps-Functions
##[debug]INPUT_ARTIFACTVERSION: '23.4.15643.15715'
##[debug]INPUT_ARTIFACTTYPE: 'OnPrem'
##[debug]INPUT_ARTIFACTCOUNTRY: 'w1'
##[debug]INPUT_VERSIONSELECT: 'Latest'
##[debug]INPUT_ALTERNATIVEARTIFACTURL (empty)
##[debug]INPUT_ALTERNATIVEVSIXURL: 'Latest'
##[debug]INPUT_ALSOURCEPATH: 'C:\a\3\s\Apps\App'
##[debug]INPUT_RULESET: 'C:\a\3\s\Apps\App\rules\general.ruleset.json'
##[debug]INPUT_SUPPRESSWARNINGS: 'KEEP'
##[debug]INPUT_APPVERSIONTEMPLATE: '23.4.0.*'
##[debug]INPUT_UPDATEBUILDNUMBER: 'false'
##[debug] Converted to bool: False
##[debug]INPUT_APPFILENAMETEMPLATE: '%APP_PUBLISHER%_%APP_NAME%_%APP_VERSION%_%BC_TYPE%_%BC_VERSION%_%BC_COUNTRY%.app'
##[debug]INPUT_ALCODEANALYZER: 'CodeCop,AppSourceCop,UICop,PerTenantExtensionCop,BusinessCentral.LinterCop.dll'

Later it writes that it found the DLL:
*** Searching CodeCop: BusinessCentral.LinterCop.dll
*** CodeCop not found in 'Analyzers' folder, searching WorkingFolder
*** CodeCop [BusinessCentral.LinterCop.dll] found in WorkingFolder, copying to 'Analyzers' folder. 
*** Codecop found: C:\a\_temp\vsix\custom\extension\bin\Analyzers\BusinessCentral.LinterCop.dll

https://github.com/StefanMaron/BusinessCentral.LinterCop/issues/580

waldo1001 commented 1 month ago

@epernst , can you please provide a full yaml with repro steps?

epernst commented 1 month ago

@waldo1001, I have sent the Yaml and full task it to your support. But not a 100% full repo, as we depend on other internal apps and scripts. If that's not enough, then let me know.

waldo1001 commented 1 month ago

Found it, but it's not helpful. It's a super complicated pipeline, full of custom powershell, variables, filled by scripts - but doesn't pinpoint your problem at all. It would be awesome you could share a yaml that isolates the problems:

epernst commented 1 month ago

I just created a simpler repo pipeline (without any external scripts or artifacts), but I could not recreate the errors.

Then I ran some of our other failing pipelines again, and it seems that the issue somehow was fixed Friday! We didn't run anything yesterday, as this was a holiday here in Denmark.

I'm not sure if ALops or LinterCop was updated, or what else happened. But not getting any compile errors or warnings, except the ones we expect.

waldo1001 commented 1 month ago

ALOps wasn't updated. Like Arthur mentioned in the other post - it just kept working. That's why I was pushing for a repro ;-).

I'll close the issue.