Bug 51301 - Refactor code for Marktplatz share
Refactor code for Marktplatz share
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: Samba 4
UCS@school 4.4
Other Linux
: P3 normal (vote)
: UCS@school 4.4 v7
Assigned To: Daniel Tröder
Tobias Wenzel
:
Depends on: 42182 52013 52519
Blocks:
  Show dependency treegraph
 
Reported: 2020-05-18 10:57 CEST by Daniel Tröder
Modified: 2020-12-21 09:17 CET (History)
0 users

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary scenarios
Who will be affected by this bug?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 4: A User would return the product
User Pain: 0.274
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 Daniel Tröder univentionstaff 2020-05-18 10:57:36 CEST
+++ This bug was initially created as a clone of Bug #42182 +++

The Marktplatz share is missing a proper UCS@school lib representation.

The 'Share' class is not meant to be used on its own but only as a base class for specific shares (ClassShare and WorkgroupShare).

* Create a MarketplaceShare class in the UCS@school lib which can be used to create, modify and delete Marktplatz shares.
* Create a simple tests to verify the create, modify and delete behaviour.
* Create a 'ucsschool_roles' entry for MarketplaceShare objects in the Wiki and in code.
* Create migration code to set the new 'ucsschool_roles' entry on all existing shares.
Comment 1 Daniel Tröder univentionstaff 2020-08-19 12:08:32 CEST
The Python module "ucsschool.lib.models.share" now contains a class "MarketplaceShare" that can be used to create, modify and delete marketplace shares.

* The new test 90_ucsschool/405_ucsschool_lib_marketplace_share.py test creating and deleting marketplace shares. Modifying it is because of the lack of useful attributes not tested.

* The existing test 90_ucsschool/41_create_marktplatz_share.py checks the OU-post-create-hook functionality.

* A new CLI was written that can be used to list/create/modify/delete all UCS@school objects. For now it is for internal use only, and as such labeled "Experimental and unsupported tool for UCS@school object manipulation."

* The cli is used to create the Marktplatz share in the OU-post-create-hook.

* A new test (90_ucsschool/404_ucsschool_lib_models_main.py) was written to the the new CLI.

* The 'ucsschool_roles' for the share is called "marketplace_share". The wiki page for the 'ucsschool_roles' entry was updated: https://hutten.knut.univention.de/mediawiki/index.php/UCS@school_LDAP-Rollen

* The join script sets the ucsschoolRole property on all existing marketplace shares.


Code as commited to branch "dtroeder/51301_marktplatz_share":

fc58b1bc0 Bug #51774: 4.4 v6 was published
474385026 Bug #51724: run hook at pre-create and pre-modify steps
d752721a5 Bug #51724: add note about UCRVs in Kelvin to hook
12d602fee Bug #51724: advisory update
a20feb7ad Bug #51459: whitespace only reformatting
4818de02b Bug #51301: remove useless shebangs
cfabb4b3f Bug #51301: make tests silent when no errors happen
0f06753ac Bug #51301: add new ucsschool.lib model MarketplaceShare
67c8a4f7c Bug #51301: add cli to create/list/modify/delete ucsschool objects
7811bff5f Bug #51301: use new cli to create Markplatz share
7f8ea15cf Bug #51301: add cli dependency
643a0758b Bug #51301: add test for ucsschool.lib.model.share.MarketplaceShare
06b0408da Bug #51301: be more verbose in ou-post-create hook
7e76eae48 fixup! Bug #51301: add cli to create/list/modify/delete ucsschool objects
f32969b1a Bug #51301: set ucsschoolRole on all existing Marktplatz shares
Comment 2 Tobias Wenzel univentionstaff 2020-08-21 11:03:32 CEST
QA -> OK -> Reopen for merge & build

**Code review**

__main__.py (cli api) -> OK
tests -> OK
share.py -> OK
Rest cleanup code -> OK


**Tests**

test ucsschool.lib.models.__main__........................... Test passed
test get_file_handler function............................... Test passed
Check roles through the python client........................ Test passed

test create_demoportal....................................... Test passed
test ucsschool.lib.models.share.MarketplaceShare............. Test passed

Import OU via CLI & Python API ........................... Test failed
-> This is not directly connected to this bug. As discussed we will keep an eye on this/ fix it, if it causes failures on jenkins. 


**Functionality**

- Build & Installation of ucs-school-lib & ucs-school-import without failures.
- Marketplace was be created with the correct permissions (joinscript no. was increased)
- ucsschool_roles added
- CLI works as expected (tried out similar cmds as in test manually)


[dtroeder/51301_marktplatz_share] 04f045616 Bug #51301: move comment to method it talks about
[dtroeder/51301_marktplatz_share] c0bf31a16 fixup! Bug #51301: add cli to create/list/modify/delete ucsschool objects
[dtroeder/51301_marktplatz_share] 2c14605b1 fixup! Bug #51301: set ucsschoolRole on all existing Marktplatz shares
[dtroeder/51301_marktplatz_share] 475f2e1a7 Bug #51301: set ucsschoolRole on all existing Marktplatz shares
[dtroeder/51301_marktplatz_share] aa7dc298e fixup! Bug #51301: add cli to create/list/modify/delete ucsschool objects
[dtroeder/51301_marktplatz_share] b1c279f34 Bug #51301: be more verbose in ou-post-create hook
[dtroeder/51301_marktplatz_share] a4f98468c Bug #51301: add test for ucsschool.lib.model.share.MarketplaceShare
[dtroeder/51301_marktplatz_share] fde2b5c6a Bug #51301: add cli dependency
[dtroeder/51301_marktplatz_share] 89c46a4b5 Bug #51301: use new cli to create Markplatz share
[dtroeder/51301_marktplatz_share] 0f1a7090d Bug #51301: add cli to create/list/modify/delete ucsschool objects
[dtroeder/51301_marktplatz_share] fcf596b13 Bug #51301: add new ucsschool.lib model MarketplaceShare
[dtroeder/51301_marktplatz_share] fed38e201 Bug #51301: make tests silent when no errors happen
[dtroeder/51301_marktplatz_share] d6d484bfa Bug #51301: remove useless shebangs
Comment 3 Daniel Tröder univentionstaff 2020-08-21 11:22:30 CEST
The code has been merged to the "4.4" branch and the packages have been built.
Advisories have been created/updated.

ucs-school-lib (12.1.17)
ucs-school-import (17.0.44)
ucs-test-ucsschool (6.0.127)
Comment 4 Tobias Wenzel univentionstaff 2020-08-21 12:57:41 CEST
Changelog -> OK
YAML -> OK
Functionality (tests, etc.) -> OK

[4.4] c24219a0b Bug #51301: fix test for singleserver envs
[4.4] e42265cf4 Bug #51301: advisories
[4.4] 68c5148e2 Bug #51301: use ucsschool.lib cli -> depend on new version
[4.4] 210ba3914 Bug #51301: changelog
[4.4] 31acee72c Bug #51301: Merge branch 'dtroeder/51301_marktplatz_share' into 4.4

ucs-test-ucsschool (6.0.128)
Comment 5 Daniel Tröder univentionstaff 2020-09-10 16:45:05 CEST
An errata update to UCS@school 4.4 v6 has been released.

https://docs.software-univention.de/changelog-ucsschool-4.4v6-de.html

If this error occurs again, please clone this bug.