Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update plugins from old plugin system to new plugin system #1078

Open
xsawyerx opened this issue Dec 26, 2015 · 90 comments
Open

Update plugins from old plugin system to new plugin system #1078

xsawyerx opened this issue Dec 26, 2015 · 90 comments

Comments

@xsawyerx
Copy link
Member

xsawyerx commented Dec 26, 2015

This is a ticket to track all the plugins that do not work on the new plugin system and also which ones have been converted to pure plugin2.

Release OK or fixed/PR in repo: 61/68 ~ 90%

👍 Latest release OK (59/68):
plugin Plugin2 only? Release Repo
Adapter no CPAN Github
Ajax 👍 CPAN Github
Articulate no CPAN Github
Auth::Extensible 👍 CPAN Github
Auth::Extensible::Provider::Database 👍 CPAN Github
Auth::Extensible::Provider::DBIC 👍 CPAN Github
Auth::Extensible::Provider::Usergroup 👍 CPAN Github
Auth::HTTP::Basic::DWIW no CPAN Github
Auth::OAuth no CPAN Github
Auth::Tiny PR CPAN Github
BrowserDetect PR CPAN Github
Cache::CHI no CPAN Github
Captcha no CPAN Github
Cart 👍 CPAN Github
Chain no CPAN Github
ConditionalCaching no CPAN Github
Database no CPAN Github
DataTransposeValidator no CPAN Github
DBIC no CPAN Github
Deferred 👍 CPAN Github
ElasticSearch no CPAN Github
Email 👍 CPAN Github
Emailesque no CPAN GitHub : visual verification (no tests)
EncryptID 👍 CPAN Github
Feed no CPAN Github
Flash 👍 CPAN Github
Growler no CPAN Github
HTTP::Auth::Extensible 👍 CPAN Github
Interchange6 👍 CPAN Github
JWT no CPAN Github
Locale 👍 CPAN Github
Locale::Wolowitz no CPAN Github
LogReport no CPAN no public repo
Minify no CPAN GitHub
Multilang no CPAN Github
Negotiate no CPAN Github
OAuth2::Server no CPAN Github
PageHistory 👍 CPAN Github
ParamKeywords no CPAN Github
ParamTypes 👍 CPAN GitHub
Passphrase 👍 CPAN Github
Path::Class no CPAN Github
Pg no CPAN Github
ProbabilityRoute no CPAN Github : manual testing using demo
ProgressStatus no CPAN Github
Queue no CPAN Github
Queue::MongoDB no CPAN Github
reCAPTCHA no CPAN Github
Redis 👍 CPAN Github
Res no CPAN Github
REST no CPAN Github
RootURIFor no CPAN Github
SendAs 👍 (in core) CPAN Github
Shutdown no CPAN Github
Shutdown::Redis no CPAN Github
Sixpack no CPAN Github
Swagger2 no CPAN GitHub
Syntax::GetPost no CPAN Github
TemplateFlute 👍 CPAN Github
👍 Release broken but fixed in GH upstream:
plugin Release Repo
RoutePodCoverage CPAN Github
UnicodeNormalize CPAN Github
👎 Release broken but PR submitted:
plugin Release Repo
Auth::YARBAC CPAN Github : PR
❓ Unknown (no tests)
plugin Release Repo
GoogleAnalytics CPAN Github repo disappeared
HTTP::Caching Github
HTTP::ConditionalRequest Github
HTTP::ContentNegotiation Github
LogContextual CPAN Github
Model Github
@SysPete
Copy link
Member

SysPete commented Dec 28, 2015

👎 Passphrase: Github

t/003_default_settings.t .. Use of uninitialized value $Dancer2::Plugin::CUR_PLUGIN in string at /home/apm/git/Dancer2/lib/Dancer2/Plugin.pm line 247.
Can't find originating plugin at t/003_default_settings.t line 5.

@SysPete
Copy link
Member

SysPete commented Dec 28, 2015

👎 Deferred

This plugin does:
use Dancer2::Plugin qw(:no_dsl);
which is what breaks things. If :no_dsl is removed then tests all pass. It also passes against 0.165 with this change.

@SysPete
Copy link
Member

SysPete commented Dec 28, 2015

👎 Auth::Extensible: Github
Same issue as Passphrase:

t/01-basic.t ...... Use of uninitialized value $Dancer2::Plugin::CUR_PLUGIN in string at /home/apm/git/Dancer2/lib/Dancer2/Plugin.pm line 247.
Can't find originating plugin at t/lib/TestApp.pm line 10.

@SysPete
Copy link
Member

SysPete commented Dec 28, 2015

👎 Auth::OAuth: Github
PR submitted to remove 'use Dancer2' b10m/p5-Dancer2-Plugin-Auth-OAuth#7
Once patch is applied breaks in the same way as Passphrase and Auth::Extensible.

@SysPete
Copy link
Member

SysPete commented Dec 28, 2015

👎 DBIC: Github

t/04-testapp.t ........... Specific subroutines cannot be exported from plugin at t/lib/TestApp.pm line 5.

Due to this in the test:
use Dancer2::Plugin::DBIC qw(schema resultset);
Simple fix is to remove import list.

PR submitted ironcamel/Dancer2-Plugin-DBIC#13

Update:
PR merged. Awaiting new release.

@SysPete
Copy link
Member

SysPete commented Dec 29, 2015

👎 Feed: Github
Just need to remove use Dancer2. PR submitted.hobbestigrou/Dancer2-Plugin-Feed#5

@SysPete
Copy link
Member

SysPete commented Dec 29, 2015

👎 JWT: Github

Two problems here. One was solved by using plugin_setting DSL:

--- a/lib/Dancer2/Plugin/JWT.pm
+++ b/lib/Dancer2/Plugin/JWT.pm
@@ -15,7 +15,7 @@ my $config;

 sub _get_secret {
        my $dsl = shift;
-       $config = $dsl->config->{plugins}{JWT};
+       $config = plugin_setting;
        die "JWT cannot be used without a secret!" unless exists $config->{secret};
        return $config->{secret};
 }

That change is in the master branch of my fork: https://github.com/SysPete/Dancer2-Plugin-JWT

Still leaves the Use of uninitialized value $Dancer2::Plugin::CUR_PLUGIN... as in other plugins^^

@SysPete
Copy link
Member

SysPete commented Dec 29, 2015

👎 Redis: Github

use strictures 1 along with plugin_args deprecation notice causes exceptions. Removing use of plugin_args fixes all problems.

PR with fix

@SysPete
Copy link
Member

SysPete commented Dec 29, 2015

👎 REST: Github

Diff is pretty simple:

remove use Dancer2

--- a/lib/Dancer2/Plugin/REST.pm
+++ b/lib/Dancer2/Plugin/REST.pm
@@ -6,14 +6,9 @@ use warnings;

 use Carp 'croak';

-use Dancer2 0.149000_01;
 use Dancer2::Plugin;

use Class::Load qw/ try_load_class /;

-use Moo::Role;
-
-with 'Dancer2::Plugin';
-
 # [todo] - add XML support
 my $content_types = {
     json => 'application/json',

PR: PerlDancer/Dancer2-Plugin-REST#12

@yanick
Copy link
Contributor

yanick commented Dec 29, 2015

PerlDancer/Dancer2-Plugin-REST

Using the new plugin_keyword keyword triggers a warning that using the DSL is deprecated. (see t/04_helpers.t)

https://github.com/yanick/Dancer2-Plugin-REST/compare/master...PerlDancer:d2?expand=1

Using the 'sub foo :PluginKeyword` alternative does not trigger the warning.

@xsawyerx
Copy link
Member Author

So we're waiting for D2P2 to be released before Dancer2::Plugin::REST gets a new release?

@xsawyerx
Copy link
Member Author

What @SysPete was tracking was how to make the most minimal changes to get the next version running without changing it to D2P2. Then it can be released already before D2P2 is released.

@yanick
Copy link
Contributor

yanick commented Dec 29, 2015

On 2015-12-29 12:08 PM, Sawyer X wrote:

What @SysPete https://github.com/SysPete was tracking was how to make
the most minimal changes to get the next version running without
changing it to D2P2. Then it can be released already before D2P2 is
released.

Sure. Will release the patch in a few minutes.

@xsawyerx
Copy link
Member Author

@SysPete I fixed the uninitialized error!

@SysPete
Copy link
Member

SysPete commented Dec 30, 2015

On 30/12/15 01:41, Sawyer X wrote:

@SysPete https://github.com/SysPete I fixed the uninitialized warning!


Reply to this email directly or view it on GitHub
#1078 (comment).

Excellent! Will start going back through them.

@racke
Copy link
Member

racke commented Dec 30, 2015

Dancer2::Plugin::DBIC has been released with @SysPete's patch.

@hvoers
Copy link

hvoers commented Dec 30, 2015

On Wed, 30 Dec 2015, Stefan Hornburg (Racke) wrote:

Dancer2::Plugin::DBIC has been released with @SysPete's patch.

... and on its way to the FreeBSD ports-tree :)

@hvoers
Copy link

hvoers commented Dec 30, 2015

Passphrase has been released on CPAN and is on its way to FreeBSD.
Next port: Auth::Extensible

@hvoers
Copy link

hvoers commented Dec 30, 2015

Auth::Extensible @racke Is version 0.402 the one that is D2P2 ready?

@racke
Copy link
Member

racke commented Dec 30, 2015

On 12/30/2015 01:49 PM, Henk van Oers wrote:

Auth::Extensible @racke https://github.com/racke Is version 0.402 the one that is D2P2 ready?

It doesn't have any special patches for D2P2, so it is uncertain. I'll check that.

Regards
Racke

Perl and Dancer Development

Visit our Perl::Dancer conference 2015.
More information on https://www.perl.dance.

@racke
Copy link
Member

racke commented Dec 30, 2015

It throws a lot of warnings:

t/01-basic.t ...... 1/? Please use fully qualified hook name or the method execute_plugin_hook at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Plugin DSL method 'request' is deprecated. Use '$self->app->request' instead'.
 at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Using DSL in plugins is deprecated (uri_for). at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Using DSL in plugins is deprecated (redirect). at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Please use fully qualified hook name or the method execute_plugin_hook at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Plugin DSL method 'request' is deprecated. Use '$self->app->request' instead'.
 at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Using DSL in plugins is deprecated (uri_for). at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Using DSL in plugins is deprecated (redirect). at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Please use fully qualified hook name or the method execute_plugin_hook at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Plugin DSL method 'request' is deprecated. Use '$self->app->request' instead'.
 at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Using DSL in plugins is deprecated (uri_for). at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Using DSL in plugins is deprecated (redirect). at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Please use fully qualified hook name or the method execute_plugin_hook at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Plugin DSL method 'request' is deprecated. Use '$self->app->request' instead'.
 at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Using DSL in plugins is deprecated (uri_for). at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Using DSL in plugins is deprecated (redirect). at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Please use fully qualified hook name or the method execute_plugin_hook at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Plugin DSL method 'request' is deprecated. Use '$self->app->request' instead'.
 at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Using DSL in plugins is deprecated (uri_for). at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Using DSL in plugins is deprecated (redirect). at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Please use fully qualified hook name or the method execute_plugin_hook at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Plugin DSL method 'request' is deprecated. Use '$self->app->request' instead'.
 at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Using DSL in plugins is deprecated (uri_for). at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.
Using DSL in plugins is deprecated (redirect). at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/Route.pm line 137.

@shumphrey
Copy link
Contributor

For ProgressStatus, I have a branch that uses new style. I hadn't merged it yet but I can do that now

@xsawyerx
Copy link
Member Author

Throwing warnings is on purpose. It's like that so you would have to upgrade. The warnings will only be thrown if someone uses an older version of the plugin (which uses the older D2::P plugin interface) while the new D2::P interface is available.

This means that you release this version now - no warnings yet. We release a new version of Dancer2 with the new D2::P and then you have warnings until you upload a new version that uses the new interface.

That's the deprecation cycle.

Also, I pushed a fix for the last uninitialized error.

@racke
Copy link
Member

racke commented Dec 30, 2015

Yes, sounds like a good plan.

@veryrusty
Copy link
Member

I've sent a short email to:

  • @ironcamel regarding new releases for DBIC and Email plugins
  • @dboehmer regarding the Swagger2 plugin

[ github will hopefully ping them a notification reminder too ;) /subtle ]

@ironcamel
Copy link

@veryrusty I just published the updated DBIC and Email plugins to CPAN

@veryrusty
Copy link
Member

@ironcamel++ Thanks! 👯

@racke
Copy link
Member

racke commented May 26, 2016

@ironcamel Thanks for moving forward!

@xsawyerx
Copy link
Member Author

Emailed authors of: HTTP::Auth::Extensible, Locale, Minify, Shutdown.

@vanHoesel
Copy link
Contributor

I will make time tonight to fix this, and also look at the other D2::P::HTTP modules that I wrote.

On May 26, 2016, at 12:07 PM, Sawyer X [email protected] wrote:

Emailed authors of: HTTP::Auth::Extensible, Locale, Minify, Shutdown.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub #1078 (comment)

@xsawyerx
Copy link
Member Author

@vanHoesel ❤️

@vanHoesel
Copy link
Contributor

Peter, with your changes, I run into trouble...

running make test:
t/00-load.t ................ String found where operator expected at /Volumes/Repositories/THEMA-MEDIA/Dancer2-Plugin-HTTP-Auth-Extensible/blib/lib/Dancer2/Plugin/HTTP/Auth/Extensible.pm line 73, near "plugin_keywords
'http_authenticate_user'"
(Do you need to predeclare plugin_keywords?)

Failed test 'use Dancer2::Plugin::HTTP::Auth::Extensible;'

at t/00-load.t line 6.

Tried to use 'Dancer2::Plugin::HTTP::Auth::Extensible'.

Error: syntax error at /Volumes/Repositories/THEMA-MEDIA/Dancer2-Plugin-HTTP-Auth-Extensible/blib/lib/Dancer2/Plugin/HTTP/Auth/Extensible.pm line 20, near "has default_realm”

Or, doing prove -Ilib:

Error: Can't locate Dancer2/Core/Types.pm in @inc (you may need to install the Dancer2::Core::Types module) (@inc contains: /Volumes/Repositories/THEMA-MEDIA/Dancer2-Plugin-HTTP-Auth-Extensible/lib /Users/tvanhoesel/perl5/perlbrew/perls/perl-5.18.4/lib/site_perl/5.18.4/darwin-2level /Users/tvanhoesel/perl5/perlbrew/perls/perl-5.18.4/lib/site_perl/5.18.4 /Users/tvanhoesel/perl5/perlbrew/perls/perl-5.18.4/lib/5.18.4/darwin-2level /Users/tvanhoesel/perl5/perlbrew/perls/perl-5.18.4/lib/5.18.4) at /Volumes/Repositories/THEMA-MEDIA/Dancer2-Plugin-HTTP-Auth-Extensible/lib/Dancer2/Plugin/HTTP/Auth/Extensible.pm line 7.

$Dancer2::Core::Types::VERSION 0.166001 (just did a clean install for Dancer2::Plugin , which installs everything)

Some advice is really welcome

Theo

On May 26, 2016, at 12:56 PM, Sawyer X [email protected] wrote:

@vanHoesel https://github.com/vanHoesel ❤️


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub #1078 (comment)

@SysPete
Copy link
Member

SysPete commented May 27, 2016

@vanHoesel apologies - I did not make it clear in PRs...

The latest updates to your plugin will work ONLY with plugin2 which will be released as part of Dancer2 v0.200000 this weekend (assuming all goes well). For a small number of plugins (those that themselves use other plugins) it is not possible to be compatible with both current Dancer2 and also the next release.

You can test against the latest DEV release: cpanm --dev Dancer2

@vanHoesel
Copy link
Contributor

For all who it may concern…

doing a (clean) install for —dev Dancer2:

! Installing the dependencies failed: Module 'Type::Tiny' is not installed
! Bailing out the installation for Dancer2-0.166001_03.

after installing that:

[App::Basic:5341] error @2016-05-27 12:39:26> Route exception: Can't locate object method "_parse_query" via package "Dancer2::Core::Request" at /Users/tvanhoesel/.cpanm/work/1464349136.4981/Dancer2-0.166001_03/blib/lib/Dancer2/Core/Request.pm line 349. in /Users/tvanhoesel/.cpanm/work/1464349136.4981/Dancer2-0.166001_03/blib/lib/Dancer2/Core/App.pm l. 837

#   Failed test 'Successful request'
#   at t/dsl/parameters.t line 50.
# Looks like you failed 1 test of 1.

Failed test 'Query parameters'

at t/dsl/parameters.t line 51.

Looks like you failed 1 test of 7.

I will force install it, it was the ONLY failing test:

Failed 1/149 test programs. 1/1476 subtests failed.

Cheers … will continue to work on my HTTP Modules

On May 27, 2016, at 9:46 AM, Peter Mottram [email protected] wrote:

@vanHoesel https://github.com/vanHoesel apologies - I did not make it clear in PRs...

The latest updates to your plugin will work ONLY with plugin2 which will be released as part of Dancer2 v0.200000 this weekend (assuming all goes well). For a small number of plugins (those that themselves use other plugins) it is not possible to be compatible with both current Dancer2 and also the next release.

You can test against the latest DEV release: cpanm --dev Dancer2


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub #1078 (comment), or mute the thread https://github.com/notifications/unsubscribe/ADkE_j8sV35djSFPxhpficeFNqS6dPGgks5qFq94gaJpZM4G7bjc.

@xsawyerx
Copy link
Member Author

@vanHoesel I just released a new development release. Can you please try that?

@SysPete
Copy link
Member

SysPete commented May 27, 2016

@xsawyerx Theo's most recent attempt was with latest dev. I'm testing locally to see if I can reproduce.

@xsawyerx
Copy link
Member Author

Whoops.

@SysPete
Copy link
Member

SysPete commented May 27, 2016

This looks like Plack 1.0040 DEV since Plack::Request->_parse_query goes away in that release. @vanHoesel please confirm which version of Plack you have installed.

@veryrusty
Copy link
Member

@SysPete D2 core resolved that with #1148.

@veryrusty
Copy link
Member

Whoops! 1148 fixed the body params.. missed the query params change. ( Same fix applies there too )

@SysPete
Copy link
Member

SysPete commented May 27, 2016

@vanHoesel new Dancer2 dev release available which fixes that issue ( @xsawyerx ++ )

@zurborg
Copy link

zurborg commented May 29, 2016

New versions released a few minutes ago:
Dancer2::Plugin::Minify
Dancer2::Plugin::Shutdown
Dancer2::Plugin::Shutdown::Redis
hope that helps... ;-)

@xsawyerx
Copy link
Member Author

@zurborg++ !

Thank you so much.

@rleir
Copy link

rleir commented Jun 14, 2016

How many plugin1 plugins remain? Perhaps the remaining ones could each have a (low pri) issue?

@SysPete
Copy link
Member

SysPete commented Jun 20, 2016

Main list has a new column denoting whether or not the plugin is pure plugin2. This column can also be used to note PRs to convert to plugin2. Just thought it would be an idea to see how many we need to convert.

@xsawyerx
Copy link
Member Author

xsawyerx commented Nov 6, 2016

I think we can close this ticket now. Yes? :)

@hvoers
Copy link

hvoers commented Nov 6, 2016

Yes.

@SysPete
Copy link
Member

SysPete commented Nov 7, 2016

I'm still using this ticket to track updates to pure Plugin2 which so far has been done for 18 out of 67 plugins. Perhaps my checklist could be moved over to the wiki.

@ialarmedalien
Copy link

What's the recommended procedure for converting a plugin that may import an unspecified number of keywords into the app? I use Dancer2::Plugin::LogContextual, which imports a set of keywords via use Log::Contextual ':log' and redefines $SIG{__WARN__} for the application by adding an around method modifier to to_app, but am unsure of the best way to handle this with the new plugin system (I'm not the plugin author).

A bit o' sample code:

around to_app => sub {
    my ( $attr, $self, @args ) = @_;
    my $app = $self->$attr( @args );
    return sub {
        local $SIG{__WARN__} = sub {
            my @args = @_;
            log_warn { @args };
        };
        return $app->( @_ );
    };
};

@cromedome
Copy link
Contributor

@SysPete Is this still relevant? Guessing not, but we can perhaps move anything you need to the wiki if so?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests