Actions
Story #5028
closedRepositoryVersion.create() can't be called outside of a task
Start date:
Due date:
% Done:
100%
Estimated time:
Platform Release:
Groomed:
Yes
Sprint Candidate:
No
Tags:
Sprint:
Sprint 60
Quarter:
Description
Docker push requires creating a repository version without dispatching a task. This is currently impossible because the RepositoryVersion.create() method always creates a CreatedResource[0]. A CreatedResource requires a task_id to be saved to the database.
Solution¶
Have the RepositoryVersion.create() check if it's running inside a task. You can do that with Task.current [1].
[0]: https://github.com/pulp/pulpcore/blob/06c7412525c0196169690125eecd63fad3548752/pulpcore/app/models/repository.py#L435
[1]: https://github.com/pulp/pulpcore/blob/8c3798cee5935c6c01af0cf83bdea2359926bfad/pulpcore/app/models/task.py#L339-L350
Actions
Repository version creation w/o CreatedResource
Allowing to create a repository version without dispatching a task. closes #5028 https://pulp.plan.io/issues/5028