[Pulp-dev] Solving the "callback problem" ... aka how pulpcore will stop finalizing RepositoryVersion
gmbnomis at gmail.com
Tue Nov 5 20:53:35 UTC 2019
On Tue, Nov 05, 2019 at 02:46:18PM -0500, Brian Bouterse wrote:
> Note that the context manager is only syntactic sugar. The pulp_file
> sync code could also just as easily be as shown below. This is
> incomplete, but I think you'll get the idea.
> With this plugins can even do what they want in terms of style (context
> manager or not). Also they can not use it at all and the only extra
> responsibility would be to finalize the RepositoryVersion with its
> context manager (core provided).
> I'd like to ask for feedback on this design asap. Questions are
> concerns ... please send 'em.
This is an elegant solution for the sync case and, as you said,
offers multiple options to implement validation/extra changes.
However there are other places in core that create repo versions. I
think we have three overall: sync, add_and_remove task, and create()
How will the plugin writer reuse validation code in the other places?
Currently, it seems that he/she has to duplicate some of the existing
core code to get the plugin's validation code into the right place.
More information about the Pulp-dev