Bug 55658 - Different results from supports_ucs_version and must_have_fitting_ucs_version
Different results from supports_ucs_version and must_have_fitting_ucs_version
Status: NEW
Product: UCS
Classification: Unclassified
Component: App Center
UCS 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: App Center maintainers
App Center maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2023-02-03 13:28 CET by Jürn Brodersen
Modified: 2023-02-03 13:28 CET (History)
0 users

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jürn Brodersen univentionstaff 2023-02-03 13:28:01 CET
Different results from supports_ucs_version and must_have_fitting_ucs_version

As far as I understand it, the "supports_ucs_version" function decides if an app will be shown in the appcenter while "must_have_fitting_ucs_version" is used to decide if an app can be installed. Should they return different results? It strikes me as a bit odd.

For docker apps that means I can install an unsupported version, using the myApp=$Unsupported_Version syntax. Package apps fail to install because the repository will not be added for an unsupported version, you don't get any error message why it wasn't added.

Example on a 5.0-2 system:
```
In [11]: from univention.appcenter.app import App

In [17]: myApp = App({}, None, id="foo", supported_ucs_versions=["4.4-0"])

In [18]: myApp.must_have_fitting_ucs_version()
Out[18]: True

In [19]: myApp.supports_ucs_version()
Out[19]: False
####

In [20]: myApp = App({}, None, id="foo", supported_ucs_versions=["5.2-0"])

In [21]: myApp.supports_ucs_version()
Out[21]: False

In [22]: myApp.must_have_fitting_ucs_version()
Out[22]: True
###
In [23]: myApp = App({}, None, id="foo", supported_ucs_versions=["5.0-0"])

In [24]: myApp.must_have_fitting_ucs_version()
Out[24]: True

In [26]: myApp.supports_ucs_version()
Out[26]: True
```

must_have_fitting_ucs_version ->
https://git.knut.univention.de/univention/ucs/-/blob/5.0-3/management/univention-appcenter/python/appcenter/app.py#L1355
supports_ucs_version -> 
https://git.knut.univention.de/univention/ucs/-/blob/5.0-3/management/univention-appcenter/python/appcenter/app.py#L1186