<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 9 March 2017 at 17:19, Dougal Matthews <span dir="ltr"><<a href="mailto:dougal@redhat.com" target="_blank">dougal@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On 9 March 2017 at 04:35, Ryan Brady <span dir="ltr"><<a href="mailto:rbrady@redhat.com" target="_blank">rbrady@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">At the PTG and previous discussions in IRC, I mentioned there were two different design ideas I had for the developer experience for custom action development in mistral-lib.  The purpose and intent behind the patch[1] was discussed in person at the PTG and that was helpful for me wrt to scope.  I feel it would be helpful to discuss and decide together the final piece of this patch.  I'd like to get any feedback on either of these two ideas as they will shape how developers integrate with Mistral in the future, impact our OpenStack integration efforts in mistral-extra.  Nothing stops a developer from adopting either style in their custom action libraries, but most will likely want to remain consistent with style present in the upstream code.<div><br></div><div>I have created separate declaration and usage examples in hopes of illustrating some of the similarities and differences.  To me it seems the base class example is more declarative/explicit, but the mixin example is more extensible and dry.  Both examples reflect on backwards compatibility and possible changes to how mistral checks for sync/async actions and how to pass the context (as needed by actions that integrate with OpenStack).<div><br clear="all"><div><br></div><div>base classes declaration: <a href="https://gist.github.com/rbrady/ff86c484e8e6e53ba2dc3dfa17b01b09" target="_blank">https://gist.gith<wbr>ub.com/rbrady/ff86c484e8e6e53b<wbr>a2dc3dfa17b01b09</a></div><div><br></div><div>base class usage: <a href="https://gist.github.com/rbrady/716a02fb2bd38d822c6df8bd642d3ea6" target="_blank">https://gist.github.com<wbr>/rbrady/716a02fb2bd38d822c6df8<wbr>bd642d3ea6</a></div></div></div></div></blockquote><div><br></div></span><div>The base class approach gets my vote for two reasons:<br><br></div><div>1. It is the simplest to use and document.<br></div><div>2. I don't think we have enough combinations (yet?) to warrant mixins.<br></div></div></div></div></blockquote><div><br></div><div>3. The set_context method on the mixin isn't as clear as passing it to run. Imagine I am scanning your code, I can see from the run that the context is passed in. I don't need to look for the base class and look to see if self.context is used.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><div dir="ltr"><div><div><div><br></div><div>mixins declaration: <a href="https://gist.github.com/rbrady/d30ae640b19df658a17cd93827125678" target="_blank">https://gist.gith<wbr>ub.com/rbrady/d30ae640b19df658<wbr>a17cd93827125678</a></div><div><br></div><div>mixins usage: <a href="https://gist.github.com/rbrady/248cb52d5c5f94854d8c76eee911ce8e" target="_blank">https://gist.github.com<wbr>/rbrady/248cb52d5c5f94854d8c76<wbr>eee911ce8e</a></div><div><br></div><div><br></div><div>Thanks,</div><div><br></div><div>Ryan</div><span class="m_-3195621816661594875HOEnZb"><font color="#888888"><div><br></div>-- <br><div class="m_-3195621816661594875m_5290108267900885038gmail_signature"><div dir="ltr">Ryan Brady<div>Cloud Engineering</div><div><a href="mailto:rbrady@redhat.com" target="_blank">rbrady@redhat.com</a> </div><div><a href="tel:(919)%20890-8925" value="+19198908925" target="_blank">919.890.8925</a></div><div><br></div><div><br></div><div>[1] <a href="https://review.openstack.org/#/c/411412/" target="_blank">https://review.openstack.o<wbr>rg/#/c/411412/</a><br></div></div></div>
</font></span></div></div></div>
<br></span>______________________________<wbr>______________________________<wbr>______________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.op<wbr>enstack.org?subject:unsubscrib<wbr>e</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi<wbr>-bin/mailman/listinfo/openstac<wbr>k-dev</a><br>
<br></blockquote></div><br></div></div>
</blockquote></div><br></div></div>