Closed resitamas closed 4 years ago
Hello @resitamas ,
Thank you for sharing this finding. I've created an internal incident 2070228697. The status of the issue will be updated here in GitHub.
Regards, Tsanislav
Hi @resitamas!
There is a seperate file where an application's version would be specified.
It's called the "descriptor" file, which is one manifest.json
file per application. The attribute applicationVersion
under the sap.app
namespace of that descriptor, would hold the version information for the app. That field is up to the the application developer's to be kept updated. You can read more about it here.
What sap.ui.getVersionInfo()
does (and its successor sap.ui.VersionInfo
) is a bit different. That utility basically to makes request to the /resources/sap-ui-version.json
file and returns it in the form of an object. That file holds information about the libraries that are included with the framework, and their own versions. Let me know if you need to know more about it.
Hi @resitamas and @gmkv,
this is a bit more complicated than one might think. sap-ui-version.json
was originally introduced to have a version (and later also dependency) information for all the sub-projects included in a UI5 app (the used UI5 libraries and their transitive dependencies) as well as for the app project itself. The main version in the file is the version of the app.
The file was - from the beginning - available for all apps that have been build with our in-house Maven tooling, but for them the file didn't play a role at runtime as it has been ignored by the deployment step. Only for our own SDK apps (OpenUI5 and SAPUI5), the file was deployed. For those apps, the main version in the sap-ui-version.json is at the same time the version of the app and the version of the UI5 framework.
There support tool was build with that shared installation in mind (no matter whether is the CDN or an in-house ABAP system or a SAP XS engine or a SAP Netweaver Java installation.
With the introduction of the open source UI5 tooling, the sap-ui-version.json
file became available in standalone apps, too. Still, the main version is the version of the app, but no longer the version of the framework.
What is indeed missing, is this information about the framework version.
I therefore re-open this issue, but the ui5 tooling IMO also has to contribute to a solution. Until then, using the version of sap.ui.core
(same as the sap.ui.version
property) and ignoring the patch level of that version, might be the best workaround in the support tool - if, and only if, support rules do not depend on the patch level of UI5.
Kind Regards, Frank
BTW: other tools that query the sap-ui-version.json
also might show misleading information for standalone apps:
OpenUI5 version: 1.76.0 Using UI5 Tooling 2.0.
Summarry
Cannot run checks for rules which include the minversion (e.g. sap.ui.fl - stableId), because the minimum required version for the rule is checked against the version of the application instead of the framework's.
Problem
The problem might be here:
https://github.com/SAP/openui5/blob/afa21f38112851e1d4a560f6ad7342639042fcd6/src/sap.ui.support/src/sap/ui/support/supportRules/RuleSetLoader.js#L80
The line above sets the version info for the rule set. (the used method is actually deprecated) It sets the version info of the application instead of the UI5's.
Later, when adding the rule the required minimum version is checked against the application's version, not against the version of the framework. https://github.com/SAP/openui5/blob/7c2bc5d536e787c5fd2460c36e266acdd98a231c/src/sap.ui.support/src/sap/ui/support/supportRules/RuleSet.js#L202-L215
So all the rules which specify a minimum required UI5 version will not work with Support Assistant.
Solution suggestion
To get the UI5 version the
sap.ui.version
can be used