Bug 48423 - make ucsschool import framework more usable as a library
make ucsschool import framework more usable as a library
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: Import scripts
UCS@school 4.3
Other Linux
: P5 normal (vote)
: UCS@school 4.3 v7
Assigned To: Daniel Tröder
Sönke Schwardt-Krummrich
:
Depends on: 47076
Blocks:
  Show dependency treegraph
 
Reported: 2019-01-03 17:11 CET by Daniel Tröder
Modified: 2019-03-12 10:50 CET (History)
0 users

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 2: Improvement: Would be a product improvement
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 1: Nuisance – not a big deal but noticeable
User Pain: 0.011
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 2019-01-03 17:11:47 CET
The architecture of the UCS@school import code a framework.
To use the ImportUser class and parts of the UserImport class in other software some adjustments are necessary.

Refactor the code, so that the import framework is easier and faster to initialize.
Comment 1 Daniel Tröder univentionstaff 2019-01-03 17:46:04 CET
Imports and initialization code has been pushed back as much as possible to allow easier usage of the ImportUser class in 3rd party software.

The create_ou code was refactored to make its main Python function available to other Python software.

[4.3] 0eefb4ea2 Bug #48423: lazy initialization
[4.3] d82c122d0 Bug #48423: allow disabling selected tests, for now only uniqueness
[4.3] dd70162fa Bug #48423: allow unprivileged users to run code
[4.3] 1a953f169 Bug #48423: refactor create_ou code to make it usable without the cmdline interface
[4.3] 74e904721 Bug #48423: changelog
[4.3] 779e25154 Bug #48423: advisory

[4.4] 08efe4568 Bug #48423: lazy initialization
[4.4] 179f564d8 Bug #48423: allow disabling selected tests, for now only uniqueness
[4.4] 382c92589 Bug #48423: allow unprivileged users to run code
[4.4] 8f4084d65 Bug #48423: refactor create_ou code to make it usable without the cmdline interface
[4.4] d9a85b307 Bug #48423: changelog

Package: ucs-school-import
Version: 16.0.2-64A~4.3.0.201901031732
Branch: ucs_4.3-0
Scope: ucs-school-4.3

Can currently not be built for 4.4, because of Bug #47076.
Comment 2 Daniel Tröder univentionstaff 2019-01-04 15:20:28 CET
Various tests were failing in Jenkins, because Student objects had to long usernames. The reason was that all ImportUser subclasses shared the same UsernameHandler object. A bug introduced by the lazy_init patch.

The configuration was not logged when a configuration check failed, making debugging difficult.

Fixing the "all ImportUser subclasses shared the same UsernameHandler object" bug I realized, that each ImportUser subclasses creates its own set of PyHooks and FormatHooks. That's not necessary and has been fixed.

[4.3] f4c2730b9 Bug #48423: improve configuration error reporting
[4.3] ca5921835 Bug #48423: fix one UsernameHandler being shared by all ImportUser subclasses
[4.3] 314f6d6ea Bug #48423: fix hooks being loaded for each ImportUser subclass
[4.3] 77a55e709 Bug #48423: changelog

ucs-school-import 16.0.2-65A~4.3.0.201901041512
Comment 3 Daniel Tröder univentionstaff 2019-01-09 14:32:19 CET
[4.3] ac05ca0a2 Bug #48423: ou post-create hook can handle running in other Django app process
[4.3] 2dbd7a6fb Bug #48423: advisory update

[4.4] ff44e88bb Bug #48423: advisory
[4.4] a7bcbf0d5 Bug #48423: improve configuration error reporting
[4.4] 82c7592b2 Bug #48423: fix one UsernameHandler being shared by all ImportUser subclasses
[4.4] c058137e5 Bug #48423: fix hooks being loaded for each ImportUser subclass
[4.4] b48e3efe6 Bug #48423: changelog
[4.4] 79826eda5 Bug #48423: ou post-create hook can handle running in other Django app process
[4.4] cdeafe06a Bug #48423: advisory update

Package: ucs-school-import
Version: 16.0.2-66A~4.3.0.201901091400
Branch: ucs_4.3-0
Scope: ucs-school-4.3
Comment 4 Daniel Tröder univentionstaff 2019-01-09 17:38:53 CET
With Bug #47076 fixed, this builds now:

Package: ucs-school-import
Version: 17.0.0-3A~4.4.0.201901091736
Branch: ucs_4.4-0
Scope: ucs-school-4.4
Comment 5 Sönke Schwardt-Krummrich univentionstaff 2019-01-25 17:06:06 CET
OK: package built and installable
OK: code change (manual review of all commits)
OK: functional change (code is now better usable)
OK: tests
    - manual tests
    - jenkins tests
    - test in a customer test environment
    - test during customer development for prof services
OK: changelog entry
OK: advisory
OK: changes merged to 4.4
Comment 6 Sönke Schwardt-Krummrich univentionstaff 2019-03-12 10:50:35 CET
UCS@school 4.3 v7 has been released.

https://docs.software-univention.de/changelog-ucsschool-4.3v7-de.html

If this error occurs again, please clone this bug.