Fwd: [Dbix-class] Breakage on .127 -> .192 upgrade

Pedro Melo melo at simplicidade.org
Fri May 20 11:58:09 GMT 2011


Hi,

On Fri, May 20, 2011 at 3:00 AM, Peter Rabbitson <rabbit+dbic at rabbit.us> wrote:
> On Fri, May 20, 2011 at 11:52:18AM +1000, Toby Corkindale wrote:
>> Hi,
>> I don't know how I failed to pick this up during the testing period
>> for the .19x versions.
>>
>> I have some code that fails on dbic .192, but works when rolled back to .127.
>> The failure is due to the Result class defining some accessors with
>> mk_classdata() which are referred to from within a sqlt_deploy_hook()
>> method.
>
> Known embarrassing regression (I made an incorrect assumption and noone caught
> it after the fact). Look forward to 0.08193 by Monday the latest.

Peter, I was one of the persons who reported this on IRC.

I said I was going to provide a test case and a patch but I can only
work on non-work stuff on the weekends. I was planning on working on
this on saturday but from your answer I assume that something is
already in the pipeline.

I'll check the git repo for the latest commits as soon as
git.shadowcat.co.uk is back up on DNS.

In the meantime, I reverted the commit like this for my personal use:

https://github.com/melo/dbix-class/commit/ffdb8e2d7e01cc2a8d3b920c43c2d67c6748b988

The important feature for me was making sure that sql_deploy_hook()
chaining, using next::method or next::can, worked, so that I could
have several components using it.

When I was looking at the code to figure why this had stop working, I
noticed that to a component, the whole sql_deploy_hook() setup is very
fragile. If a resultsource changes the sqlt_deploy_callback(), the
sql_deploy_hook() chain will never be called.

It would be better for component writers had a hook point that is
always called. Given that it would be a new hook point we can make
sure it has the proper signature. It would be called in
DBIx::Class::ResultSource::_invoke_sqlt_deploy_hook as the last thing
like this:

  my $class = $self->result_class;
  $class->new_name_for_new_sql_deploy_hook($self, @_) if $class;

What do you think?

Thanks,
-- 
Pedro Melo
http://www.simplicidade.org/
xmpp:melo at simplicidade.org
mailto:melo at simplicidade.org



More information about the DBIx-Class mailing list