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

[5.7] Extract Nexmo and Slack drivers to own package #26689

Merged
merged 3 commits into from
Dec 3, 2018

Conversation

themsaid
Copy link
Member

@koenhoeijmakers
Copy link
Contributor

koenhoeijmakers commented Nov 30, 2018

Why not in https://github.com/laravel-notification-channels as the docs still reference to it as a sort of "collection of all notification channels"?

@devcircus
Copy link
Contributor

That’s a “community” driven repo. These are official Laravel packages.

@koenhoeijmakers
Copy link
Contributor

koenhoeijmakers commented Nov 30, 2018

Can totally understand that.

It's just that laravel-notification-channels doesn't seem that active in the form of adding new channels as the oldest new channel PR dates from Sep 6, 2016 and that this might have been a point to pick that up again.

@taylorotwell
Copy link
Member

taylorotwell commented Nov 30, 2018

We need to add them to the framework composer.json I guess? And then remove them in 5.8 and people opt-in.

@laurencei
Copy link
Contributor

laurencei commented Nov 30, 2018

Seems very strange to be doing this on a point release (even if its not breaking). Why not leave the whole change until 5.8 entirely?

@themsaid
Copy link
Member Author

themsaid commented Dec 1, 2018

@taylorotwell added to the framework's composer.json file.

@laurencei
Copy link
Contributor

@themsaid - Travis is failing with "Your requirements could not be resolved to an installable set of packages"

@themsaid
Copy link
Member Author

themsaid commented Dec 1, 2018

@laurencei yes, for now. We'll need to publish the libraries on packagist first.

@taylorotwell
Copy link
Member

taylorotwell commented Dec 1, 2018

@themsaid Are we going to move the tests to the repos?

@taylorotwell
Copy link
Member

Both packages have been added to Composer.

@themsaid
Copy link
Member Author

themsaid commented Dec 1, 2018

@taylorotwell build is passing now. Also added tests to the packages.

@mfn
Copy link
Contributor

mfn commented Dec 1, 2018

Seems very strange to be doing this on a point release (even if its not breaking). Why not leave the whole change until 5.8 entirely?

My thoughts exactly. What's the rush here, really? Just do it in-time for master.

@taylorotwell
Copy link
Member

taylorotwell commented Dec 2, 2018

@mfn @laurencei Because I want to do it now? Do you have a reason why we shouldn't? It's not a breaking change in any way unless I'm mistaken?

@laurencei
Copy link
Contributor

It felt strange initially - and then I considered the fact that the framework is essentially a bunch of packages, and so in that respect it makes sense. I agree there is no breaking change that I can think of either.

@taylorotwell
Copy link
Member

taylorotwell commented Dec 3, 2018

@themsaid do you want to tag 1.0.0 on both of the packages?

@taylorotwell taylorotwell merged commit 57dedf1 into laravel:5.7 Dec 3, 2018
@TBlindaruk
Copy link
Contributor

@driesvints
Copy link
Member

@TBlindaruk it's a bit to late for that since we already tagged versions. Didn't know about this. Thanks for sharing! :)

@TBlindaruk
Copy link
Contributor

TBlindaruk commented Dec 3, 2018

@driesvints we still can do it )

Like:

  1. delete files from the package
  2. moved files with the history

;)

@stevebauman
Copy link
Contributor

This seems to have broken my Laravel 5.7 app.

Downgrading to Laravel 5.7.15 works without issue, but as soon as I upgrade to Laravel 5.7.16 it breaks:

As soon as I run composer update targeting 5.7.16, this happens:

Package operations: 13 installs, 1 update, 0 removals
  - Installing guzzlehttp/promises (v1.3.1): Loading from cache
  - Installing ralouphie/getallheaders (2.0.5): Loading from cache
  - Installing psr/http-message (1.0.1): Loading from cache
  - Installing guzzlehttp/psr7 (1.5.2): Loading from cache
  - Installing guzzlehttp/guzzle (6.3.3): Loading from cache
  - Installing laravel/slack-notification-channel (v1.0.2): Loading from cache
  - Updating laravel/framework (v5.7.15 => v5.7.16): Loading from cache
  - Installing lcobucci/jwt (3.2.5): Loading from cache
  - Installing php-http/promise (v1.0.0): Loading from cache
  - Installing php-http/httplug (v1.1.0): Loading from cache
  - Installing php-http/guzzle6-adapter (v1.1.1): Loading from cache
  - Installing zendframework/zend-diactoros (1.8.6): Loading from cache
  - Installing nexmo/client (1.5.2): Loading from cache
  - Installing laravel/nexmo-notification-channel (v1.0.1): Loading from cache
lcobucci/jwt suggests installing mdanter/ecc (Required to use Elliptic Curves based algorithms.)
Writing lock file
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover


In Container.php line 960:

  Unresolvable dependency resolving [Parameter #0 [ <required> $app ]] in class Illuminate\Support\Manager

Exception:

error

@driesvints
Copy link
Member

@stevebauman please see #26766 & laravel/vonage-notification-channel#2

@stevebauman
Copy link
Contributor

stevebauman commented Dec 7, 2018

Thanks @driesvints 😄, that was indeed the issue. To resolve I had to manually delete app/bootstrap/cache/config.php as artisan wouldn't boot properly with this issue so couldn't use php artisan config:clear.

@mfn
Copy link
Contributor

mfn commented Dec 9, 2018

Really, this should not have landed in a minor version :|

See #26689 (comment) and #26689 (comment)

@fitztrev
Copy link
Contributor

@mfn It could be a breaking change. Now, the nexmo/client package and all its dependencies are installed in my app, when before it was just a "suggested" package left for me to decide if I want to use that driver. The nexmo/client package has a number of outdated dependencies:

Package                      Installed  Latest   Description
============================================================================
php-http/guzzle6-adapter     v1.1.1     v2.0.0   Guzzle 6 HTTP Adapter
php-http/httplug             v1.1.0     v2.0.0   HTTPlug, the HTTP client abstraction for PHP
ralouphie/getallheaders       2.0.5      3.0.1   A polyfill for getallheaders.
zendframework/zend-diactoros  1.8.6      2.0.1   PSR HTTP Message implementations

I don't already use any of those but if I did, and had the latest version of any of them installed, it would cause issues.

I noticed on the master branch these have been removed: 88b9fd6

@TBlindaruk
Copy link
Contributor

@driesvints

@driesvints
Copy link
Member

@fitztrev At the moment we're not getting any issues about this so I wouldn't revert.

@Kyslik
Copy link
Contributor

Kyslik commented Dec 17, 2018

Isn't this breaking change? I can not update above 5.7.15 without getting auto-discover error:

Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover

In Container.php line 960:

  Unresolvable dependency resolving [Parameter #0 [ <required> $app ]] in cla
  ss Illuminate\Support\Manager

And the stack trace points to nexmo/slack provider.

Note that I cloned my repo and did composer update and it failed with the above message so clearing the bootstrap/cache directory would not help since that is .gitignored.

Obviously not auto-loading the nexmo and slack channels do the trick; but why is this in minor release is beyond me; now I need to change composer.json in every project (where I edited the config #26766 (comment)).

    "extra": {
        "laravel": {
            "dont-discover": [
                "laravel/nexmo-notification-channel",
                "laravel/slack-notification-channel"
            ]
        }
    },

@stevebauman
Copy link
Contributor

Hi @Kyslik, are you sure you cleared the boostrap/cache/config.php file? I literally had the exact same error as you:

#26689 (comment)

You'll have to delete the files manually since artisan will try to auto-load your providers which will generate the same exception.

@Kyslik
Copy link
Contributor

Kyslik commented Dec 17, 2018

@stevebauman As I mentioned I did git clone... (on brand new machine) && composer update so I did not have the bootstrap/cache/config.php present.

It's solved for me with disabling the auto-discover for those two packages.

@stevebauman
Copy link
Contributor

I understand @Kyslik. Did you add the NotificationServiceProvider to your config/app.php file?

@Kyslik
Copy link
Contributor

Kyslik commented Dec 17, 2018

@stevebauman no I did not; I am sure that the app I am talking about worked on L5.7.15 (on server its still running like that) I tried to update to latest L5.7.17 on my local machine and got the error about Illuminate\Support\Manager.

@stevebauman
Copy link
Contributor

You will need to add that service provider to get back up and running. Give it a shot and let me know if it works.

@Kyslik
Copy link
Contributor

Kyslik commented Dec 17, 2018

@stevebauman yes that works as well.

...
\Illuminate\Notifications\NotificationServiceProvider::class,

and removed dont-discover from composer.json

And it works as expected:

> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover
Discovered Package: fideloper/proxy
Discovered Package: laravel/nexmo-notification-channel
Discovered Package: laravel/slack-notification-channel
Discovered Package: laravel/tinker
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Package manifest generated successfully.

Thank you :). I still think the change should be in L5.8 instead.

@stevebauman
Copy link
Contributor

@Kyslik Great to hear! And I also agree, but it's already been pushed into a release so oh well 🙁

I don't even use these notification channels so it's somewhat disappointing that we're forced to download these into our projects.

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

Successfully merging this pull request may close these issues.

None yet