HodorNV / ALOps

ALOps
59 stars 24 forks source link

ALOpsAppCompiler extra Parameter: suppressWarnings #503

Closed Arthurvdv closed 2 years ago

Arthurvdv commented 2 years ago

Is your feature request related to a problem? Please describe. We've set up our pipelines with all kinds of CodeCops enabled. In the pipeline the ruleset parameter is used to provide a company-wide ruleset. The goal here is that all PTE and/or AppSource projects confirm to the same minimum quality enforced by these rules (next other mechanisms like code reviews). The suppressWarnings parameter in the app.json "throws a spanner in the works".

Describe the solution you'd like A overrule parameter in the ALOpsAppCompiler (and ALOpsAppCompilerV2): suppressWarnings with the options;

Describe alternatives you've considered Using custom PowerShell to archive this. For now my Use Case is to remove the property completely, because we use a custom ruleset in our pipeline. De feature description here is a more generic approach.

- task: PowerShell@2
  displayName: 'Verify app.json'
  condition: always()
  env:
    app_folder: '$(Build.SourcesDirectory)\App\'
  inputs:
    targetType: 'inline'
    script: |
      Write-Host "##[command]Search for 'suppressWarnings' in app.json"
      $obj = Get-Content (Join-Path $env:app_folder app.json) -Raw | ConvertFrom-Json

      if(-Not($obj.PSobject.Properties.name -match "suppressWarnings")) {
        Write-Host "##[command]No 'suppressWarnings' found in app.json"
        exit
      }

      Write-Host "##[command]Remove 'suppressWarnings' from app.json"
      $obj.PSObject.Properties.Remove('suppressWarnings')
      $obj | ConvertTo-Json | Set-Content (Join-Path $env:app_folder app.json)
waldo1001 commented 2 years ago

We'll put it on the list.

AdminHodor commented 2 years ago

v1.449: ALOpsAppCompiler: Extra parameter 'suppressWarnings' allows for overwriting in the app.json. Options: "KEEP","NONE", ""

@Arthurvdv Could you please validate if this works for you in our latest release?

Arthurvdv commented 2 years ago

Thanks, I will check next week and report back

Arthurvdv commented 2 years ago

Works perfect, thanks for adding this!