Skip to content

Commit

Permalink
Release v2.25.0
Browse files Browse the repository at this point in the history
  • Loading branch information
imjoehaines authored Oct 25, 2022
2 parents 14a6c8e + e520107 commit 64546d9
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 7 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
Changelog
=========

## TBD
## 2.25.0 (2022-10-25)

### Enhancements

* Added support for Monolog 3.0
[#489](https://github.com/bugsnag/bugsnag-laravel/pull/489)

* Add `max_breadcrumbs` config option for configuring the maximum number of breadcrumbs to attach to a report
[#496](https://github.com/bugsnag/bugsnag-laravel/pull/496)

## 2.24.0 (2022-05-20)

### Enhancements
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"require": {
"php": ">=5.5",
"bugsnag/bugsnag": "^3.28.0",
"bugsnag/bugsnag": "^3.29.0",
"bugsnag/bugsnag-psr-logger": "^1.4|^2.0",
"illuminate/contracts": "^5.0|^6.0|^7.0|^8.0|^9.0",
"illuminate/support": "^5.0|^6.0|^7.0|^8.0|^9.0",
Expand Down
12 changes: 12 additions & 0 deletions config/bugsnag.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,4 +349,16 @@
*/

'feature_flags' => [],

/*
|--------------------------------------------------------------------------
| Max breadcrumbs
|--------------------------------------------------------------------------
|
| The maximum number of breadcrumbs to send with a report.
|
| This should be an integer between 0-100 (inclusive).
*/

'max_breadcrumbs' => null,
];
6 changes: 5 additions & 1 deletion src/BugsnagServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class BugsnagServiceProvider extends ServiceProvider
*
* @var string
*/
const VERSION = '2.24.0';
const VERSION = '2.25.0';

/**
* Boot the service provider.
Expand Down Expand Up @@ -264,6 +264,10 @@ public function register()
$client->addFeatureFlags($featureFlags);
}

if (isset($config['max_breadcrumbs'])) {
$client->setMaxBreadcrumbs($config['max_breadcrumbs']);
}

return $client;
});

Expand Down
25 changes: 21 additions & 4 deletions tests/ServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Bugsnag\BugsnagLaravel\Tests\Stubs\Injectee;
use Bugsnag\BugsnagLaravel\Tests\Stubs\InjecteeWithLogInterface;
use Bugsnag\Client;
use Bugsnag\FeatureFlag;
use Bugsnag\PsrLogger\BugsnagLogger;
use Bugsnag\PsrLogger\MultiLogger as BaseMultiLogger;
use Illuminate\Contracts\Logging\Log;
Expand Down Expand Up @@ -486,14 +487,14 @@ public function testFeatureFlagsCanBeSetFromConfig()
$this->assertInstanceOf(Client::class, $client);

$expected = [
['featureFlag' => 'flag1'],
['featureFlag' => 'flag2', 'variant' => 'yes'],
['featureFlag' => 'flag4'],
new FeatureFlag('flag1'),
new FeatureFlag('flag2', 'yes'),
new FeatureFlag('flag4'),
];

$actual = $client->getConfig()->getFeatureFlagsCopy()->toArray();

$this->assertSame($expected, $actual);
$this->assertEquals($expected, $actual);
}

public function testFeatureFlagsAreNotSetWhenNotAnArray()
Expand All @@ -514,4 +515,20 @@ public function testFeatureFlagsAreNotSetWhenNotAnArray()

$this->assertSame([], $actual);
}

public function testMaxBreadcrumbsCanBeSetFromConfig()
{
/** @var \Illuminate\Config\Repository $laravelConfig */
$laravelConfig = $this->app->config;
$bugsnagConfig = $laravelConfig->get('bugsnag');
$bugsnagConfig['max_breadcrumbs'] = 73;

$laravelConfig->set('bugsnag', $bugsnagConfig);

/** @var Client $client */
$client = $this->app->make(Client::class);

$this->assertInstanceOf(Client::class, $client);
$this->assertSame(73, $client->getMaxBreadcrumbs());
}
}

0 comments on commit 64546d9

Please sign in to comment.