Bug 48511 - Apple School Manager Connector breaks off completely if a class group has more than 12 teachers assigned
Apple School Manager Connector breaks off completely if a class group has mor...
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: Apple School Manager
UCS@school 4.3
Other Linux
: P5 normal (vote)
: ---
Assigned To: Daniel Tröder
Jürn Brodersen
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-01-22 16:19 CET by Christina Scheinig
Modified: 2023-08-11 18:21 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?: 5: Blocking further progress on the daily work
User Pain: 0.114
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2019012221000605
Bug group (optional):
Max CVSS v3 score:
troeder: Patch_Available+


Attachments
Synchronize only 15 teachers and print a warning. (1.16 KB, patch)
2019-01-23 15:08 CET, Daniel Tröder
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christina Scheinig univentionstaff 2019-01-22 16:19:17 CET
Unfortunately the Apple School Manager Connector breaks off completely if a class group has more than 12 teachers assigned to it.

Is this a limitation of apple?

It would be nice if the connector would only assign the first 12 teachers found to the class and then still run.

Traceback (most recent call last):
  File "/usr/sbin/asm-upload", line 98, in <module>
    main()
  File "/usr/sbin/asm-upload", line 89, in main
    zip_path = asmUpload.upload()
  File "/usr/lib/pymodules/python2.7/univention/asm/asm_upload.py", line 60, in upload
    zip_path = AsmZipFile(file_path, self.ou_whitelist).write_zip()
  File "/usr/lib/pymodules/python2.7/univention/asm/csv/zip_file.py", line 99, in write_zip
    self.csv_files = self.create_csv_files()
  File "/usr/lib/pymodules/python2.7/univention/asm/csv/zip_file.py", line 76, in create_csv_files
    self.csv_files = create_csv_files(tmp_dir, self.ou_whitelist)
  File "/usr/lib/pymodules/python2.7/univention/asm/csv/csv_file.py", line 369, in create_csv_files
    cls(path, ou_whitelist).write_csv()
  File "/usr/lib/pymodules/python2.7/univention/asm/csv/csv_file.py", line 182, in write_csv
    for obj in objs:
  File "/usr/lib/pymodules/python2.7/univention/asm/csv/csv_file.py", line 158, in find_and_create_objects
    yield self.asm_model_class.from_dn(ucs_obj.dn)
  File "/usr/lib/pymodules/python2.7/univention/asm/models/classes.py", line 157, in from_dn
    additional_instructor_ids=additional_instructor_ids
  File "/usr/lib/pymodules/python2.7/univention/asm/models/classes.py", line 93, in __init__
    assert len(additional_instructor_ids) < 13, 'No more than 12 additional instructors are allowed.'
AssertionError: No more than 12 additional instructors are allowed.
Comment 1 Daniel Tröder univentionstaff 2019-01-23 08:51:59 CET
(In reply to Christina Scheinig from comment #0)
> Unfortunately the Apple School Manager Connector breaks off completely if a
> class group has more than 12 teachers assigned to it.
> 
> Is this a limitation of apple?
Yes
 
> It would be nice if the connector would only assign the first 12 teachers
> found to the class and then still run.
@michel: what do you think about a change to printing a warning instead of exiting with an error?

If I remember correctly, the teachers are ordered alphabetically. So each export (mostly) the same users would be exported (not having changes each export).
Comment 2 Michel Smidt 2019-01-23 11:22:32 CET
(In reply to Daniel Tröder from comment #1)
> (In reply to Christina Scheinig from comment #0)
> > Unfortunately the Apple School Manager Connector breaks off completely if a
> > class group has more than 12 teachers assigned to it.
> > 
> > Is this a limitation of apple?
> Yes
>  
> > It would be nice if the connector would only assign the first 12 teachers
> > found to the class and then still run.
> @michel: what do you think about a change to printing a warning instead of
> exiting with an error?

Sure, I think that's necessary.

> 
> If I remember correctly, the teachers are ordered alphabetically. So each
> export (mostly) the same users would be exported (not having changes each
> export).

I think that will lead to a problem. What happens if a teacher is not synchronized into the class? For example, will the classroom app not be usable?
Comment 3 Daniel Tröder univentionstaff 2019-01-23 11:28:20 CET
(In reply to Michel Smidt from comment #2)
> I think that will lead to a problem. What happens if a teacher is not
> synchronized into the class? For example, will the classroom app not be
> usable?
No idea - probably: the teacher will not be recognized as an instructor for that class.
That's why it currently raises an exception: to not let this problem be unnoticed.
Comment 4 Christina Scheinig univentionstaff 2019-01-23 13:57:29 CET
The customer needs a workaround, so that the connector is not blocking further progresses.

They add new schools to the Connector several times a week and unfortunately there are several schools where all teachers have been put into single class groups. Since the membership of teachers in class groups is managed by the schools themselves through the UMC, they run the risk that each school could paralyze the School Manager Connector at any time.
Comment 5 Michel Smidt 2019-01-23 14:47:22 CET
(In reply to Christina Scheinig from comment #4)
> The customer needs a workaround, so that the connector is not blocking
> further progresses.

So, as discussed Daniel will create a workaround which skips after 12 teachers, warns (in the log) and go on with the next school.
Comment 6 Daniel Tröder univentionstaff 2019-01-23 15:08:31 CET
Created attachment 9816 [details]
Synchronize only 15 teachers and print a warning.

The patch makes ensures that only 15 instructors per class are synchronized and prints a warning if a class has more teachers than that.
Comment 7 Daniel Tröder univentionstaff 2019-01-30 12:20:36 CET
The patch was applied to the sources and a test was extended to fail with the old version and succeed with the new code.

[4.3 cc87ec5] Bug #48511: adapt to changes in ucsschool testing lib
[4.3 e399424] Bug #48511: synchronize only 15 instructors per class

Package: univention-apple-school-manager-connector
Version: 1.0.0-21A~4.3.0.201901301212
Branch: ucs_4.3-0
Scope: univention-asm

A new app version was created in the test appcenter and the packages have been uploaded (version 1.2 -> apple-school-manager_20190130121404).

A UPDATE text was added for version 1.2.
Comment 8 Jürn Brodersen univentionstaff 2019-02-25 14:32:55 CET
What I tested:
Added 16 teachers to class -> Only 15 are synchronized -> OK

-> verified

It felt random to me which teachers are synchronized and which aren't. But I don't think that is a problem for this particular use case (all teachers in a single class group).
Comment 9 Daniel Tröder univentionstaff 2019-02-25 15:27:33 CET
(In reply to Jürn Brodersen from comment #8)
> It felt random to me which teachers are synchronized and which aren't. But I
> don't think that is a problem for this particular use case (all teachers in
> a single class group).
Yes - it kind of is: the list is sorted by 1. school name 2. teacher name.
If someone needs this to be a certain subset of those teachers, he'll have to define the the selection method.
Comment 10 Daniel Tröder univentionstaff 2019-03-12 09:57:33 CET
Published in

4.3/apple-school-manager=1.2 | apple-school-manager_20190130121404
4.4/apple-school-manager=2.0 | apple-school-manager_20190130121404