Navcontainerhelper: Allow to succeed pipeline completely even with warnings

Created on 21 Mar 2021  路  13Comments  路  Source: microsoft/navcontainerhelper

Describe the issue
We are using the helloworld pte pipeline scripts to build our app on Azure DevOps Server(!). We do have some warnings in our app that will lead to a "SucceedWithIssues". The build it self shows an exclamation mark but the status on the branch or the repo itself will report the status as failed:
grafik
So it is annonying because you have to press on the build to see the real status. The linked release pipeline is triggered, so it is just a display "error". I don't know if the same problem exists for Azure DevOps Service.

Request
Would it be possible to introduce a new flag to Run-AlPipeline and Convert-ALCOutputToAzureDevOps? Maybe "warningsSucceedCompletely" with the default value of false?

Edit: I am even happy with an $env switch, if this is a problem on devops server only.

if (!$env:warningsSucceedCompletely) 
{
    $errLine = "##vso[task.complete result=SucceededWithIssues;]Succeeded With Issues."
}

Would you accept an PR for this?

PS: I already found at least two visual studio feedback entries for this "problem" (e.g. this one) but they were closed and considerd a "feature request".

All 13 comments

I think it is important to realize that pipelines succeeding with warnings means that this pipeline will fail during the next 12 months if you do not fix the issues.
I think the proper solution would be to fix the issues instead of ignoring them.

Lets say we create a feature to ignore them, then your pipeline will not warn you about obsoleted things before they are removed - then you are suddenly in a hurry...

Is that really what you want?

We are currently not developing for AppSource and only develop for on-premise, so we are in control of the "obsoleting".
Currently we are upgrading a customers old NAV to BC and getting warnings for the new price engine and the item reference feature. We won't implement them for this customer in the near future.

Are you using the new (Run-AlPipeline) or the old HelloWorld template?

I copied almost everything from here: https://dev.azure.com/businesscentralapps/_git/HelloWorld
That's the new Run-AlPipeline template, right?

Yes,
Could you copy/paste the warnings you are getting here?

That's not all of them, but a subset will do, right?

...
##[warning]c:\sources\src\Report\*****.Report.al(202,70): warning AL0432: Field 'Cross-Reference No.' is marked for removal. Reason: Cross-Reference replaced by Item Reference feature.. Tag: 17.0.
##[warning]c:\sources\src\Report\*****.Report.al(303,80): warning AL0432: Field 'Cross-Reference No.' is marked for removal. Reason: Cross-Reference replaced by Item Reference feature.. Tag: 17.0.
##[warning]c:\sources\src\Page\*****.Page.al(102,50): warning AL0432: Page 'Cross Reference List' is marked for removal. Reason: Replaced by Item Reference feature.. Tag: 17.0.
##[warning]c:\sources\src\Page\*****.Page.al(147,50): warning AL0432: Page 'Cross Reference List' is marked for removal. Reason: Replaced by Item Reference feature.. Tag: 17.0.
##[warning]c:\sources\src\Codeunit\*****.Codeunit.al(1063,32): warning AL0432: Codeunit 'Sales Price Calc. Mgt.' is marked for removal. Reason: Replaced by the new implementation (V16) of price calculation.. Tag: 16.0.
##[warning]c:\sources\src\Page\*****.Page.al(141,50): warning AL0432: Page 'Cross Reference List' is marked for removal. Reason: Replaced by Item Reference feature.. Tag: 17.0.
##[warning]c:\sources\src\Page\*****.Page.al(548,44): warning AL0432: Table 'Sales Price' is marked for removal. Reason: Replaced by the new implementation (V16) of price calculation.. Tag: 16.0.
##[warning]c:\sources\src\PageExt\pageextension50009.Whse. Shipment Subform.PageExt.al(108,45): warning AL0432: Field 'Cross-Reference No.' is marked for removal. Reason: Cross-Reference replaced by Item Reference feature.. Tag: 17.0.
##[warning]c:\sources\src\PageExt\pageextension50009.Whse. Shipment Subform.PageExt.al(122,53): warning AL0432: Field 'Cross-Reference No.' is marked for removal. Reason: Cross-Reference replaced by Item Reference feature.. Tag: 17.0.
##[warning]c:\sources\src\Page\*****.Page.al(479,42): warning AL0432: Field 'Cross-Reference No.' is marked for removal. Reason: Cross-Reference replaced by Item Reference feature.. Tag: 17.0.
##[warning]c:\sources\src\Page\*****.Page.al(481,94): warning AL0432: Field 'Cross-Reference No.' is marked for removal. Reason: Cross-Reference replaced by Item Reference feature.. Tag: 17.0.
##[warning]c:\sources\src\Page\*****.Page.al(551,45): warning AL0432: Page 'Sales Prices' is marked for removal. Reason: Replaced by the new implementation (V16) of price calculation.. Tag: 16.0.
##[warning]c:\sources\src\PageExt\pageextension50010.Posted Whse. Shipment Subform.PageExt.al(69,45): warning AL0432: Field 'Cross-Reference No.' is marked for removal. Reason: Cross-Reference replaced by Item Reference feature.. Tag: 17.0.
##[warning]c:\sources\src\PageExt\pageextension50010.Posted Whse. Shipment Subform.PageExt.al(85,53): warning AL0432: Field 'Cross-Reference No.' is marked for removal. Reason: Cross-Reference replaced by Item Reference feature.. Tag: 17.0.
##[warning]c:\sources\src\Page\*****.Page.al(52,60): warning AL0432: Method 'OpenFileDialog' is marked for removal. Reason: The local file system is no longer accessible. Please use the UploadFile procedure.. Tag: 17.3.
##[warning]c:\sources\src\Page\*****.Page.al(118,63): warning AL0432: Method 'OpenFileDialog' is marked for removal. Reason: The local file system is no longer accessible. Please use the UploadFile procedure.. Tag: 17.3.
##[warning]c:\sources\src\Page\*****.Page.al(1168,26): warning AL0432: Field 'Cross-Reference No.' is marked for removal. Reason: Cross-Reference replaced by Item Reference feature.. Tag: 17.0.
##[warning]c:\sources\src\Page\*****.Page.al(1170,78): warning AL0432: Field 'Cross-Reference No.' is marked for removal. Reason: Cross-Reference replaced by Item Reference feature.. Tag: 17.0.
...

Thanks, will check what the right approach is

Did you try to create a rulesetfile and disable AL0432?

something like:

{
    "description": "My ruleset",
    "name": "My rules",
    "rules": [
        {
            "id": "AL0432",
            "action": "Hidden",
            "justification": "Ignore things marked for removal."
        }
    ]
}

Not sure whether that works though.

Oops, didn't think about this one. I will give it a try, but I would appreciate if I could still see the warnings in the build.
Edit: Not for this customer, but for our base app. So the developers get reminded to fix this at some time.

You could probably also just set -failOn to "none" on Run-AlPipeline

I did add the -rulesetFile parameter with a special pipeline ruleset file, so it is just hidden on the pipeline.
The developers still see the warnings in their vs code.

You could probably also just set -failOn to "none" on Run-AlPipeline

But then I wouldn't catch any compiler errors either. This is bad for our build validation.

I think we can close this issue.

Just FYI, -failOn "none" would still fail the pipeline if the app doesn't get created.

Was this page helpful?
0 / 5 - 0 ratings