Bug 51003 - treat empty ucrv as unset ucrv: ucsschool/import/generate/user/attributes/no-overwrite-by-schema
treat empty ucrv as unset ucrv: ucsschool/import/generate/user/attributes/no-...
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: Import scripts
UCS@school 4.4
Other Linux
: P5 normal (vote)
: UCS@school 4.4 v5-errata
Assigned To: Toni Röhmeyer
Tobias Wenzel
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-03-24 11:59 CET by Daniel Tröder
Modified: 2020-06-10 14:35 CEST (History)
3 users (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?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2020020521000213
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-03-24 11:59:58 CET
When ucsschool/import/generate/user/attributes/no-overwrite-by-schema is an empty string, the import will not recognize it as unset and assume all attributes should be overwritten - including uid and mailPrimaryAddress.
→ ImportUser.no_overwrite_attributes will be [] instead of the default ["mailPrimaryAddress", "uid"].

1. Handle the ucrv with an empty string in like if it were unset and use the default ("mailPrimaryAddress uid").

2. Log the used value of the UCRV at the beginning, as it is part of the import configuration. Check for other UCRVs that are also relevant and log them too. This is essential for debugging import problems.
Comment 1 Toni Röhmeyer univentionstaff 2020-03-30 15:16:39 CEST
Added fix to branch troehmey/bug51003 with commit

commit b511cbba1f3c04ce7e1f3cb806f325898bed7269
Bug #51003: fixed empty no-overwrite-attributes


If no_overwrite_attributes is an empty list, it will be set to ["mailPrimaryAddress", "uid"].

Added logs for used ucr variables in ImportUser class.


Waiting for QA
Comment 2 Tobias Wenzel univentionstaff 2020-04-21 11:44:27 CEST
QA

[troehmey/bug51003] b511cbba1 Bug #51003: fixed empty no-overwrite-attributes

Code Review

Why "mailPrimaryAddress uid".split() instead of 
["mailPrimaryAddress", "uid"]?

Use two whitespaces before comment.


Functionality -> Works as expected.

- Before the changes, when having the ucrv set to "", the field gets overwritten. After the change the values stay the same, same as if the ucrv would be unset.
- ucrv mail/hosteddomains is logged when email is created with a schema.
Comment 3 Toni Röhmeyer univentionstaff 2020-04-26 17:32:54 CEST
Issue resolved with 

commit 72378e6df8b75c037fa6503b84948b41b3a9841f
Bug #51003: minor fix

on branch troehmey/bug51003.


"mailPrimaryAddress uid".split() had no particular reason.
Comment 4 Tobias Wenzel univentionstaff 2020-04-27 09:25:48 CEST
thanks for the adjustments!

QA -> all ok -> please merge, add changelog and yaml and build.

Code -> ok
Functionality -> ok


[troehmey/bug51003] 72378e6df Bug #51003: minor fix
Comment 5 Toni Röhmeyer univentionstaff 2020-04-27 18:43:21 CEST
Feature branch merged to 4.4 with commits

commit 996a609a0b1afd138e6118c8ece1323fc1d97955
Bug #51003: added yaml

commit 6c3bbac820bfb9e96a97b2569e9fd989015648d3
Bug #51003: added changelog entry

commit 2d4f2a81321c2a9c2f732dd521f894ef027a29b4
Bug #51003: Merge branch 'troehmey/bug51003' into 4.4

commit 690e390aeaa9bd158d7c44d50e89669f315e4c51
Bug #51003: minor fix

commit bd3468c831f32d42ac62a119cdc961bb4b5119de
Bug #51003: fixed empty no-overwrite-attributes



successful build:

Package: ucs-school-import
Version: 17.0.32A~4.4.0.202004271830
Branch: ucs_4.4-0
Scope: ucs-school-4.4
Comment 6 Tobias Wenzel univentionstaff 2020-04-28 09:12:02 CEST
Changelog -> Ok
Yaml -> Ok
Comment 7 Ole Schwiegert univentionstaff 2020-06-10 14:35:59 CEST
UCS@school 4.4 v5 has been released (errata update to the release).

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

If this error occurs again, please clone this bug.