Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Okipa/laravel-stuck-jobs-notifier
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.2.2
Choose a base ref
...
head repository: Okipa/laravel-stuck-jobs-notifier
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 8 commits
  • 8 files changed
  • 2 contributors

Commits on Dec 16, 2022

  1. Fixed PHPUnit config

    Okipa committed Dec 16, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    c1d6861 View commit details
  2. Copy the full SHA
    5e22a7a View commit details
  3. Fixed PHPUnit config

    Okipa committed Dec 16, 2022
    Copy the full SHA
    df4776f View commit details
  4. Fixed PHPUnit config

    Okipa committed Dec 16, 2022
    Copy the full SHA
    a22d092 View commit details
  5. Add PHP 8.2 support

    * Added PHP 8.2 support
    * Dropped PHP 8.0 support
    Okipa authored Dec 16, 2022
    Copy the full SHA
    27e6ba1 View commit details

Commits on Dec 23, 2022

  1. Copy the full SHA
    52a7854 View commit details

Commits on Jan 22, 2023

  1. Laravel 10 support (#14)

    * Added Laravel 10 support
    * Dropped Laravel 8 support
    * Locked PHP versions to 8.1 and 8.2
    Okipa authored Jan 22, 2023
    Copy the full SHA
    6de97f8 View commit details

Commits on Feb 19, 2023

  1. Removed useless phpdoc

    Okipa committed Feb 19, 2023
    Copy the full SHA
    a205434 View commit details
Showing with 47 additions and 42 deletions.
  1. +8 −10 .github/workflows/ci.yml
  2. +15 −0 CHANGELOG.md
  3. +8 −6 README.md
  4. +7 −7 composer.json
  5. +8 −0 phpunit.xml
  6. +0 −5 src/Notifications/JobsAreStuck.php
  7. +0 −11 tests/TestCase.php
  8. +1 −3 tests/Unit/StuckJobsMonitoringTest.php
18 changes: 8 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -14,15 +14,13 @@ jobs:
strategy:
fail-fast: true
matrix:
php: ['8.1', '8.0']
laravel: ['9.*', '8.*']
php: ['8.1', '8.2']
laravel: ['9.*', '10.*']
include:
- laravel: '9.*'
testbench: '7.*'
larastan: '2.*'
- laravel: '8.*'
testbench: '6.*'
larastan: '1.*'
- laravel: '10.*'
testbench: '8.*'

name: P${{ matrix.php }} - L${{ matrix.laravel }}

@@ -51,26 +49,26 @@ jobs:
# Lower PHP and laravel versions.

- name: PHPUnit without code coverage
if: matrix.php != '8.1' || matrix.laravel != '9.*'
if: matrix.php != '8.2' || matrix.laravel != '10.*'
run: vendor/bin/testbench package:test --parallel --no-coverage

# Last PHP and laravel versions.

- name: Code analysis
if: matrix.php == '8.1' && matrix.laravel == '9.*'
if: matrix.php == '8.2' && matrix.laravel == '10.*'
run: |
vendor/bin/pint --test -vvv
vendor/bin/phpmd config,src,tests text phpmd.xml
vendor/bin/phpstan analyse
- name: PHPUnit with code coverage
if: matrix.php == '8.1' && matrix.laravel == '9.*'
if: matrix.php == '8.2' && matrix.laravel == '10.*'
run: |
mkdir -p build/logs
vendor/bin/testbench package:test --parallel --coverage-text --coverage-clover build/logs/clover.xml
- name: Code coverage upload to Coveralls
if: env.COVERALLS_REPO_TOKEN && matrix.php == '8.1' && matrix.laravel == '9.*'
if: env.COVERALLS_REPO_TOKEN && matrix.php == '8.2' && matrix.laravel == '10.*'
env:
COVERALLS_RUN_LOCALLY: 1
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## [2.4.0](https://github.com/Okipa/laravel-stuck-jobs-notifier/compare/2.3.0...2.4.0)

2023-01-22

* Added Laravel 10 support
* Dropped Laravel 8 support
* Locked PHP versions to 8.1 and 8.2

## [2.3.0](https://github.com/Okipa/laravel-stuck-jobs-notifier/compare/2.2.2...2.3.0)

2022-12-16

* Added PHP 8.2 support
* Dropped PHP 8.0 support

## [2.2.2](https://github.com/Okipa/laravel-stuck-jobs-notifier/compare/2.2.1...2.2.2)

2022-10-27
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -28,12 +28,14 @@ Found this package helpful? Please consider supporting my work!

## Compatibility

| Laravel version | PHP version | Package version |
|---|---|---|
| ^8.0 | ^9.0 | ^8.0 | ^8.1 | ^2.2 |
| ^7.0 | ^8.0 | ^7.4 | ^8.0 | ^2.1 |
| ^7.0 | ^8.0 | ^7.4 | ^2.0 |
| ^6.0 | ^7.0 | ^7.4 | ^1.0 |
| Laravel version | PHP version | Package version |
|-------------------|--------------------|-----------------|
| ^9.0 | ^10.0 | 8.1.* | 8.2.* | ^2.4 |
| ^8.0 | ^9.0 | ^8.1 | ^8.2 | ^2.3 |
| ^8.0 | ^9.0 | ^8.0 | ^8.1 | ^2.2 |
| ^7.0 | ^8.0 | ^7.4 | ^8.0 | ^2.1 |
| ^7.0 | ^8.0 | ^7.4 | ^2.0 |
| ^6.0 | ^7.0 | ^7.4 | ^1.0 |

## Upgrade guide

14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -25,16 +25,16 @@
}
],
"require": {
"php": "^8.0|^8.1",
"illuminate/contracts": "^8.0|^9.0"
"php": "8.1.*|8.2.*",
"illuminate/contracts": "^9.0|^10.0"
},
"require-dev": {
"brianium/paratest": "^6.4",
"laravel-notification-channels/webhook": "^2.3",
"laravel/slack-notification-channel": "^2.4",
"nunomaduro/collision": "^5.10|^6.0",
"nunomaduro/larastan": "^1.0|^2.0",
"orchestra/testbench": "^6.0|^7.0",
"laravel-notification-channels/webhook": "^2.4",
"laravel/slack-notification-channel": "^2.5",
"nunomaduro/collision": "^6.0",
"nunomaduro/larastan": "^2.0",
"orchestra/testbench": "^7.0|^8.0",
"phpmd/phpmd": "^2.11",
"roave/security-advisories": "dev-latest",
"laravel/pint": "^1.1"
8 changes: 8 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -32,5 +32,13 @@
</coverage>
<php>
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
<server name="APP_ENV" value="testing"/>
<server name="LOG_CHANNEL" value="null"/>
<server name="BCRYPT_ROUNDS" value="4"/>
<server name="CACHE_DRIVER" value="array"/>
<server name="DB_CONNECTION" value="sqlite"/>
<server name="DB_DATABASE" value=":memory:"/>
<server name="MAIL_MAILER" value="array"/>
<server name="SESSION_DRIVER" value="array"/>
</php>
</phpunit>
5 changes: 0 additions & 5 deletions src/Notifications/JobsAreStuck.php
Original file line number Diff line number Diff line change
@@ -60,11 +60,6 @@ public function toMail(): MailMessage
. '"php artisan queue:failed" command.'));
}

/**
* Get the slack representation of the notification.
*
* @return \Illuminate\Notifications\Messages\SlackMessage
*/
public function toSlack(): SlackMessage
{
return (new SlackMessage())->error()->content(''
11 changes: 0 additions & 11 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -7,17 +7,6 @@

class TestCase extends Orchestra
{
protected function getEnvironmentSetUp($app): void
{
$app['config']->set('queue.default', 'sync');
$app['config']->set('database.default', 'testing');
$app['config']->set('database.connections.testing', [
'driver' => 'sqlite',
'database' => ':memory:',
'prefix' => '',
]);
}

protected function getPackageProviders($app): array
{
return [StuckJobsNotifierServiceProvider::class];
4 changes: 1 addition & 3 deletions tests/Unit/StuckJobsMonitoringTest.php
Original file line number Diff line number Diff line change
@@ -180,9 +180,7 @@ public function it_can_trigger_callback_when_jobs_are_stuck(): void
public function it_can_send_default_stuck_job_singular_notification_message(): void
{
$date = Carbon::now()->subHours(4);
$stuckJobs = collect([
['failed_at' => $date->toDateTimeString()],
]);
$stuckJobs = collect([['failed_at' => $date->toDateTimeString()]]);
$notification = app(StuckJobsNotifier::class)->getNotification($stuckJobs);
$notifiable = app(StuckJobsNotifier::class)->getNotifiable();
$notifiable->notify($notification);