HodorNV / ALOps

ALOps
59 stars 24 forks source link

Exception occured reading json #343

Closed Arthurvdv closed 3 years ago

Arthurvdv commented 3 years ago

Describe the bug My bad; I've made a horrable typo in the settings.json file (comma on the last line should not be there). But the compile-step should also fail and not mark as succesfull?

the used yaml

parameters:
  artifactversion: ''
  artifacttype: 'Sandbox'
  artifactcountry: 'W1'
  versionselect: ''
  ruleset: ''
  appversiontemplate: '1.0.[yyyyWW].*'
  alcodeanalyzer: 'UICop,CodeCop,PerTenantExtensionCop'
  failonwarnings: true
  publishartifact: true
  sastoken: ''
  sign_app: false
  pfx_path: ''
  pfx_password: ''
  timestamp_uri: 'http://timestamp.digicert.com'

steps:
- task: ALOpsAppCompiler@2
  displayName: 'Compile Extension'
  inputs:
    artifactversion: '${{ parameters.artifactversion }}'
    artifacttype: '${{ parameters.artifacttype }}'
    artifactcountry: '${{ parameters.artifactcountry }}'
    versionselect: ${{ parameters.versionselect }}
    alsourcepath: '$(System.DefaultWorkingDirectory)\app'
    ruleset: '${{ parameters.ruleset }}'
    appversiontemplate: '${{ parameters.appversiontemplate }}'
    alcodeanalyzer: '${{ parameters.alcodeanalyzer }}'
    failonwarnings: '${{ parameters.failonwarnings }}'
    ${{ if ne(parameters.sign_app, 'true') }}:
      publishartifact: ${{ parameters.publishartifact }}
    sastoken: '${{ parameters.sastoken }}'

- task: ALOpsAppSign@1
  displayName: 'Sign Extension'
  condition: and(succeeded(), eq('${{ parameters.publishartifact }}', 'true'), eq('${{ parameters.sign_app }}', 'true'))
  inputs:
    pfx_path: '${{ parameters.pfx_path }}'
    timestamp_uri: '${{ parameters.timestamp_uri }}'
    pfx_password: '${{ parameters.pfx_password }}'

the output Also the complete output is necessary for us to see what is going on. Also use backtics:

2021-03-12T07:02:21.8770962Z ##[section]Starting: Compile Extension
2021-03-12T07:02:21.8909328Z ==============================================================================
2021-03-12T07:02:21.8909704Z Task         : ALOps App Compiler
2021-03-12T07:02:21.8910036Z Description  : Compile AL Extension(s) for Business Central
2021-03-12T07:02:21.8910315Z Version      : 2.0.2367
2021-03-12T07:02:21.8910547Z Author       : Hodor
2021-03-12T07:02:21.8910865Z Help         : Compile Business Central extension(s) from AL code.
2021-03-12T07:02:21.8911244Z ==============================================================================
2021-03-12T07:02:23.1743377Z ******************************************************************************
2021-03-12T07:02:23.1744389Z *** ALOps v2 - Preview                                                     ***
2021-03-12T07:02:23.1750552Z ******************************************************************************
2021-03-12T07:02:23.1755854Z *** Importing required ALOps-Functions
2021-03-12T07:02:23.4837885Z *** Task Inputs:
2021-03-12T07:02:23.4890413Z 
2021-03-12T07:02:23.4958334Z name                value                                                                                              
2021-03-12T07:02:23.4960678Z ----                -----                                                                                              
2021-03-12T07:02:23.4962191Z artifactversion                                                                                                        
2021-03-12T07:02:23.4963686Z artifacttype        Sandbox                                                                                            
2021-03-12T07:02:23.4965137Z artifactcountry     W1                                                                                                 
2021-03-12T07:02:23.4966608Z versionselect                                                                                                          
2021-03-12T07:02:23.4968135Z alternativevsixurl                                                                                                     
2021-03-12T07:02:23.4972177Z alsourcepath        D:\azure-vsts-agent-build\_work\21\s\app                                                           
2021-03-12T07:02:23.5006213Z ruleset             https://vrabadevops.blob.core.windows.net/default/app.ruleset.json?sp=r&st=2021-01-29T19:05:04Z&...
2021-03-12T07:02:23.5007327Z appversiontemplate  ?.?.[yyyyWW].*                                                                                     
2021-03-12T07:02:23.5008054Z appfilenametemplate %APP_PUBLISHER%_%APP_NAME%_%APP_VERSION%_%BC_TYPE%_%BC_VERSION%_%BC_COUNTRY%.app                   
2021-03-12T07:02:23.5009954Z alcodeanalyzer      UICop,CodeCop,PerTenantExtensionCop                                                                
2021-03-12T07:02:23.5011076Z showmycode          Keep                                                                                               
2021-03-12T07:02:23.5011869Z alcachepath         D:\azure-vsts-agent-build\_work\21\s                                                               
2021-03-12T07:02:23.5013565Z publishartifact     True                                                                                               
2021-03-12T07:02:23.5015138Z publishxlif         False                                                                                              
2021-03-12T07:02:23.5016768Z failonwarnings      True                                                                                               
2021-03-12T07:02:23.5018729Z storageaccount                                                                                                         
2021-03-12T07:02:23.5020553Z sastoken                                                                                                               
2021-03-12T07:02:23.5021033Z 
2021-03-12T07:02:23.5037275Z 
2021-03-12T07:02:23.5046790Z 
2021-03-12T07:02:23.5189707Z *** For documentation, please visit   : https://www.alops.be/documentation
2021-03-12T07:02:23.5195182Z 
2021-03-12T07:02:23.9293084Z *** ALOps License:
2021-03-12T07:02:23.9297484Z   * Licensed To: Van Roey (Collection License)
2021-03-12T07:02:23.9478533Z 
2021-03-12T07:02:24.0927345Z *** Importing required Task-Functions
2021-03-12T07:02:25.6662262Z 
2021-03-12T07:02:25.7292465Z *** Artifact Type   : [Sandbox]
2021-03-12T07:02:25.7301329Z *** Artifact Version: []
2021-03-12T07:02:25.7307950Z *** Artifact Country: [W1]
2021-03-12T07:02:25.7313622Z *** AL Source Path  : [D:\azure-vsts-agent-build\_work\21\s\app]
2021-03-12T07:02:25.7333750Z *** AL Cache Path   : [D:\azure-vsts-agent-build\_work\21\s]
2021-03-12T07:02:25.7334700Z 
2021-03-12T07:02:25.7372267Z 
2021-03-12T07:02:25.7506811Z *** Default Working Folder: D:\azure-vsts-agent-build\_work\21\s
2021-03-12T07:02:25.7513454Z *** Artifact Folder       : D:\azure-vsts-agent-build\_work\21\a
2021-03-12T07:02:25.7519760Z *** Agent Tool Folder     : D:\azure-vsts-agent-build\_work\_tool
2021-03-12T07:02:25.7526805Z *** Agent Temp Folder     : D:\azure-vsts-agent-build\_work\_temp
2021-03-12T07:02:25.7528312Z 
2021-03-12T07:02:25.7562531Z *** Resolving Path: [D:\azure-vsts-agent-build\_work\21\s\app]
2021-03-12T07:02:25.7604588Z *** AL Source Folder      : D:\azure-vsts-agent-build\_work\21\s\app
2021-03-12T07:02:25.7614078Z *** Resolving Path: [D:\azure-vsts-agent-build\_work\21\s]
2021-03-12T07:02:25.7624295Z *** AL Cache Folder       : D:\azure-vsts-agent-build\_work\21\s
2021-03-12T07:02:25.7627745Z 
2021-03-12T07:02:25.7642487Z *** Check BcContainerHelper
2021-03-12T07:02:25.8329987Z *** Load BcContainerHelper
2021-03-12T07:02:26.0144750Z BcContainerHelper version 2.0.7
2021-03-12T07:02:26.6872339Z 
2021-03-12T07:02:26.6875923Z 
2021-03-12T07:02:26.6927359Z ##[command]"Get-BCArtifactUrl" 
2021-03-12T07:02:26.6928414Z Name                           Value                                                                                   
2021-03-12T07:02:26.6929531Z ----                           -----                                                                                   
2021-03-12T07:02:26.6930280Z country                        W1                                                                                      
2021-03-12T07:02:26.6931211Z type                           Sandbox                                                                                 
2021-03-12T07:02:26.6931513Z 
2021-03-12T07:02:26.6931614Z 
2021-03-12T07:02:26.6931899Z  -country: W1 -type: Sandbox
2021-03-12T07:02:37.7737872Z *** Platform: c:\bcartifacts.cache\sandbox\17.5.22499.23198\platform
2021-03-12T07:02:37.7755402Z *** Localisation: c:\bcartifacts.cache\sandbox\17.5.22499.23198\w1
2021-03-12T07:02:37.7880598Z *** BC Management DLL: C:\bcartifacts.cache\sandbox\17.5.22499.23198\platform\LegacyDlls\program files\Microsoft Dynamics NAV\170\RoleTailored Client\Microsoft.Dynamics.Nav.Management.dll
2021-03-12T07:02:37.8100537Z *** BC App Management DLL: C:\bcartifacts.cache\sandbox\17.5.22499.23198\platform\LegacyDlls\program files\Microsoft Dynamics NAV\170\RoleTailored Client\Microsoft.Dynamics.Nav.Apps.Management.dll
2021-03-12T07:02:37.8250357Z *** Get [*.app] and [app.json] files recursive from [D:\azure-vsts-agent-build\_work\21\s\app]
2021-03-12T07:02:37.8316110Z *** Found [1] file.
2021-03-12T07:02:37.8322084Z *** Extract App detail from [D:\azure-vsts-agent-build\_work\21\s\app\app.json]
2021-03-12T07:02:37.8504193Z *** Starting Batch compile of Apps:
2021-03-12T07:02:37.8532087Z   * D:\azure-vsts-agent-build\_work\21\s\app
2021-03-12T07:02:37.8542310Z *** Start Compiling: [D:\azure-vsts-agent-build\_work\21\s\app]
2021-03-12T07:02:37.9008803Z *** Get App Information
2021-03-12T07:02:37.9036081Z *** Loading Json Object: [D:\azure-vsts-agent-build\_work\21\s\app\app.json]
2021-03-12T07:02:37.9051730Z   * Id         : 45c0312f-eea8-4d76-b44d-3c13d885401c
2021-03-12T07:02:37.9057704Z   * Publisher  : VanRoey.be
2021-03-12T07:02:37.9070036Z   * Name       : EDS Archive
2021-03-12T07:02:37.9073964Z   * Description: Show and manages files in SharePoint.
2021-03-12T07:02:37.9190664Z *** Match: yyyyWW
2021-03-12T07:02:37.9271972Z *** Retaining original [Major] from version (?.0.0.0)
2021-03-12T07:02:37.9298877Z *** Retaining original [Minor] from version (0.?.0.0)
2021-03-12T07:02:37.9315556Z *** Setting Managed App Version [D:\azure-vsts-agent-build\_work\21\s\app\app.json] =>  0.7.202111.6839
2021-03-12T07:02:37.9389865Z *** VSCode Settings: [D:\azure-vsts-agent-build\_work\21\s\app\.vscode\settings.json]
2021-03-12T07:02:37.9398690Z *** VSCode-Settings json found.
2021-03-12T07:02:37.9406139Z *** Loading Json Object: [D:\azure-vsts-agent-build\_work\21\s\app\.vscode\settings.json]
2021-03-12T07:02:37.9455526Z *** Exception occured reading VSCode-Settings json. Content:
2021-03-12T07:02:37.9504724Z ##[error] Exception occured reading json [D:\azure-vsts-agent-build\_work\21\s\app\.vscode\settings.json]: Invalid JSON primitive: .
2021-03-12T07:02:37.9533494Z ModuleType Version Name              ExportedCommands                                                                  
2021-03-12T07:02:37.9538171Z ---------- ------- ----              ----------------                                                                  
2021-03-12T07:02:37.9560124Z Script     2.0.7   BcContainerHelper {Add-FontsToBcContainer, Add-GitToAlProjectFolder, Backup-BcContainerDatabases,...
2021-03-12T07:02:37.9560637Z {
2021-03-12T07:02:37.9561229Z     "al.enableCodeAnalysis": true,
2021-03-12T07:02:37.9562103Z     "al.codeAnalyzers": [
2021-03-12T07:02:37.9562889Z         "${CodeCop}",
2021-03-12T07:02:37.9563238Z         "${UICop}",
2021-03-12T07:02:37.9563793Z         "${AppSourceCop}"
2021-03-12T07:02:37.9564191Z     ],
2021-03-12T07:02:37.9565057Z     "al.ruleSetPath": "./.vscode/custom.ruleset.json",
2021-03-12T07:02:37.9565653Z     "al.defaultLaunchConfigurationName": "Your own server",
2021-03-12T07:02:37.9566193Z     "al.browser": "Edge",
2021-03-12T07:02:37.9566732Z     "alVarHelper.ignoreALPrefix": "BSF EDA ",
2021-03-12T07:02:37.9567773Z     "CRS.FileNamePattern": "<ObjectNameShort>.<ObjectTypeShortPascalCase>.al",
2021-03-12T07:02:37.9568488Z     "CRS.FileNamePatternExtensions": "<ObjectNameShort>.<ObjectTypeShortPascalCase>.al",
2021-03-12T07:02:37.9569565Z     "CRS.FileNamePatternPageCustomizations": "<ObjectNameShort>.<ObjectTypeShortPascalCase>.al",
2021-03-12T07:02:37.9570184Z     "CRS.ObjectNamePrefix": "BSF EDA ",
2021-03-12T07:02:37.9570707Z     "CRS.OnSaveAlFileAction": "Rename",
2021-03-12T07:02:37.9571252Z     "CRS.RemovePrefixFromFilename": true,
2021-03-12T07:02:37.9571761Z     "cSpell.enableFiletypes": [
2021-03-12T07:02:37.9572219Z         "al"
2021-03-12T07:02:37.9572622Z     ],
2021-03-12T07:02:37.9573070Z     "cSpell.language": "en,nl",
2021-03-12T07:02:37.9573505Z }
2021-03-12T07:02:37.9573789Z 
2021-03-12T07:02:37.9574041Z 
2021-03-12T07:02:38.0165654Z ##[section]Finishing: Compile Extension

Expected behavior The Compile step should Error.

Screenshots image

AdminHodor commented 3 years ago

Dear @Arthurvdv,

Please check out our latest release v1.441 which included this feature.

Kind regards,

Arthurvdv commented 3 years ago

Thanks!