Story #5522
Updated by bmbouter about 5 years ago
h3. Problem Each time the user fetches logging output from <code>GALAXY_API_ROOT/v3/imports/collections/<uuid:pk>/</code> it comes from "this viewset":https://github.com/pulp/pulp_ansible/blob/476e07ee76ec82e3cd2655959ea7a799066fa999/pulp_ansible/app/galaxy/v3/views.py#L149-L157 The issue is that the user wants to receive new log messages, but they get all logs every time. h3. Solution Rename Rework the "CollectionImport":https://github.com/pulp/pulp_ansible/blob/master/pulp_ansible/app/models.py#L50 Model by: 1. removing the "messages" attribute 2. creating three new attributes * message <--- long string, required. * level. <--- this should be a choice field w/ the standard "Python logging levels":https://docs.python.org/2/library/logging.html#logging-levels enumerated * time. This one can be configured to auto-record at save using the django ORM syntax for that. 3. The "add_log_record" method should be removed 4. Port the "logutils.CollectionImportHandler":https://github.com/pulp/pulp_ansible/blob/31dd6b77f0e2748644a4b76607be4a6cd2b6ce89/pulp_ansible/app/logutils.py to create a CollectionImport for each call to <code>emit()</code> 5. Rename CollectionImport to CollectionImportMessage, and update migrations accordingly.