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

Laravel 11.x Compatibility #353

Closed
wants to merge 2 commits into from

Conversation

laravel-shift
Copy link
Contributor

This is an automated pull request from Shift to update your package code and dependencies to be compatible with Laravel 11.x.

Before merging, you need to:

  • Checkout the l11-compatibility branch
  • Review all comments for additional changes
  • Thoroughly test your package

If you do find an issue, please report it by commenting on this PR to help improve future automation.

@laravel-shift
Copy link
Contributor Author

⚠️ The latest version of Laravel has a dependency for phpunit/phpunit of ^10.5. If you would like to also upgrade your tests, you may run the PHPUnit 10 Shift for free.

@laravel-shift
Copy link
Contributor Author

⚠️ Shift detected GitHub Actions which run jobs using a version matrix. Shift attempted to update your configuration for Laravel 11. However, you should review these changes to ensure the desired combination of versions are built for your package.

@laravel-shift
Copy link
Contributor Author

⚗️ Using this package? If you would like to help test these changes or believe them to be compatible, you may update your project to reference this branch.

To do so, temporarily add Shift's fork to the repositories property of your composer.json:

{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/laravel-shift/laravel-uptime-monitor.git"
        }
    ]
}

Then update your dependency constraint to reference this branch:

{
    "require": {
        "spatie/laravel-uptime-monitor": "dev-l11-compatibility",
    }
}

Finally, run: composer update

@intrepidws
Copy link
Contributor

@freekmurze Sorry to bother you, but it looks like perhaps no one is getting the notifications on this repo? PRs are getting auto-closed due to inactivity and I just wanted to make sure that didn't happen with this L11 upgrade.

@freekmurze
Copy link
Member

@intrepidws I currently don't have bandwidth to work on this, but you could PR fixes for the failing L11 tests, I'd merge this (and your PR).

@intrepidws
Copy link
Contributor

Understood. I'll take a look.

@mbabker
Copy link
Contributor

mbabker commented May 20, 2024

I can't PR this anywhere to make a quick fix, but in Spatie\UptimeMonitor\Test\TestCase::getEnvironmentSetUp(), add this line:

$app['config']->set('uptime-monitor.notifications.slack.webhook_url', 'https://hooks.slack.com/fake');

This is enough to configure the test environment to ensure Slack notifications are correctly routed through the legacy webhook channel instead of the newer Block Kit API channel when laravel/slack-notification-channel:^3.0 is installed. Because of laravel/slack-notification-channel#64, a new major version with the Slack notifications updated to the Block Kit API is probably going to be needed at some point, but that isn't strictly necessary for Laravel 11 support.

With that change, running the tests locally with Laravel 11 still yields 8 failures in these test cases:

  • Spatie\UptimeMonitor\Test\Integration\Helpers\PeriodTest
  • Spatie\UptimeMonitor\Test\Integration\Models\Traits\SupportsUptimeCheckTest

These look to be because of B/C breaks in Carbon 3.x, such as the below example:

6) Spatie\UptimeMonitor\Test\Integration\Helpers\PeriodTest::it_can_generate_a_string_representation_of_the_duration with data set #5 (1000, '16h 40m')
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'16h 40m'
+'0d 16h 40m'

I don't have the time right now to dig deeper into this or submit a full PR, but hopefully, this can help someone close the loop on getting this package compatible with the latest Laravel version.

@J-T-McC
Copy link
Contributor

J-T-McC commented Jun 11, 2024

I think this can be closed now.

@freekmurze freekmurze closed this Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants