AL icon indicating copy to clipboard operation
AL copied to clipboard

AppSourceCop Analyser does not find previous Extension version

Open KoFrank opened this issue 6 years ago • 5 comments

Describe the bug When you declare a previous extension version in the AppSourceCop.json, the compiler throws 4 identical AS0003 warnings, claiming that the previous version was not found.

To Reproduce Steps and to reproduce the behavior:

  1. AL:Go!
  2. Add the AppSourceCop.json with version 1.0.0.0, name and publisher filled out.
  3. Activate the AppSourceCop in a settings.json file
  4. Debug the Extension once so that it is installed with version 1.0.0.0
  5. After stopping the debugger change the app.json version to 1.0.0.1
  6. Compile the code, compiler should now throw 4 lines of AS0003 warnings.

Expected behavior A check for breaking changes between version concerning the public interfaces of codeunits, for example.

5. Versions:

  • AL Language: 4.0.229715
  • Business Central: W1 15.2 (Platform 15.0.39461.40546 + Application 15.2.39558.40594)

KoFrank avatar Feb 13 '20 12:02 KoFrank

The app file AppSourceCop should check against must be placed in the .alpackages folder.

AskeHolst avatar Feb 14 '20 20:02 AskeHolst

Ok then, that worked. In this case either this feature does not work as intended and this is a workaround or the documentation of the configuration of that feature need to be modified:

The name, publisher, version properties are used for specifying a previous version of the current package. AppSourceCop will use this information to download the specified package from the server and compare the current package with it. AppSourceCop will report any breaking changes introduced by the current package. (Emphasis me; Source)

KoFrank avatar Feb 17 '20 07:02 KoFrank

Hi @KoFrank, the app source cop does not automatically download the previous version of the extension. We will fix the documentation for it.

We also updated the diagnostic returned by AS0003 to be a bit more explicit: The version '{0}' of the extension with publisher '{1}' and name '{2}' could not be found in the package cache folder.

Would that error message have been more helpful?

qutreson avatar Apr 02 '20 16:04 qutreson

Hi @qutreson, yes thank you. That error message would be more helpful.

KoFrank avatar Apr 03 '20 06:04 KoFrank

Perfect, I am then closing this issue. This fix will be available in the next release of the AL extension and should be available soon in our developer previews.

qutreson avatar Apr 05 '20 15:04 qutreson