Project

Profile

Help

Story #5522

Updated by bmbouter over 4 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 

 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 Add a choice field w/ FilterSpec to that viewset that allow the standard "Python logging levels":https://docs.python.org/2/library/logging.html#logging-levels enumerated 
 * time. This one can be configured user to auto-record at save using specify the django ORM syntax <code>since</code> as an optional attribute. If unspecified you get all the logs for that. 

 3. The "add_log_record" method should be removed 
 4. Port that CollectionImport. If specified you get data formatted the "logutils.CollectionImportHandler":https://github.com/pulp/pulp_ansible/blob/31dd6b77f0e2748644a4b76607be4a6cd2b6ce89/pulp_ansible/app/logutils.py same way, except filtered to create only include messages with a CollectionImport for each call to <code>emit()</code> 
 timestamp greater than <code>since</code>.

Back