Skip to content

Commit

Permalink
Release v2.25.1
Browse files Browse the repository at this point in the history
  • Loading branch information
imjoehaines authored Jan 17, 2023
2 parents defd535 + bdf0e8c commit f8aac58
Show file tree
Hide file tree
Showing 61 changed files with 1,223 additions and 146 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
Changelog
=========

## v2.25.1 (2023-01-17)

### Enhancements

* Ensure events are sent from queues when using Laravel Vapor
[#511](https://github.com/bugsnag/bugsnag-laravel/pull/511)

### Bug fixes

* Fix events from CLI commands always being handled when using the `NunoMaduro\Collision` package
[#503](https://github.com/bugsnag/bugsnag-laravel/pull/503)

* Fix breadcrumbs leaking between queued jobs when using Laravel Vapor
[#511](https://github.com/bugsnag/bugsnag-laravel/pull/511)

## 2.25.0 (2022-10-25)

### Enhancements
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source 'https://rubygems.org'

gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', tag: 'v7.6.0'
gem 'bugsnag-maze-runner', git: 'https://github.com/bugsnag/maze-runner', tag: 'v7.9.0'
8 changes: 6 additions & 2 deletions features/fixtures/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ services:
- BUGSNAG_REGISTER_OOM_BOOTSTRAPPER
- BUGSNAG_DISCARD_CLASSES
- BUGSNAG_REDACTED_KEYS
- BUGSNAG_QUERY
restart: "no"
ports:
- target: 8000
Expand All @@ -34,6 +35,7 @@ services:
- BUGSNAG_REGISTER_OOM_BOOTSTRAPPER
- BUGSNAG_DISCARD_CLASSES
- BUGSNAG_REDACTED_KEYS
- BUGSNAG_QUERY
restart: "no"
ports:
- target: 8000
Expand All @@ -53,6 +55,7 @@ services:
- BUGSNAG_REGISTER_OOM_BOOTSTRAPPER
- BUGSNAG_DISCARD_CLASSES
- BUGSNAG_REDACTED_KEYS
- BUGSNAG_QUERY
restart: "no"
ports:
- target: 8000
Expand All @@ -72,13 +75,13 @@ services:
- BUGSNAG_REGISTER_OOM_BOOTSTRAPPER
- BUGSNAG_DISCARD_CLASSES
- BUGSNAG_REDACTED_KEYS
- BUGSNAG_QUERY
restart: "no"
ports:
- target: 8000
published: 61266

laravel8:
init: true
build:
context: laravel8
args:
Expand All @@ -92,13 +95,13 @@ services:
- BUGSNAG_REGISTER_OOM_BOOTSTRAPPER
- BUGSNAG_DISCARD_CLASSES
- BUGSNAG_REDACTED_KEYS
- BUGSNAG_QUERY
restart: "no"
ports:
- target: 8000
published: 61280

laravel9:
init: true
build:
context: laravel9
args:
Expand All @@ -112,6 +115,7 @@ services:
- BUGSNAG_REGISTER_OOM_BOOTSTRAPPER
- BUGSNAG_DISCARD_CLASSES
- BUGSNAG_REDACTED_KEYS
- BUGSNAG_QUERY
restart: "no"
ports:
- target: 8000
Expand Down
8 changes: 2 additions & 6 deletions features/fixtures/laravel51/.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@ APP_ENV=local
APP_DEBUG=true
APP_KEY=SomeRandomString

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
DB_CONNECTION=sqlite

CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
QUEUE_DRIVER=database

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
Expand Down
3 changes: 3 additions & 0 deletions features/fixtures/laravel51/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ COPY --from=composer:2.2 /usr/bin/composer /usr/local/bin/composer
RUN composer install --no-dev
RUN php artisan key:generate

# create database & apply migrations
RUN touch database/database.sqlite && php artisan migrate --no-interaction

CMD php artisan serve --port=8000 --host=0.0.0.0
8 changes: 8 additions & 0 deletions features/fixtures/laravel51/app/Http/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@
return view('handlederror');
});

Route::get('/queue/unhandled', function () {
Queue::push(new \App\Jobs\UnhandledJob());
});

Route::get('/queue/handled', function () {
Queue::push(new \App\Jobs\HandledJob());
});

/**
* Return some diagnostics if an OOM did not happen when it should have.
*
Expand Down
24 changes: 24 additions & 0 deletions features/fixtures/laravel51/app/Jobs/HandledJob.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace App\Jobs;

use Exception;
use App\Jobs\Job;
use Illuminate\Contracts\Bus\SelfHandling;
use Illuminate\Contracts\Queue\ShouldQueue;
use Bugsnag\BugsnagLaravel\Facades\Bugsnag;

class HandledJob extends Job implements SelfHandling, ShouldQueue
{
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
Bugsnag::leaveBreadcrumb(__METHOD__);

Bugsnag::notifyException(new Exception('Handled :)'));
}
}
24 changes: 24 additions & 0 deletions features/fixtures/laravel51/app/Jobs/UnhandledJob.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace App\Jobs;

use App\Jobs\Job;
use RuntimeException;
use Illuminate\Contracts\Bus\SelfHandling;
use Illuminate\Contracts\Queue\ShouldQueue;
use Bugsnag\BugsnagLaravel\Facades\Bugsnag;

class UnhandledJob extends Job implements SelfHandling, ShouldQueue
{
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
Bugsnag::leaveBreadcrumb(__METHOD__);

throw new RuntimeException('uh oh :o');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Bugsnag\BugsnagLaravel\Facades\Bugsnag;

class AppServiceProvider extends ServiceProvider
{
Expand All @@ -13,7 +14,7 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot()
{
//
Bugsnag::leaveBreadcrumb(__METHOD__);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

use Illuminate\Contracts\Events\Dispatcher as DispatcherContract;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Queue;
use Bugsnag\BugsnagLaravel\Facades\Bugsnag;

class EventServiceProvider extends ServiceProvider
{
Expand All @@ -28,6 +30,8 @@ public function boot(DispatcherContract $events)
{
parent::boot($events);

//
Queue::after(function () {
Bugsnag::leaveBreadcrumb('after');
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('queue');
$table->longText('payload');
$table->tinyInteger('attempts')->unsigned();
$table->tinyInteger('reserved')->unsigned();
$table->unsignedInteger('reserved_at')->nullable();
$table->unsignedInteger('available_at');
$table->unsignedInteger('created_at');
$table->index(['queue', 'reserved', 'reserved_at']);
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('jobs');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateFailedJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('failed_jobs', function (Blueprint $table) {
$table->increments('id');
$table->text('connection');
$table->text('queue');
$table->longText('payload');
$table->timestamp('failed_at')->useCurrent();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('failed_jobs');
}
}
9 changes: 2 additions & 7 deletions features/fixtures/laravel56/.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,13 @@ APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
DB_CONNECTION=sqlite

BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=sync
QUEUE_DRIVER=database

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
Expand Down
3 changes: 3 additions & 0 deletions features/fixtures/laravel56/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ COPY --from=composer:2.2 /usr/bin/composer /usr/local/bin/composer
RUN composer install
RUN php artisan key:generate

# create database & apply migrations
RUN touch database/database.sqlite && php artisan migrate --no-interaction

CMD php artisan serve --port=8000 --host=0.0.0.0
28 changes: 28 additions & 0 deletions features/fixtures/laravel56/app/Jobs/HandledJob.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace App\Jobs;

use Exception;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Bugsnag\BugsnagLaravel\Facades\Bugsnag;

class HandledJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

/**
* Execute the job.
*
* @return void
*/
public function handle()
{
Bugsnag::leaveBreadcrumb(__METHOD__);

Bugsnag::notifyException(new Exception('Handled :)'));
}
}
28 changes: 28 additions & 0 deletions features/fixtures/laravel56/app/Jobs/UnhandledJob.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace App\Jobs;

use RuntimeException;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Bugsnag\BugsnagLaravel\Facades\Bugsnag;

class UnhandledJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

/**
* Execute the job.
*
* @return void
*/
public function handle()
{
Bugsnag::leaveBreadcrumb(__METHOD__);

throw new RuntimeException('uh oh :o');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Bugsnag\BugsnagLaravel\Facades\Bugsnag;

class AppServiceProvider extends ServiceProvider
{
Expand All @@ -13,7 +14,7 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot()
{
//
Bugsnag::leaveBreadcrumb(__METHOD__);
}

/**
Expand Down
Loading

0 comments on commit f8aac58

Please sign in to comment.