Bug 53814 - add udm_properties to ucsschool-rest-api client
add udm_properties to ucsschool-rest-api client
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: kelvin-rest-api-client
unspecified
Other Linux
: P5 normal (vote)
: ---
Assigned To: Tobias Wenzel
Ole Schwiegert
:
Depends on: 53535
Blocks:
  Show dependency treegraph
 
Reported: 2021-09-21 11:30 CEST by Tobias Wenzel
Modified: 2023-05-26 15:36 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Feature Request
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
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 Tobias Wenzel univentionstaff 2021-09-21 11:30:45 CEST
The ucsschool-rest-api client has to support the attribute udm_properties for schools and schoolclasses, which was added in kelvin version 1.5.0


Implemtation details:

- move udm_properties to base class
- adjust tests
- adjust documentation
- increase version to 1.5.0 to match kelvin version
Comment 1 Tobias Wenzel univentionstaff 2021-09-21 12:40:35 CEST
The fix has been pushed to 

twenzel/kelvin-client/add_udm_properties
Comment 2 Tobias Wenzel univentionstaff 2021-09-22 09:01:40 CEST
Link to the pull request

 https://github.com/univention/kelvin-rest-api-client/pull/127/files

concerning new tests for udm_properties:

 If I want to test that like in the other tests, I would have to adjust the kelvin-api in the docker container. This would be an integration test including the a kelvin api configuration, which would have to be set + restart the container etc.
... or was something else meant by testing this? The user-tests did not test this neither (which is of course no reason not to do this)
Comment 3 Tobias Wenzel univentionstaff 2021-09-22 15:12:41 CEST
As discussed, I added the tests for udm_properties. Unfortunately, it's relatively complicated to adjust the test-setup for only one test.
So I create a mapped_properties files when the docker container(s) are created  with the following content:

{
    "user": ["title"],
    "school_class": ["mailAddress"],
    "school": ["description"]
}

Fortunately we have the hosts name -> fixture, so we don't run into problems when creating the mail address.

I also changed the default of the factories, e.g.

udm_properties = factory.Dict({"description": None})


This is not super-optimal, because it only reflects only our test scenario. The comparisions of ldap-values vs. kelvin-api values are made relatively automatic, so this seemed easier.
On the other hand: this reflects our test scenario, because we do not expect any other values.
Comment 4 Ole Schwiegert univentionstaff 2021-09-23 09:47:00 CEST
I merged the changes into master and did the 1.5.0 release on PyPI: https://pypi.org/project/kelvin-rest-api-client/

Documentation was updated here: https://kelvin-rest-api-client.readthedocs.io/en/latest/
Comment 5 Ole Schwiegert univentionstaff 2021-09-23 11:25:47 CEST
Release was tested as well.
Comment 6 Ole Schwiegert univentionstaff 2021-09-23 11:26:50 CEST
Released on https://pypi.org/project/kelvin-rest-api-client/