Univention Bugzilla – Bug 48188
run pre-read-hooks in ucs-school-import
Last modified: 2019-04-09 14:23:39 CEST
Create a hook that allows to modify the input data before it is read. It should be run directly after reading the configuration. It is passed an instance of the configuration object and a /path/filename, and is expected to return a /path/filename. The returned /path/filename is used as input for the import. The configuration object must be changed to allow updating the filename. The hooks must work from the command line and from HTTP-API.
In case of a HTTP-API triggered import, *both* the original input file and the new input file must be copied to /var/lib/ucs-school-import/jobs/$YEAR/$JOBID.
WIP (should be complete, but is untested) in dtroeder/48188_pre-read-hook
OK, works. I added a test (commit labeled falsely for Bug #48189). [dtroeder/48188_pre-read-hook] 03b748a97 Bug #48188: add type hints [dtroeder/48188_pre-read-hook] 50d8e8a2c Bug #48188: make hook loader reusable [dtroeder/48188_pre-read-hook] 55a9fbb95 Bug #48188: add pre-read hook support [dtroeder/48188_pre-read-hook] f180a2219 Bug #48188: fix import, improve error message [dtroeder/48188_pre-read-hook] ea96ecaca Bug #48189: add test for pre-read hook Please reopen, when starting QA (missing merge, changelog and package build).
Merged to 4.4 as part of work on Bug #48958.
Package installs: OK Test passes: OK Hook function working: OK Please merge and create changelog and advisory
Merge to 4.3: [4.3] 6b41925e2 Bug #48188: add type hints [4.3] 15feb7c00 Bug #48188: make hook loader reusable [4.3] 1139c17be Bug #48188: add pre-read hook support [4.3] a18e47214 Bug #48188: fix import, improve error message [4.3] 3ebd89dbb Bug #48188: fix test tags [4.3] 1d42a6f85 Bug #48188, Bug #48189: advisory ucs-school-import (16.0.3-6) Merge to 4.4: [4.4] fb2aef538 Bug #48188: add type hints [4.4] 209734859 Bug #48188: make hook loader reusable [4.4] 3697db3dd Bug #48188: add pre-read hook support [4.4] 2403d336c Bug #48188: fix import, improve error message [4.4] ccdebebe5 Bug #48188: fix test tags
Documentation: missing (At least not found in https://billy.knut.univention.de/~dtroeder/http-api-doc/hooks.html except for the API-Doc) [REOP] 4.4: Changelog: Bug not mentioned Advisories: missing ucs-test: OK Input files present in /var/lib/ucs-school-import/jobs/$YEAR/$JOBID: OK Import via HTTP-API: OK 4.3: Changelog&Advisory: OK ucs-test: OK Input files present in /var/lib/ucs-school-import/jobs/$YEAR/$JOBID: OK Import via HTTP-API: OK
[4.4 b621d987f] Bug #48188: advisory [4.4 2acd04055] Bug #48188: add PreReadPyHook to hook sequence diagram Changelog will be build from advisory, when it is released. Documentation isn't public yet, so the package was not rebuilt.
OK.
UCS@school 4.3 v8 has been released. https://docs.software-univention.de/changelog-ucsschool-4.3v8-de.html If this error occurs again, please clone this bug.