From 43e7cb9080b420db6e0220dc3d2c8fa9ae013658 Mon Sep 17 00:00:00 2001 From: Alex Bouma Date: Thu, 3 May 2018 14:09:05 +0200 Subject: [PATCH 1/7] Prepare master for next release cycle --- README.md | 14 +++++++------- composer.json | 2 +- lib/Raven/Client.php | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index f99bf4233..beead0de1 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ Tagging a Release 2. Create a new branch for the minor version (if not present): ``` -$ git checkout -b releases/1.9.x +$ git checkout -b releases/1.10.x ``` 3. Update the hardcoded version tag in ``Client.php``: @@ -106,20 +106,20 @@ $ git checkout -b releases/1.9.x ```php class Raven_Client { - const VERSION = '1.9.0'; + const VERSION = '1.10.0'; } ``` 4. Commit the change: ``` -$ git commit -a -m "1.9.0" +$ git commit -a -m "1.10.0" ``` 5. Tag the branch: ``` -git tag 1.9.0 +git tag 1.10.0 ``` 6. Push the tag: @@ -137,7 +137,7 @@ git checkout master 8. Add the next minor release to the ``CHANGES`` file: ``` -## 1.10.0 (unreleased) +## 1.11.0 (unreleased) ``` 9. Update the version in ``Client.php``: @@ -145,7 +145,7 @@ git checkout master ```php class Raven_Client { - const VERSION = '1.10.x-dev'; + const VERSION = '1.11.x-dev'; } ``` @@ -154,7 +154,7 @@ class Raven_Client ```json "extra": { "branch-alias": { - "dev-master": "1.10.x-dev" + "dev-master": "1.11.x-dev" } } ``` diff --git a/composer.json b/composer.json index e250dcd8c..673fc2d15 100644 --- a/composer.json +++ b/composer.json @@ -53,7 +53,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.9.x-dev" + "dev-master": "1.10.x-dev" } } } diff --git a/lib/Raven/Client.php b/lib/Raven/Client.php index 7655dbb90..6196f7964 100644 --- a/lib/Raven/Client.php +++ b/lib/Raven/Client.php @@ -16,7 +16,7 @@ class Raven_Client { - const VERSION = '1.9.x-dev'; + const VERSION = '1.10.x-dev'; const PROTOCOL = '6'; From c2fbfe175f45d6199b165b61984dcc7bb6c58d2a Mon Sep 17 00:00:00 2001 From: Alex Bouma Date: Thu, 10 May 2018 16:17:21 +0200 Subject: [PATCH 2/7] Update the DSN environment variable name --- docs/integrations/laravel.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/integrations/laravel.rst b/docs/integrations/laravel.rst index 60b3ba167..4fb1d1b67 100644 --- a/docs/integrations/laravel.rst +++ b/docs/integrations/laravel.rst @@ -51,7 +51,7 @@ Add your DSN to ``.env``: .. code-block:: bash - SENTRY_DSN=___DSN___ + SENTRY_LARAVEL_DSN=___DSN___ Finally, if you wish to wire up User Feedback, you can do so by creating a custom error view in `resources/views/errors/500.blade.php`. From cc26653d16876d704a6b7aa633a76c06b432098e Mon Sep 17 00:00:00 2001 From: Alex Bouma Date: Thu, 10 May 2018 16:20:42 +0200 Subject: [PATCH 3/7] Add a note on Laravel 4.x support --- docs/integrations/laravel.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/integrations/laravel.rst b/docs/integrations/laravel.rst index 4fb1d1b67..2ef6495f4 100644 --- a/docs/integrations/laravel.rst +++ b/docs/integrations/laravel.rst @@ -124,9 +124,11 @@ Laravel 4.x Install the ``sentry/sentry-laravel`` package: +Laravel 4.x is supported until version 0.8.x. + .. code-block:: bash - $ composer require sentry/sentry-laravel + $ composer require "sentry/sentry-laravel:0.8.*" Add the Sentry service provider and facade in ``config/app.php``: From 7bf56a8abc4c2e3407cc509b09199e679b01c798 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 15 May 2018 09:47:40 +0200 Subject: [PATCH 4/7] feat: explicit culprit -> transaction (#601) --- lib/Raven/Client.php | 2 +- test/Raven/Tests/ClientTest.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Raven/Client.php b/lib/Raven/Client.php index 6196f7964..55536d1df 100644 --- a/lib/Raven/Client.php +++ b/lib/Raven/Client.php @@ -832,7 +832,7 @@ public function get_default_data() 'tags' => $this->tags, 'platform' => 'php', 'sdk' => $this->sdk, - 'culprit' => $this->transaction->peek(), + 'transaction' => $this->transaction->peek(), ); } diff --git a/test/Raven/Tests/ClientTest.php b/test/Raven/Tests/ClientTest.php index 2b1b737de..a9b16efff 100644 --- a/test/Raven/Tests/ClientTest.php +++ b/test/Raven/Tests/ClientTest.php @@ -680,11 +680,11 @@ public function testCaptureExceptionHandlesOptionsAsSecondArg() { $client = new Dummy_Raven_Client(); $ex = $this->create_exception(); - $client->captureException($ex, array('culprit' => 'test')); + $client->captureException($ex, array('transaction' => 'test')); $events = $client->getSentEvents(); $this->assertEquals(1, count($events)); $event = array_pop($events); - $this->assertEquals('test', $event['culprit']); + $this->assertEquals('test', $event['transaction']); } /** @@ -828,7 +828,7 @@ public function testGetDefaultData() 'name' => 'sentry-php', 'version' => $client::VERSION, ), - 'culprit' => 'test', + 'transaction' => 'test', ); $this->assertEquals($expected, $client->get_default_data()); } From 6c8a4e1c23ee4d12ea7028781d7b25a8bc65e430 Mon Sep 17 00:00:00 2001 From: Alex Bouma Date: Mon, 18 Jun 2018 09:05:55 +0200 Subject: [PATCH 5/7] Add failing tests --- test/Raven/Tests/ClientTest.php | 35 ++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/test/Raven/Tests/ClientTest.php b/test/Raven/Tests/ClientTest.php index a9b16efff..c6cf634fb 100644 --- a/test/Raven/Tests/ClientTest.php +++ b/test/Raven/Tests/ClientTest.php @@ -353,12 +353,15 @@ public function testParseDSNMissingPublicKey() { Raven_Client::ParseDSN('http://:secret@example.com/1'); } - /** - * @expectedException InvalidArgumentException - */ + public function testParseDSNMissingSecretKey() { - Raven_Client::ParseDSN('http://public@example.com/1'); + $parsed = Raven_Client::ParseDSN('http://public@example.com/1'); + + $this->assertEquals('http://example.com/api/1/store/', $parsed['server']); + $this->assertEquals('1', $parsed['project']); + $this->assertEquals('public', $parsed['public_key']); + $this->assertEquals(null, $parsed['secret_key']); } /** @@ -1035,6 +1038,29 @@ public function testGet_Auth_Header() "sentry_key=publickey, sentry_secret=secretkey"; $this->assertEquals($expected, $client->get_auth_header($timestamp, 'sentry-php/test', 'publickey', 'secretkey')); + + $expected = "Sentry sentry_timestamp={$timestamp}, sentry_client={$clientstring}, " . + "sentry_version=" . Dummy_Raven_Client::PROTOCOL . ", " . + "sentry_key=publickey"; + + $this->assertEquals($expected, $client->get_auth_header($timestamp, 'sentry-php/test', 'publickey', null)); + } + + /** + * @covers Raven_Client::get_auth_header + */ + public function testGet_Auth_Header_Public() + { + $client = new Dummy_Raven_Client(); + + $clientstring = 'sentry-php/test'; + $timestamp = '1234341324.340000'; + + $expected = "Sentry sentry_timestamp={$timestamp}, sentry_client={$clientstring}, " . + "sentry_version=" . Dummy_Raven_Client::PROTOCOL . ", " . + "sentry_key=publickey"; + + $this->assertEquals($expected, $client->get_auth_header($timestamp, 'sentry-php/test', 'publickey', null)); } /** @@ -2576,7 +2602,6 @@ public function testCaptureNonEmptyBreadcrumb() ), $event['breadcrumbs']); } - /** * @covers Raven_Client::capture */ From 21e39a6bc4e27591dabe4118d9b996bbc109b3a0 Mon Sep 17 00:00:00 2001 From: Alex Bouma Date: Mon, 18 Jun 2018 09:06:09 +0200 Subject: [PATCH 6/7] Remove requirement for secret in DSN --- lib/Raven/Client.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Raven/Client.php b/lib/Raven/Client.php index 55536d1df..6d93ec3bd 100644 --- a/lib/Raven/Client.php +++ b/lib/Raven/Client.php @@ -261,7 +261,7 @@ public function install() $this->error_handler->registerExceptionHandler(); $this->error_handler->registerErrorHandler(); $this->error_handler->registerShutdownFunction(); - + if ($this->_curl_handler) { $this->_curl_handler->registerShutdownFunction(); } @@ -508,7 +508,7 @@ public static function parseDSN($dsn) } $username = (isset($url['user']) ? $url['user'] : null); $password = (isset($url['pass']) ? $url['pass'] : null); - if (empty($netloc) || empty($project) || empty($username) || empty($password)) { + if (empty($netloc) || empty($project) || empty($username)) { throw new InvalidArgumentException('Invalid Sentry DSN: ' . $dsn); } From a124d5d807ddd28e2f3270bcd61841e25612a947 Mon Sep 17 00:00:00 2001 From: Alex Bouma Date: Tue, 19 Jun 2018 09:46:04 +0200 Subject: [PATCH 7/7] Update changelog for version 1.9.1 --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30dcb6105..8323963e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ - ... +## 1.9.1 (2018-06-19) + +- Allow the use of a public DSN (private part of the DSN was deprecated in Sentry 9) (#615) +- Send transaction as transaction not as culprit (#601) + ## 1.9.0 (2018-05-03) - Fixed undefined variable (#588)