Bug 46571 - 4.2/school-import: checks are not executed in dry-run
4.2/school-import: checks are not executed in dry-run
Product: UCS@school
Classification: Unclassified
Component: Import scripts
UCS@school 4.2
Other Linux
: P5 normal (vote)
: UCS@school 4.2 v9
Assigned To: Daniel Tröder
Jürn Brodersen
Depends on:
Blocks: 46572 46923
  Show dependency treegraph
Reported: 2018-03-09 14:06 CET by Daniel Tröder
Modified: 2018-06-04 15:34 CEST (History)
1 user (show)

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?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.046
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:


Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Tröder univentionstaff 2018-03-09 14:06:22 CET
Because of Bug #46317, the method ImportUser.run_checks() is not executed in a dry-run anymore.

Add explicit run_checks() calls to UserImport in the dry-run branches.
Comment 1 Daniel Tröder univentionstaff 2018-03-23 14:41:56 CET
The checks are run after pre_{create,modify,move}() and before and modification to the underlying UDM object.

A test was added to verify that: 231_import-users_checks_in_dry-run

[4.2] 80bb5bc3 Bug #46572: do checks in dry-run, run them after pre-hooks and before changes to the underlying UDM object
[4.2] c707fac2 Bug #46572: handle TypeError
[4.2] 0b644fc7 Bug #46572: add test to verify checks are executed in dry-run
[4.2] 8de42ff5 Bug #46572: trigger early check for move(), not late for modfiy()
[4.2] ecd8e80b Bug #46572: cleanup: test lib learned to handle birthday property itself
[4.2] e4a43867 Bug #46572: changelog
[4.2] e74e0f47 Bug #46571: advisory

8de42ff5 should have been labeled for Bug #46462.

ucs-school-import (15.0.3-27)
ucs-test-ucsschool (4.0.4-75)
Comment 2 Daniel Tröder univentionstaff 2018-03-27 17:00:39 CEST
[4.2] f1fbe0e9 Bug #46572: do not run checks from within hook
[4.2] 590c0421 Bug #46572: handle different names
[4.2] c1e95ec8 Bug #46571: changelog
[4.2] c443ab76 Bug #46571: advisory

ucs-school-import (15.0.3-28)
ucs-test-ucsschool (4.0.4-77)
Comment 3 Jürn Brodersen univentionstaff 2018-04-03 10:55:44 CEST
Test runs successfully -> OK

-> Verified
Comment 4 Jürn Brodersen univentionstaff 2018-04-03 16:38:55 CEST
(In reply to Jürn Brodersen from comment #3)
> Test runs successfully -> OK
> YAML -> OK
> -> Verified

Sorry the test does not fully work -> Reopen
Comment 5 Jürn Brodersen univentionstaff 2018-04-03 17:10:02 CEST
The 4.1 and 4.2 parts of the "fail" for the wrong reason. Not because of the "bad" brithday format but because the fake_ou doesn't exists.

I tried setting fake_ou = self.ou_B.name but then the 4.1 part of the test fails in "person.verify()" because the person was actually moved. Should the school move be reverted on errors? (Not in the scope of this bug I guess)

If possible check that the import failed for the "right" reason. Or check that the import is successful with the birthday in a "good" format.
Comment 6 Daniel Tröder univentionstaff 2018-04-04 13:20:08 CEST
Fixed test revealed the missing update of the uniqueness storage.

[4.2] 2f294cd3 Bug #46571: change DN in uniqueness store also in dry-run
[4.2] bc76ab9c Bug #46571: modify classes in school change
[4.2] 6baed155 Bug #46571: use real OU in move() test
[4.2] 7104f815 Bug #46571: changelog
[4.2] 40e69744 Bug #46571: advisory update

ucs-school-import (15.0.3-30)
ucs-test-ucsschool (4.0.4-79)
Comment 7 Jürn Brodersen univentionstaff 2018-04-06 13:48:21 CEST
Looks good now :)
Test runs successfully -> OK

-> Verified
Comment 8 Sönke Schwardt-Krummrich univentionstaff 2018-05-02 17:53:01 CEST
UCS@school 4.2 v9 has been released.


If this error occurs again, please clone this bug.