Thread: [Perl-workflow-devel] in 1.32 add_config does not work for condition
Brought to you by:
jonasbn
From: Sergei V. <sv...@pn...> - 2009-04-16 22:03:01
|
Hi, A tiresome problem has knocked me after a move to ver. 1.32. Let @entry be something like my @entry = ({ name => 'some name', class => 'some class', ... }); Then a call $factory->add_config( persister => \@entry ); is similar to those used in some of the tests supplied with ver 1.32 and works fine. But a call $factory->add_config( condition => \@entry ); has no analog in the supplied tests and seems not working. That is no data structures associated with condition are created. This could be explicitly verified with use of print STDERR Dumper($factory)."\n"; after calling add_config. This problem was absent in ver 0.31. This problem prevents correct start of the OpenXPKI server (which is a PKI related project) with default configuration files related to its workflows. Do you think this could be a bug, or just a new feature? If the latter, could you please recommend a correct way to add configuration for a condition. Note that OpenXPKI uses both add_config and also add_config_from_file (which works fine) because of historical reasons. If add_config is out of fashion today, do you think that OpenXPKI should completely migrate to add_config_from_file? This would be quite a job to do though. All the best, Sergei P.S. Adding config for action seems to have similar problems. And for validator too... |
From: Jim B. <cb...@bu...> - 2009-04-17 11:16:31
|
Sergei, Could you add some tests to the test file you found that demonstrate this problem? It sounds like you may have already done this as part of your testing and it would be really helpful to have the tests. Thanks, Jim Sergei Vyshenski wrote: > Hi, > > A tiresome problem has knocked me after a move to ver. 1.32. > > Let @entry be something like > > my @entry = ({ > name => 'some name', > class => 'some class', > ... > }); > > Then a call > > $factory->add_config( persister => \@entry ); > > is similar to those used in some of the tests supplied with ver 1.32 and > works fine. But a call > > $factory->add_config( condition => \@entry ); > > has no analog in the supplied tests and seems not working. That is no > data structures associated with condition are created. This could be > explicitly verified with use of > > print STDERR Dumper($factory)."\n"; > > after calling add_config. > > This problem was absent in ver 0.31. > > This problem prevents correct start of the OpenXPKI server (which is a > PKI related project) with default configuration files related to its > workflows. > > Do you think this could be a bug, or just a new feature? > If the latter, could you please recommend a correct way to add > configuration for a condition. > > Note that OpenXPKI uses both add_config and also add_config_from_file > (which works fine) because of historical reasons. If add_config is out > of fashion today, do you think that OpenXPKI should completely migrate > to add_config_from_file? This would be quite a job to do though. > > All the best, Sergei > > P.S. Adding config for action seems to have similar problems. And for > validator too... > > > ------------------------------------------------------------------------------ > Stay on top of everything new and different, both inside and > around Java (TM) technology - register by April 22, and save > $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. > 300 plus technical and hands-on sessions. Register today. > Use priority code J9JMT32. http://p.sf.net/sfu/p > _______________________________________________ > Perl-workflow-devel mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-workflow-devel -- Jim Brandt Administrative Computing Services University at Buffalo |
From: Sergei V. <sv...@pn...> - 2009-04-17 13:42:56
Attachments:
add_config.t
|
Hi, Jim Brandt wrote: > Could you add some tests to the test file you found that demonstrate > this problem? It sounds like you may have already done this as part of > your testing and it would be really helpful to have the tests. Yes, please find attached file, which runs ok with 0.31 and fails with 1.32. Maybe the following could be of help. On the way from 0.31 to 1.32 a function _add_condition_config was changed in such a way, that now it has one extra "foreach". And now the arguments (which add_config passes to the _add_condition_config function) happen to be _not_ compatible with this extra "foreach". All the best, Sergei |
From: Jonas B. N. <jo...@gm...> - 2009-04-17 13:49:36
|
Hi Sergei, Marvellous - sorry for breaking your end though. I will look into it ASAP. jonasbn On 17/04/2009, at 15.42, Sergei Vyshenski wrote: > Hi, > > Jim Brandt wrote: >> Could you add some tests to the test file you found that demonstrate >> this problem? It sounds like you may have already done this as part >> of >> your testing and it would be really helpful to have the tests. > > Yes, please find attached file, which runs ok with 0.31 and fails > with 1.32. > > Maybe the following could be of help. > > On the way from 0.31 to 1.32 a function _add_condition_config was > changed in such a way, that now it has one extra "foreach". And now > the arguments (which add_config passes to the _add_condition_config > function) happen to be _not_ compatible with this extra "foreach". > > All the best, Sergei > > > # -*-perl-*- > > use strict; > use lib 't'; > use TestUtil; > use constant NUM_TESTS => 3; > use Test::More; > use Test::Exception; > > plan tests => NUM_TESTS; > > require Workflow::Factory; > > my @conditions = ({ > name => 'HasUser', > class => 'TestApp::Condition::HasUser' > }); > > my @actions = ({ > name => 'TIX_NEW', > class => 'TestApp::Action::TicketCreate' > }); > > my $factory = Workflow::Factory->instance(); > > is( ref( $factory ), 'Workflow::Factory', > 'Return from instance() correct type' ); > > $factory->add_config( condition => \@conditions ); > lives_ok{$factory->get_condition('HasUser')}; > > $factory->add_config( action => \@actions ); > ok(exists $factory->{_action_config}, "action config added"); > > ------------------------------------------------------------------------------ > Stay on top of everything new and different, both inside and > around Java (TM) technology - register by April 22, and save > $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. > 300 plus technical and hands-on sessions. Register today. > Use priority code J9JMT32. http://p.sf.net/sfu/p_______________________________________________ > Perl-workflow-devel mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-workflow-devel |
From: Jonas B. N. <jo...@gm...> - 2009-04-18 20:34:47
|
Hi Sergei, I have just uploaded release 1.33_3 to CPAN, it addresses your problem. Looking forward to your feedback. Thanks for the code snippet below, it really made it easier to proceed. The code is also available from Subversion, in the branch: add_config_bug, which is a branch based on 1.32. jonasbn On 17/04/2009, at 15.42, Sergei Vyshenski wrote: > Hi, > > Jim Brandt wrote: >> Could you add some tests to the test file you found that demonstrate >> this problem? It sounds like you may have already done this as part >> of >> your testing and it would be really helpful to have the tests. > > Yes, please find attached file, which runs ok with 0.31 and fails > with 1.32. > > Maybe the following could be of help. > > On the way from 0.31 to 1.32 a function _add_condition_config was > changed in such a way, that now it has one extra "foreach". And now > the arguments (which add_config passes to the _add_condition_config > function) happen to be _not_ compatible with this extra "foreach". > > All the best, Sergei > > > # -*-perl-*- > > use strict; > use lib 't'; > use TestUtil; > use constant NUM_TESTS => 3; > use Test::More; > use Test::Exception; > > plan tests => NUM_TESTS; > > require Workflow::Factory; > > my @conditions = ({ > name => 'HasUser', > class => 'TestApp::Condition::HasUser' > }); > > my @actions = ({ > name => 'TIX_NEW', > class => 'TestApp::Action::TicketCreate' > }); > > my $factory = Workflow::Factory->instance(); > > is( ref( $factory ), 'Workflow::Factory', > 'Return from instance() correct type' ); > > $factory->add_config( condition => \@conditions ); > lives_ok{$factory->get_condition('HasUser')}; > > $factory->add_config( action => \@actions ); > ok(exists $factory->{_action_config}, "action config added"); > > ------------------------------------------------------------------------------ > Stay on top of everything new and different, both inside and > around Java (TM) technology - register by April 22, and save > $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. > 300 plus technical and hands-on sessions. Register today. > Use priority code J9JMT32. http://p.sf.net/sfu/p_______________________________________________ > Perl-workflow-devel mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-workflow-devel |
From: Sergei V. <sv...@pn...> - 2009-04-29 00:34:31
|
Hi Jonas, Thank you very much for your patch. I have submitted minimalistic version of it to a FreeBSD distribution of Workflow: http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/p5-Workflow/files/patch-lib-Workflow-Factory.pm?rev=1.1 Now the FreeBSD port is numbered 1.32_1 which is understood by FreeBSD conventions as "revision 1 of release 1.32". The reason why I took such a liberty, is that FreeBSD prefers monotonous alfa-numeric numbering of versions. This is essential for automatic audit and upgrade procedures. But (if my guess is correct) you decided to number developer releases in another (non-monotonous) way. Do you think that maybe in the future the following could be more simple and intuitive scheme: 1.32 - release 1.32.1 - development atop of 1.32 (branch based on 1.32) 1.32.1.1 - development atop of 1.32.1 (branch based on 1.32.1) 1.32.2 - another development atop of 1.32 ... 1.33 - release 1.33.1 - development atop of 1.33 etc All the best, Sergei Jonas Brømsø Nielsen wrote: > I have just uploaded release 1.33_3 to CPAN, it addresses your problem. > Looking forward to your feedback. > > The code is also available from Subversion, in the branch: > add_config_bug, which is a branch based on 1.32. |
From: Jonas B. N. <jo...@gm...> - 2009-06-15 20:46:07
|
Hi Sergei, Just be aware that our developer releases, are developer releases, so distributing the major releases is more safe, If you fall over something that needs immediate attention, just let me know and we can speed things up, it is often just a question of prioritization. jonasbn On 29/04/2009, at 02.32, Sergei Vyshenski wrote: > Hi Jonas, > > Thank you very much for your patch. > > I have submitted minimalistic version of it to a FreeBSD > distribution of > Workflow: > > http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/p5-Workflow/files/patch-lib-Workflow-Factory.pm?rev=1.1 > > Now the FreeBSD port is numbered 1.32_1 which is understood by FreeBSD > conventions as "revision 1 of release 1.32". > > The reason why I took such a liberty, is that FreeBSD prefers > monotonous > alfa-numeric numbering of versions. This is essential for automatic > audit and upgrade procedures. But (if my guess is correct) you decided > to number developer releases in another (non-monotonous) way. > > Do you think that maybe in the future the following could be more > simple > and intuitive scheme: > > 1.32 - release > 1.32.1 - development atop of 1.32 (branch based on 1.32) > 1.32.1.1 - development atop of 1.32.1 (branch based on 1.32.1) > 1.32.2 - another development atop of 1.32 > ... > 1.33 - release > 1.33.1 - development atop of 1.33 > etc > > All the best, Sergei > > > Jonas Brømsø Nielsen wrote: >> I have just uploaded release 1.33_3 to CPAN, it addresses your >> problem. >> Looking forward to your feedback. >> >> The code is also available from Subversion, in the branch: >> add_config_bug, which is a branch based on 1.32. > |
From: Jonas B. N. <jo...@gm...> - 2009-04-17 11:37:52
|
Hi Sergei, It has not been our goal to break backwards compatibility, since we aim for stability, So if this has work earlier it sounds like we have introduced a bug. I will investigate over the weekend and get back to you. jonasbn On 17/04/2009, at 00.01, Sergei Vyshenski wrote: > Hi, > > A tiresome problem has knocked me after a move to ver. 1.32. > > Let @entry be something like > > my @entry = ({ > name => 'some name', > class => 'some class', > ... > }); > > Then a call > > $factory->add_config( persister => \@entry ); > > is similar to those used in some of the tests supplied with ver 1.32 > and > works fine. But a call > > $factory->add_config( condition => \@entry ); > > has no analog in the supplied tests and seems not working. That is no > data structures associated with condition are created. This could be > explicitly verified with use of > > print STDERR Dumper($factory)."\n"; > > after calling add_config. > > This problem was absent in ver 0.31. > > This problem prevents correct start of the OpenXPKI server (which is a > PKI related project) with default configuration files related to its > workflows. > > Do you think this could be a bug, or just a new feature? > If the latter, could you please recommend a correct way to add > configuration for a condition. > > Note that OpenXPKI uses both add_config and also add_config_from_file > (which works fine) because of historical reasons. If add_config is out > of fashion today, do you think that OpenXPKI should completely migrate > to add_config_from_file? This would be quite a job to do though. > > All the best, Sergei > > P.S. Adding config for action seems to have similar problems. And for > validator too... > > > ------------------------------------------------------------------------------ > Stay on top of everything new and different, both inside and > around Java (TM) technology - register by April 22, and save > $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. > 300 plus technical and hands-on sessions. Register today. > Use priority code J9JMT32. http://p.sf.net/sfu/p > _______________________________________________ > Perl-workflow-devel mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-workflow-devel |