Skip to content

Commit d48d50d

Browse files
authored
Improve release default value (getsentry#325)
* Improve release default value using PrettyVersion * Ignore var folder generated by E2E tests * Add changelog entry * Increase test resiliency * Slate it to be released as 3.4.4
1 parent 941f65a commit d48d50d

File tree

7 files changed

+9
-6
lines changed

7 files changed

+9
-6
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ package.xml
44
.idea
55
.php_cs.cache
66
docs/_build
7+
var

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77
## Unreleased
88
- ...
99

10+
## 3.4.4 (2020-03-16)
11+
- Improve `release` option default value (#325)
12+
1013
## 3.4.3 (2020-02-03)
1114
- Change default of `in_app_include` to empty, due to getsentry/sentry-php#958 (#311)
1215
- Improve class_alias robustness (#315)

composer.json

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"require": {
2222
"php": "^7.1",
2323
"jean85/pretty-package-versions": "^1.0",
24-
"ocramius/package-versions": "^1.3.0",
2524
"sentry/sdk": "^2.1",
2625
"symfony/config": "^3.4||^4.0||^5.0",
2726
"symfony/console": "^3.4||^4.0||^5.0",

src/DependencyInjection/Configuration.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Sentry\SentryBundle\DependencyInjection;
44

5+
use Jean85\PrettyVersions;
56
use PackageVersions\Versions;
67
use Sentry\Options;
78
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
@@ -111,7 +112,7 @@ public function getConfigTreeBuilder(): TreeBuilder
111112
->prototype('scalar');
112113
$optionsChildNodes->scalarNode('project_root');
113114
$optionsChildNodes->scalarNode('release')
114-
->defaultValue(Versions::getVersion(Versions::ROOT_PACKAGE_NAME))
115+
->defaultValue(PrettyVersions::getVersion(Versions::ROOT_PACKAGE_NAME)->getPrettyVersion())
115116
->info('Release version to be reported to sentry, see https://docs.sentry.io/workflow/releases/?platform=php')
116117
->example('my/application@ff11bb');
117118
$optionsChildNodes->floatNode('sample_rate')

test/DependencyInjection/ConfigurationTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Sentry\SentryBundle\Test\DependencyInjection;
44

5-
use PackageVersions\Versions;
5+
use Jean85\PrettyVersions;
66
use Sentry\Options;
77
use Sentry\SentryBundle\DependencyInjection\Configuration;
88
use Sentry\SentryBundle\Test\BaseTestCase;
@@ -63,7 +63,7 @@ public function testConfigurationDefaults(): void
6363
'excluded_exceptions' => [],
6464
'prefixes' => $defaultSdkValues->getPrefixes(),
6565
'tags' => [],
66-
'release' => Versions::getVersion('sentry/sentry-symfony'),
66+
'release' => PrettyVersions::getVersion('sentry/sentry-symfony')->getPrettyVersion(),
6767
],
6868
'monolog' => [
6969
'error_handler' => [

test/DependencyInjection/SentryExtensionTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function testOptionsDefaultValues(): void
6363

6464
$this->assertNull($options->getDsn());
6565
$this->assertSame('test', $options->getEnvironment());
66-
$this->assertSame([realpath('./var/cache'), '/dir/project/root/vendor'], $options->getInAppExcludedPaths());
66+
$this->assertSame([$container->getParameter('kernel.cache_dir'), '/dir/project/root/vendor'], $options->getInAppExcludedPaths());
6767

6868
$this->assertSame(1, $container->getParameter('sentry.listener_priorities.request'));
6969
$this->assertSame(1, $container->getParameter('sentry.listener_priorities.sub_request'));

var/cache/.gitignore

-1
This file was deleted.

0 commit comments

Comments
 (0)