Hi Brian, 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. > [3]https://github.com/dralley/pulp_file/compare/typed-repositories...bm > bouter:plugin-finalize-no-context-manager > 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() in SingleArtifactContentUploadSerializer. 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. _______________________________________________ Pulp-dev mailing list Pulp-dev@redhat.com https://www.redhat.com/mailman/listinfo/pulp-dev