Greetings dear lurkers, your mad recursive algorithm fu is needed ;)

There is a long-standing design/spec for proper custom join 
conditions/options specified on the fly via search() directly in your 
join/prefetch attributes. In particular the new design calls for 
treating anything starting with a '-' in a special way. The trouble is 
that the bit implementing the join/prefetch attribute parser is... a 
little convoluted and hard to maintain.

So we need your help!

There is a failing test which codifies all the permutations of desired 
behavior in [1]. All one willing to help would need to do is to sit 
down, gut and rewrite the code in [2].

The required knowledge of the rest of DBIC internals is 0 - this bit is 
entirely standalone and decoupled from anything else going on around 
this function. The rules of the "contest"

- The proposed algorithm needs to be esier to maintain than the current 
implementation (in other words we want to avoid having to issue the same 
distress call in couple years)

- The test must pass as-is without further change requests akin to "but 
nobody is going to do that"

- It is possible that the authors missed a particular use-case: in other 
words the test in question may attain new failing units (which otoh will 
still be compatible with the general "logical spirit" of this algorithm)

- The final solution may end up being based on a submission, or may even 
end up being an amalgamation of several proposed ideas. If your solution 
is not accepted as-is and/or undergoes a significant amount of changes, 
please do not take this personally.

How to get started:

git clone git://git.shadowcat.co.uk/dbsrgits/DBIx-Class.git dbic
cd dbic
perl Makefile.PL --skip-author-deps
make installdeps        # or make listdeps | cpanm
cpan Test::Differences  # temporary dep to ease testing
prove -l t/91merge_joinpref_attr.t

Cheers and thanks in advance for your help!

[1] 
https://github.com/dbsrgits/dbix-class/blob/wip/join_prefs/t/91merge_joinpref_attr.t
[2] 
https://github.com/dbsrgits/dbix-class/blob/wip/join_prefs/lib/DBIx/Class/ResultSet.pm#L3678:L3789

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk

Reply via email to