Return-Path: X-Original-To: apmail-incubator-bloodhound-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-bloodhound-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 548C2D42A for ; Mon, 28 Jan 2013 18:28:17 +0000 (UTC) Received: (qmail 75969 invoked by uid 500); 28 Jan 2013 18:28:17 -0000 Delivered-To: apmail-incubator-bloodhound-dev-archive@incubator.apache.org Received: (qmail 75942 invoked by uid 500); 28 Jan 2013 18:28:17 -0000 Mailing-List: contact bloodhound-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: bloodhound-dev@incubator.apache.org Delivered-To: mailing list bloodhound-dev@incubator.apache.org Received: (qmail 75931 invoked by uid 99); 28 Jan 2013 18:28:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Jan 2013 18:28:17 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of olemis@gmail.com designates 209.85.223.172 as permitted sender) Received: from [209.85.223.172] (HELO mail-ie0-f172.google.com) (209.85.223.172) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Jan 2013 18:28:10 +0000 Received: by mail-ie0-f172.google.com with SMTP id c10so1173962ieb.31 for ; Mon, 28 Jan 2013 10:27:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; bh=MulBjzWhH3vMJOJCZ//EB2w1epuGXrWVWBKUrSbhwts=; b=t0+9qlA7Kgr1PwD9C72umtETQZnS4JW0x2VY6H0G3grbpO0DtUDiZVUxG56UUZM3ZY Uyzhb+/ix8hY8bkkD80yy0Bg/rsZWuUdfBBBMOjhDon6Iw0+VfdbJ/G0JXsJ6O68KFnM yBTtglXTpbBnvxmPEHK0SKlxVtLjLH1bADyHy+//iQE22wSDNARzfPXngmzchHrbDiwC DqyDmRFo02EKw9Zya/yqRhjHKWIP0qgCtBamnRoyZfV7NnbpKPaYT/YkIBgeDlFNmsgV B7hIaoBLt/QReAgqWoFDQEAT+GmrMJYwleejZKfrl/Av8zT3cC9FRl2lm126/e+Q2+Zb 2NTA== MIME-Version: 1.0 X-Received: by 10.50.222.201 with SMTP id qo9mr5614571igc.111.1359397669915; Mon, 28 Jan 2013 10:27:49 -0800 (PST) Received: by 10.50.1.44 with HTTP; Mon, 28 Jan 2013 10:27:49 -0800 (PST) In-Reply-To: References: Date: Mon, 28 Jan 2013 13:27:49 -0500 Message-ID: Subject: Re: Approach to track of plugin upgrades WAS: svn commit: r1437357 - /incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/api.py From: Olemis Lang To: bloodhound-dev@incubator.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On 1/28/13, Jose Angel Franco Navarro wrote: > Hi Peter and Olemis, :) I'm getting rid of top-posting > 2013/1/28, Peter Ko=C5=BEelj : >> I got a bit confused with the wording so would like to clarify: >> >> 1. Plugin should have one or one per component >> BaseEnvironmentSetupParticipant correct (as not one per version)? > > 1. Each plugin would have a single specialization of > BaseEnvironmentSetupParticipant. The idea is to change the class that > now implements IEnvironmentSetupParticipant to make her extend > BaseEnvironmentSetupParticipant and provide the required methods. > The code snippet in here might help to understand the whole idea . https://issues.apache.org/bloodhound/wiki/Proposals/BEP-0005#reference-impl= ementation So plugin developers are free to implement a single component responsible for updating the database and environment or multiple components . The BEP is only about the reusable framework to abstract the interactions needed to carry out upgrades . >> 2. The BaseEnvironmentSetupParticipant::get_db_setup_contributors() >> speaks >> of db scripts but actual upgrades are contained in modules. Should this >> actually be get_upgrade_modules()? > > 2. I would rather prefer to change the docstring, not to limit the > scope of the function in the future. > [...] I'm +0 about this . I'd just suggest to be consistent and keep source code readable . >> 3. What is the benefit of having new tables separate from the free db >> upgrades? > > 3. The benefits would be code reuse and higher testability of the > environment upgrade. Once the algorithm to create the schema is > stable, the plugins only provide data structures properly filled. > Repetitive code to create the tables is placed in a single place and > plugins only provide what is variable (their schema information). > I also add that it's helpful because there are well-know recovery strategies to deal with failures at table creation time . OTOH , while performing free upgrades (... and notice that I did not say *free db upgrades* considering the fact that other side effects outside DB are allowed as well in that particular case) it is much more difficult to recover from an error condition . Summarizing , it is possible to try free upgrades only after asserting that no issues regarding DB tables will be found . >> 4. If we have special support for db upgrades, have you considered havin= g >> something for ini files as well (I imagine plugins will be adding >> new/updating configuration entries as well) >> > > 4. Not evaluated till now, contributions accepted ;-) In advance I would not do so . My reasoning is the following At initial plugin installation there should be no strong reason for setting options explicitly . The =C2=ABright=C2=BB approach is to provide default=3D... keyword arg in option definition and let the configuration subsystem to fall back to this value at run-time . There's no need to add a new entry in ini files to make related option work . Later on , while performing incremental upgrades site admins might have already set the values they want , and IMO the upgrade process should not be messing around and conflict with explicit admins decisions . Anyway , if someone provides a use case , I could change my mind on the subject . We could add that later too if it proves to be really useful . --=20 Regards, Olemis.