svn commit: r1423779 - in /incubator/bloodhound/branches/bep_0003_multiproduct/installer: requirements-dev.txt requirements.txt

2012-12-19 Thread jure
Author: jure
Date: Wed Dec 19 08:04:07 2012
New Revision: 1423779

URL: http://svn.apache.org/viewvc?rev=1423779view=rev
Log:
sqlparse requirement added - required by the SQL database proxy component


Modified:

incubator/bloodhound/branches/bep_0003_multiproduct/installer/requirements-dev.txt

incubator/bloodhound/branches/bep_0003_multiproduct/installer/requirements.txt

Modified: 
incubator/bloodhound/branches/bep_0003_multiproduct/installer/requirements-dev.txt
URL: 
http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/installer/requirements-dev.txt?rev=1423779r1=1423778r2=1423779view=diff
==
--- 
incubator/bloodhound/branches/bep_0003_multiproduct/installer/requirements-dev.txt
 (original)
+++ 
incubator/bloodhound/branches/bep_0003_multiproduct/installer/requirements-dev.txt
 Wed Dec 19 08:04:07 2012
@@ -17,6 +17,7 @@
 
 Pygments
 pytz
+sqlparse
 Babel
 Genshi
 -e ../trac

Modified: 
incubator/bloodhound/branches/bep_0003_multiproduct/installer/requirements.txt
URL: 
http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/installer/requirements.txt?rev=1423779r1=1423778r2=1423779view=diff
==
--- 
incubator/bloodhound/branches/bep_0003_multiproduct/installer/requirements.txt 
(original)
+++ 
incubator/bloodhound/branches/bep_0003_multiproduct/installer/requirements.txt 
Wed Dec 19 08:04:07 2012
@@ -17,6 +17,7 @@
 
 Pygments
 pytz
+sqlparse
 Babel
 Genshi
 ../trac




[Apache Bloodhound] Deleted User: twodaemon

2012-12-19 Thread Apache Bloodhound
Deleted User for user twodaemon

--
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound (incubating) issue tracker



[Apache Bloodhound] Proposals/BEP-0003 modified

2012-12-19 Thread Apache Bloodhound
Page Proposals/BEP-0003 was changed by jure
Diff URL: 
https://issues.apache.org/bloodhound/wiki/Proposals/BEP-0003?action=diffversion=23
Revision 23
Comment: Legacy schema compatibility
Changes:
---8--8--8--8--8--8--8--8
Index: Proposals/BEP-0003
=
--- Proposals/BEP-0003 (version: 22)
+++ Proposals/BEP-0003 (version: 23)
@@ -167,6 +167,226 @@
 
 Another change required is the change of the fore mentioned table keys. As it 
currently stands, the key used in these tables is limited to the 'name' field. 
As this (in the modified schema) prevents users from creating 
versions/milestones/... with the same name for different products, key should 
be extended with the 'product' field.
 
+ Legacy schema compatibility
+
+As changing trac database schema (by adding product column) to the required 
tables will brake compatibility with existing trac code/3rd party plugins, a 
solution is required to solve that.
+
+Requirements for this solution:
+* no code changes are required within trac/3rd party plugins to operate within 
this new schema/environment
+* trac/3rd party plugins should see a view of the database depending on what 
product scope is currently active
+
+As existing trac/3rd party plugin code should remain unchanged, the only way 
of accomplishing legacy compatibility with the new database schema is to 
develop a component, that installs itself directly above the database access 
layer. By intercepting SQL statements and transforming them, trac/3rd party 
plugins are given a view of the database that corresponds to the currently 
active product scope. 
+
+Currently all database access is handled by trac class `IterableCursor`. A new 
class is implemented called `BloodhoundIterableCursor` that replaces the 
`IterableCursor` in runtime.
+
+Functionality of this class is the following:
+* parse SQLs targeted at the database
+* depending to which table the SQL is targeted, the following transformation 
is done on the SQL
+  * for system tables or tables that do not require productization, SQL is 
passed unchanged
+  * for 'productized' trac tables mentioned above, a product view of the table 
is presented to the code
+* only DML statements (SELECT, INSERT, UPDATE, DELETE) are translated
+  * queries targeted at 3rd party plugin tables are modified to prefix 3rd 
party plugin table names with product prefix
+* in addition to DML, DDL statements (CREATE TABLE/INDEX, ALTER 
TABLE/CONSTRAINT, DROP TABLE) are also translated
+
+= trac tables
+
+Some examples:
+
+**SELECT**
+
+A query targeted at productized trac tables:
+
+{{{#!sql
+SELECT COUNT(*)
+FROM
+  (SELECT t.id AS id,
+  t.summary AS summary,
+  t.owner AS OWNER,
+  t.status AS status,
+  t.priority AS priority,
+  t.milestone AS milestone,
+  t.time AS time,
+  t.changetime AS changetime,
+  priority.value AS priority_value
+   FROM ticket AS t
+   LEFT OUTER JOIN enum AS priority ON (priority.type='priority'
+AND priority.name=priority)
+   LEFT OUTER JOIN milestone ON (milestone.name=milestone)
+   WHERE ((COALESCE(t.status,'')!=%s)
+  AND (COALESCE(t.OWNER,'')=%s))
+   ORDER BY COALESCE(t.milestone,'')='',
+COALESCE(milestone.completed,0)=0,
+milestone.completed,
+COALESCE(milestone.due,0)=0,
+milestone.due,
+t.milestone,
+COALESCE(priority.value,'')='' DESC,
+CAST(priority.value AS integer) DESC,
+t.id) AS x
+}}}
+
+... would be, when executed within 'MYPRODUCT' scope, translated into ...
+
+{{{#!sql
+SELECT COUNT(*)
+FROM
+  (SELECT t.id AS id,
+  t.summary AS summary,
+  t.owner AS OWNER,
+  t.status AS status,
+  t.priority AS priority,
+  t.milestone AS milestone,
+  t.time AS time,
+  t.changetime AS changetime,
+  priority.value AS priority_value
+   FROM
+ (SELECT *
+  FROM ticket
+  WHERE product=MYPRODUCT) AS t
+   LEFT OUTER JOIN
+ (SELECT *
+  FROM enum
+  WHERE product=MYPRODUCT) AS priority ON (priority.type='priority'
+ AND priority.name=priority)
+   LEFT OUTER JOIN
+ (SELECT *
+  FROM milestone
+  WHERE product=MYPRODUCT) AS milestone ON (milestone.name=milestone)
+   WHERE ((COALESCE(t.status,'')!=%s)
+  AND (COALESCE(t.OWNER,'')=%s))
+   ORDER BY COALESCE(t.milestone,'')='',
+COALESCE(milestone.completed,0)=0,
+milestone.completed,
+COALESCE(milestone.due,0)=0,
+milestone.due,
+t.milestone,
+COALESCE(priority.value,'')='' DESC,
+CAST(priority.value AS integer) DESC,
+t.id) AS x
+}}}
+
+**INSERT**
+
+INSERTs are translated by adding 'product' column with 

[Apache Bloodhound] Proposals/BEP-0003 modified

2012-12-19 Thread Apache Bloodhound
Page Proposals/BEP-0003 was changed by jure
Diff URL: 
https://issues.apache.org/bloodhound/wiki/Proposals/BEP-0003?action=diffversion=24
Revision 24
Comment: Legacy schema compatibility typos ...
Changes:
---8--8--8--8--8--8--8--8
Index: Proposals/BEP-0003
=
--- Proposals/BEP-0003 (version: 23)
+++ Proposals/BEP-0003 (version: 24)
@@ -353,13 +353,13 @@
 GROUP BY bklg_id, status
 }}}
 
-***UPDATE, DELETE, INSERT***
+**UPDATE, DELETE, INSERT**
 
 UPDATE, DELETE and INSERT statements are not modified for 3rd party plugin
 tables, except for prefixing the table name with the active scope product
 prefix.
 
-***CREATE, ALTER, DROP***
+**CREATE, ALTER, DROP**
 
 For 3rd party plugin tables, DDL SQLs are also translated by prefixing table
 names and constraint names.
---8--8--8--8--8--8--8--8

--
Page URL: https://issues.apache.org/bloodhound/wiki/Proposals/BEP-0003
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound (incubating) issue tracker

This is an automated message. Someone added your email address to be
notified of changes on 'Proposals/BEP-0003' page.
If it was not you, please report to .


Re: [Apache Bloodhound] #312: Configure ticket fields in create ticket shortcut

2012-12-19 Thread Apache Bloodhound
#312: Configure ticket fields in create ticket shortcut
--+
  Reporter:  olemis   |  Owner:  gjm
  Type:  enhancement  | Status:  review
  Priority:  major|  Milestone:
 Component:  ui design|Version:
Resolution:   |   Keywords:  ticket qct
--+

Comment (by olemis):

 Replying to [comment:3 rjollos]:
  This is a redundant comment with what I said in #168, but I favor this
 change.

 what comment exactly ?

  I'd suggest an option that is more descriptive than `shorcut_fields`
 though. In my original patch for #168,

 Sorry . As it was closed:wontfix I didn't follow . Now I see that some
 things like milestone permissions are relevant here too . Could you please
 take a look and either update patch or provide another on top ?

  I named it `quick_create_fields`. I think `quick_ticket_fields` is
 better though.
 

 +1 that's a better name , please change it

  Olemis: I think you may have intended to point to
 [/attachment/ticket/234/t234_r1423108_qct_desc_v2.diff this patch].
 

 well , afaics that patch only adds description box . This ticket is about
 the controls below which is implemented in ...link_n_fields... patch .
 cmiiw

  If we allow this degree of configuration, we may want to go a step
 further remove the restriction on select fields eventually. What is the
 motivation for imposing that restriction at this time?

 Currently the template only renders select controls . I was just trying to
 ensure that such logic would not be applied to e.g. a boolean field ;) .
 I'm not against adding further field types in there , thereby complicating
 template code, if there is a good reason to do so . However IMO that's
 better tackled in a separate ticket . What d'u you think ?

  We should mention in the doc string for the option that this restriction
 is in place, otherwise users might think it is a bug when they try to add
 a custom text field to the quick ticket form. This should be an easy
 change for the committer to make, no need to refresh the patch.

 +1

-- 
Ticket URL: https://issues.apache.org/bloodhound/ticket/312#comment:4
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound (incubating) issue tracker


Re: [Apache Bloodhound] #313: Diff CSS includes margin at the top of sticky panel

2012-12-19 Thread Apache Bloodhound
#313: Diff CSS includes margin at the top of sticky panel
+--
  Reporter:  olemis |  Owner:  nobody
  Type:  defect | Status:  new
  Priority:  trivial|  Milestone:  Release 4
 Component:  ui design  |Version:
Resolution: |   Keywords:  diff css bootstrap affix starter
+--

Comment (by olemis):

 Replying to [comment:3 rjollos]:
  I can see the issue present in #234, but not in #312. Any idea of why
 that is?

 Because diff.css is not included in #312 ? I mean there's no inline
 diff/patch rendered in #321 .

-- 
Ticket URL: https://issues.apache.org/bloodhound/ticket/313#comment:4
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound (incubating) issue tracker


Re: [Apache Bloodhound] #312: Configure ticket fields in create ticket shortcut

2012-12-19 Thread Apache Bloodhound
#312: Configure ticket fields in create ticket shortcut
--+
  Reporter:  olemis   |  Owner:  gjm
  Type:  enhancement  | Status:  review
  Priority:  major|  Milestone:
 Component:  ui design|Version:
Resolution:   |   Keywords:  ticket qct
--+

Comment (by olemis):

 Replying to [comment:4 olemis]:
  Replying to [comment:3 rjollos]:
 
 [...]
   Olemis: I think you may have intended to point to
 [/attachment/ticket/234/t234_r1423108_qct_desc_v2.diff this patch].
  
 
  well , afaics that patch only adds description box . This ticket is
 about the controls below which is implemented in ...link_n_fields... patch
 . cmiiw
 

 oh ! now I notice . While working with my hg patch queue I didn't notice
 this hunk was not in the right place . Sorry and thanks .

 /me fixing ...

 [...]

-- 
Ticket URL: https://issues.apache.org/bloodhound/ticket/312#comment:5
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound (incubating) issue tracker


Re: [Apache Bloodhound] #234: Quick Ticket: link to /newticket, description and priority

2012-12-19 Thread Apache Bloodhound
#234: Quick Ticket: link to /newticket, description and priority
--+-
  Reporter:  jdreimann|  Owner:  gjm
  Type:  enhancement  | Status:  review
  Priority:  critical |  Milestone:
 Component:  ui design|Version:
Resolution:   |   Keywords:  starter
--+-

Comment (by olemis):

 refreshed patches considering [comment:3:ticket:312 rjollos comment]

-- 
Ticket URL: https://issues.apache.org/bloodhound/ticket/234#comment:13
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound (incubating) issue tracker


Re: [Apache Bloodhound] #312: Configure ticket fields in create ticket shortcut

2012-12-19 Thread Apache Bloodhound
#312: Configure ticket fields in create ticket shortcut
--+
  Reporter:  olemis   |  Owner:  gjm
  Type:  enhancement  | Status:  review
  Priority:  major|  Milestone:
 Component:  ui design|Version:
Resolution:   |   Keywords:  ticket qct
--+

Comment (by olemis):

 Patches for #234 updated after [comment:13:ticket:234 this comment] .

-- 
Ticket URL: https://issues.apache.org/bloodhound/ticket/312#comment:6
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound (incubating) issue tracker


[Apache Bloodhound] #314: Add a very basic way to create and load fixtures from bloodhound environments

2012-12-19 Thread Apache Bloodhound
#314: Add a very basic way to create and load fixtures from bloodhound
environments
-+---
 Reporter:  gjm  |  Owner:  gjm
 Type:  enhancement  | Status:  new
 Priority:  major|  Milestone:  Release 4
Component:  dashboard|Version:
 Keywords:   |
-+---
 Nothing too clever for now - just get most of the relevant data out into a
 json dump file and allow it to be loaded into a new environment

-- 
Ticket URL: https://issues.apache.org/bloodhound/ticket/314
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound (incubating) issue tracker


Re: [Apache Bloodhound] #115: Product-specific settings

2012-12-19 Thread Apache Bloodhound
#115: Product-specific settings
-+-
  Reporter:  olemis  |  Owner:  olemis
  Type:  | Status:  accepted
  enhancement|  Milestone:
  Priority:  major   |Version:
 Component:  |   Keywords:  multiproduct environment
  multiproduct   |  configuration database bep-0003
Resolution:  |
-+-

Comment (by olemis):

 I'll be developing this in [https://bitbucket.org/olemis/bloodhound-mq my
 patch queue @ Bitbucket] in [https://bitbucket.org/olemis/bloodhound-
 mq/commits/all/tip/branch(%22t115_product_env%22) branch t115_product_env]

-- 
Ticket URL: https://issues.apache.org/bloodhound/ticket/115#comment:4
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound (incubating) issue tracker


Re: [Apache Bloodhound] #313: Diff CSS includes margin at the top of sticky panel

2012-12-19 Thread Apache Bloodhound
#313: Diff CSS includes margin at the top of sticky panel
+--
  Reporter:  olemis |  Owner:  nobody
  Type:  defect | Status:  new
  Priority:  trivial|  Milestone:  Release 4
 Component:  ui design  |Version:
Resolution: |   Keywords:  diff css bootstrap affix starter
+--

Comment (by rjollos):

 Thanks that makes sense, and is well explained in the ticket. I hadn't
 read this carefully enough.

-- 
Ticket URL: https://issues.apache.org/bloodhound/ticket/313#comment:5
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound (incubating) issue tracker


Re: [Apache Bloodhound] #313: Diff CSS includes margin at the top of sticky panel

2012-12-19 Thread Apache Bloodhound
#313: Diff CSS includes margin at the top of sticky panel
+--
  Reporter:  olemis |  Owner:  nobody
  Type:  defect | Status:  new
  Priority:  trivial|  Milestone:  Release 4
 Component:  ui design  |Version:
Resolution: |   Keywords:  diff css bootstrap affix starter
+--

Comment (by rjollos):

 Replying to [comment:5 rjollos]:
  Thanks, that makes sense, and is well explained in the ticket. I hadn't
 read this carefully enough.

-- 
Ticket URL: https://issues.apache.org/bloodhound/ticket/313#comment:6
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound (incubating) issue tracker


svn commit: r1424271 - /incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/model.py

2012-12-19 Thread gjm
Author: gjm
Date: Thu Dec 20 02:29:28 2012
New Revision: 1424271

URL: http://svn.apache.org/viewvc?rev=1424271view=rev
Log:
adding the ability to output schema to ModelBase in terms of trac's Table and 
Column for consistency of dump generation across trac and bh schema - towards 
#314

Modified:
incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/model.py

Modified: incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/model.py
URL: 
http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/model.py?rev=1424271r1=1424270r2=1424271view=diff
==
--- incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/model.py 
(original)
+++ incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/model.py Thu 
Dec 20 02:29:28 2012
@@ -16,6 +16,7 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
+from trac.db import Table, Column
 from trac.core import TracError
 from trac.resource import ResourceNotFound
 from trac.ticket.api import TicketSystem
@@ -224,4 +225,14 @@ class ModelBase(object):
 model.__init__(env, data)
 rows.append(model)
 return rows
+
+@classmethod
+def _get_fields(cls):
+return cls._meta['key_fields']+cls._meta['non_key_fields']
+
+@classmethod
+def _get_schema(cls):
+fields =  [Column(field) for field in cls._get_fields()]
+return Table(cls._meta['table_name'], key=set(cls._meta['key_fields'] +
+cls._meta['unique_fields'])) [fields]
 




Re: [Apache Bloodhound] #312: Configure ticket fields in create ticket shortcut

2012-12-19 Thread Apache Bloodhound
#312: Configure ticket fields in create ticket shortcut
--+
  Reporter:  olemis   |  Owner:  gjm
  Type:  enhancement  | Status:  review
  Priority:  major|  Milestone:
 Component:  ui design|Version:
Resolution:   |   Keywords:  ticket qct
--+

Comment (by rjollos):

 Replying to [comment:4 olemis]:
  Replying to [comment:3 rjollos]:
   This is a redundant comment with what I said in #168, but I favor this
 change.
 
  what comment exactly ?

 I worded that poorly. I was just saying that I was being redundant here,
 by once again expressing my favor for this changes, as I had done in #168.
 I wasn't saying this ticket was redundant or anything like that.

  I'm not against adding further field types in there , thereby
 complicating template code, if there is a good reason to do so . However
 IMO that's better tackled in a separate ticket . What d'u you think ?

 Yeah, I agree it would be better handled in a separate ticket. I hadn't
 thought about the need to add support in the template.

-- 
Ticket URL: https://issues.apache.org/bloodhound/ticket/312#comment:7
Apache Bloodhound https://issues.apache.org/bloodhound/
The Apache Bloodhound (incubating) issue tracker