Project

Profile

Help

Story #5366

As an pulp_ansible developer, I have log Handler to log into CollectionImport.message with a standard logger

Added by bmbouter about 1 year ago. Updated 27 days ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Sprint/Milestone:
-
Start date:
Due date:
% Done:

100%

Estimated time:
Platform Release:
Groomed:
Yes
Sprint Candidate:
No
Tags:
Sprint:
Sprint 58
Quarter:

Description

Problem

The CollectionImport.messages attribute will store many messages and has viewsets to show them to the user. The issue is that there isn't a way for a pulp_ansible developer to write into that data structure using a Python log Handler.

solution

Add a log Handler to pulp_ansible that developers can use to write logs into an instance of CollectionImport.messages.

Details Design

- add handler called 'collection_import' and have it use 'pulp_ansible.logutils.CollectionImportHandler' like https://github.com/ansible/galaxy/blob/devel/galaxy/settings/default.py#L387-L390

- add logger called 'pulp_ansible.app.tasks.collection.import_collection' like https://github.com/ansible/galaxy/blob/devel/galaxy/settings/default.py#L417-L421

- make pulp_ansible.logutils.CollectionImportHandler similar to this but without linting parts https://github.com/ansible/galaxy/blob/devel/galaxy/worker/logutils.py#L72-L82

- instantiate a new logger for 'pulp_ansible.app.tasks.collection.import_collection'

- add_log_record() method to CollectionImport model

Associated revisions

Revision b2342c04 View on GitHub
Added by bmbouter about 1 year ago

Add CollectionImport log handler and Validation

Add add_log_message() facility to the CollectionImport model. This is called by the log handler which is auto-configured by pulp_ansible with this commit.

The logger is 'pulp_ansible.app.tasks.collection.import_collection'.

Add validation feature to CollectionImport where the expected_namespace, expected_name, and expected_version are specified. When used the import will fail if the tarball does not contain the same values. These are optional parameters and only available in the Galaxy V3 API currently.

https://pulp.plan.io/issues/5366 closes #5366

https://pulp.plan.io/issues/5422 closes #5422

History

#1 Updated by awcrosby about 1 year ago

The approach here LGTM

#2 Updated by bmbouter about 1 year ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to bmbouter
  • Groomed changed from No to Yes
  • Sprint set to Sprint 58

Adding to the sprint per grooming from @awcrosby

#3 Updated by bmbouter about 1 year ago

  • Status changed from ASSIGNED to POST

#4 Updated by bmbouter about 1 year ago

  • Status changed from POST to ASSIGNED

#5 Updated by bmbouter about 1 year ago

  • Status changed from ASSIGNED to POST

#6 Updated by bmbouter about 1 year ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100

#7 Updated by bmbouter 27 days ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF