Closed Rambabu-Billuri closed 3 years ago
I believe you did not configure the AppSourceCop to compare code with the old app version: https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/analyzers/appsourcecop#configuration
Can you confirm that you configured AppSourceCop properly? Can you share a project to reproduce the issue?
Yes, we configured AppSourceCop, added the old version in /.alpackages and we have given old app details in AppSourceCop.json
Here is the details in settings.json
Your AppSourceCop.json is not in the project's root folder, but in subfolder .codeAnalysis.
We tried by moving the AppSourceCop.json file to root folder, but we didn't get any error and the new app installed successfully.
Did you restart VS Code or "Reload window" after the change? Just a guess ...
Yes we tried with "Reload window" and "Restart", still we didn't get the error while installing the new app.
@qutreson any updates on this ?
Oh, good you're reminding me. What I didn't know: the correct settings apparently do not provide instant errors, but only on publishing the actual app. Have you already tried that?
Yes.
Hi @Rambabu-Billuri, I tried reproducing this scenario, but without success as I am getting the AS0044 diagnostic reported when introducing a breaking change on the OptionMembers property.
I created an extension containing the following table in version 1.0.0.0:
table 10000000 FOO_MyTable
{
fields
{
field(1; MyOptionField; Option)
{
DataClassification = SystemMetadata;
OptionMembers = Yes,No,Maybe;
}
}
}
And containing the following table in version 2.0.0.0:
table 10000000 FOO_MyTable
{
fields
{
field(1; MyOptionField; Option)
{
DataClassification = SystemMetadata;
OptionMembers = Yes,None,Maybe; // No has been replaced by None
}
}
}
I am now getting this AppSourceCop analyzer diagnostic in VS Code:
You can find attach the full project I used here: Github6078.zip
You can use it to verify that the AppSourceCop is correctly configured in your project. It is important to have:
version
to use a base line in the AppSourceCop.jsonIf that did not help resolving this issue, can you share the project that you are using, or another one that could help reproducing the issue?
Thank you so much @qutreson. We tried as you specified in the given project, it is working fine. AppSourceCop is throwing an error this time.
Describe the bug We are not getting an error if we try to modify or add new options to the 'OptionMembers' even the AppSourceCop and CodeCop are active.
But we are getting a failure as breaking change in Microsoft Technical Validations. Please find the below for MS Technical Validation issue.
Failed to compile package: .vscode/AL%20Files/Table%20Extensions/Tab5740-Ext70174915.Transfer%20Header%20PSE.al(143,25): error AS0044: OptionMembers has changed value from ' ,,Prepaid,Third Party Billing,,,' to ' ,Prepaid and Charge,Prepaid,Third Party Billing,Collect,Consignee Billed,Bill Recipient', this is a destructive change, only appending new OptionMembers is allowed.
To Reproduce Steps and to reproduce the behavior:
Expected behavior AppSourceCop should identify this issue and throw an error.
4. Versions: