As a plugin writer, pulpcore ensures that a job working directory is set/removed properly
At the moment, it's plugin's responsibility to be sure that any temporary files it's working with are stored in the directory dedicated to a running job. It's done by using the content manager
The context manager doesn't support nesting which causes a usability problem.
Plugin writer needs to carefully create and recreate the working directory every time it deals with files to avoid nesting (e.g. stages API uses WorkingDirectory so some nesting can come from the using of pulpcore code).
- let tasking management in pulpcore take care of managing the working directory for every job (even if it doesn't need it)
- raise DeprecationWarning for the context manager
- make the context manager
WorkingDirectoryno-op since pulpcore sets the directory for any job
- file a task to remove the deprecation and the context manager on Y+1 version of pulpcore
In the implementation, I went with a slightly different approach. Instead of making WorkingDirectory a no-op, I just fixed the issue preventing them from nesting. I think we still want manual WorkingDirectorys because we plugin writers may have any number of reasons to want a clean one, and we can't enforce that if we only have a single, shared working directory for the entire task. We've seen issues recently with the migration plugin where sub-repo publishing had errors seemingly caused by sharing WorkingDirectory with the publish of the outer repo.
Please register to edit this issue