microsoft / navcontainerhelper

Official Microsoft repository for BcContainerHelper, a PowerShell module, which makes it easier to work with Business Central Containers on Docker.
MIT License
385 stars 247 forks source link

Run-AlPipeline and AppSource validation #2140

Closed moprsal closed 3 years ago

moprsal commented 3 years ago

PLEASE DO NOT INCLUDE ANY PASSWORDS OR TOKENS IN YOUR ISSUE!!!

Describe the issue I ran script Run-AlPipeline with the links to old and new version of an extension. Because of BC19, we had to replace Record TempBlob with codeunit implementation we've changed parameters of several functions and it looks that it cause the issue below. Below is the part of output from Run-AlPipeline and also Application Insight says similar error when we publish it into AppSource.

c:\sources\AppSourceCode\Codeunits\Import Wizard Management.al(85,15): error AS0024: The number of parameters in the external procedure 'SelectFile' has changed from '2' to '3'. This will break dependent extensions.
c:\sources\AppSourceCode\Codeunits\Import Wizard Management.al(73,15): error AS0024: The number of parameters in the external procedure 'SelectFile' has changed from '3' to '2'. This will break dependent extensions.

It looks like that the script doesn't match the old and new function correctly.

Scripts used to create container and cause the issue

 Run-AlPipeline -pipelineName 'Name' -licenseFile 'XXX.flf' -baseFolder 'C:\...\_work\r3\a' -appFolders @('SourceCode') -testFolders @() -installApps C:\..\AnotherCertifiedApplication.app -previousApps @('C:\..\OldVersionOfApplication.app') -doNotRunTests:$False -installTestFramework:$False -testResultsFormat 'XUnit' -enableAppSourceCop -AppSourceCopMandatoryAffixes 'XXX'

Full output of scripts Error list from Run-AlPipeline:

c:\sources\AppSourceCode\Codeunits\Import Wizard Management.al(73,15): error AS0026: The type or subtype of 'TempBlob' has been modified from 'Record TempBlob' to 'Codeunit "Temp Blob"'. This is not allowed in events and external procedures because it will break dependent extensions.
c:\sources\AppSourceCode\Codeunits\Import Wizard Management.al(85,15): error AS0024: The number of parameters in the external procedure 'SelectFile' has changed from '2' to '3'. This will break dependent extensions.
c:\sources\AppSourceCode\Codeunits\Import Wizard Management.al(73,15): error AS0024: The number of parameters in the external procedure 'SelectFile' has changed from '3' to '2'. This will break dependent extensions.
c:\sources\AppSourceCode\Codeunits\Import Wizard Management.al(85,15): error AS0026: The type or subtype of 'TempBlob' has been modified from 'Record TempBlob' to 'Codeunit "Temp Blob"'. This is not allowed in events and external procedures because it will break dependent extensions.
c:\sources\AppSourceCode\Codeunits\Import Wizard Management.al(132,21): error AS0026: The type or subtype of '_FileContent' has been modified from 'Record TempBlob' to 'Codeunit "Temp Blob"'. This is not allowed in events and external procedures because it will break dependent extensions.
c:\sources\AppSourceCode\Codeunits\Excel\Excel Management.al(59,15): error AS0026: The type or subtype of 'ExcelBlob' has been modified from 'Record TempBlob' to 'Codeunit "Temp Blob"'. This is not allowed in events and external procedures because it will break dependent extensions.

Output in Partner Center. I believe that you have also these logs available, so I keep here the identification of validation.

The validation of the submission failed for 64 out of 420 tasks. In Azure portal, go to the Application Insights resource instrumented by the key 'XXX', and search for the validationRequestId '37a8b7b7-3aa0-472e-8b6a-ecc103ac47e0'. For example, use: traces | where customDimensions.validationRequestId == '37a8b7b7-3aa0-472e-8b6a-ecc103ac47e0' or use the validationRequestId in the Troubleshooting Guide (TSG) available at https://go.microsoft.com/fwlink/?linkid=2172328. For more information about the signals, see https://go.microsoft.com/fwlink/?linkid=2168919.

Screenshots New version:

procedure SelectFile(var _Import: Record "XXX Import"; var TempBlob: Codeunit "Temp Blob"): Boolean
begin .. end;
procedure SelectFile(var _Import: Record "XXX Import"; var TempBlob: Codeunit "Temp Blob"; FileFilter: Text): Boolean
begin .. end;

Old version:

procedure SelectFile(var _Import: Record "XXX Import"; var TempBlob: Record TempBlob): Boolean
begin .. end;
procedure SelectFile(var _Import: Record "XXX Import"; var TempBlob: Record TempBlob; FileFilter: Text): Boolean
begin .. end;
freddydk commented 3 years ago

I can only view these logs if I have a support ticket - else I don't have access. I am not sure I understand what the problem is? Run-AlPipeline is a build pipeline, which isn't the same as the validation service. I guess it tries to install the old version on 19 - and that probably fails? I would need the full output if I am to help on that?

moprsal commented 3 years ago

I think I need to ask the AppSource validation team, so I'll create a support ticket. The question will be how to remove Record TempBlob correctly and pass the test.

Regarding Run-AlPipeline I'm surprised that it says that the same function change number of parameters from 3 to 2 and also from 2 to 3. Somehow it doesn't match the function with the same number of parameters when we change the type of the parameter.

Shall I put the full output here?

freddydk commented 3 years ago

The reason for the two errors (3 to 2 and 2 to 3 is probably that is misunderstands what is going on - you just changed a parameter in both, but that is also a breaking change and should just have been done by obsoleting the old functions and created new ones - before 19.0 really. The issue here is not related to BcContainerHelper and I will close it. here. I assume that you have found a solution to the problem through validation support.