-
-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use SENTRY_SPOTLIGHT
as default value for Spotlight options
#1789
base: master
Are you sure you want to change the base?
Conversation
6b9a5fd
to
235f9b7
Compare
235f9b7
to
fd5d15d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but won't approve until someone from the PHP SDK team takes a look at this.
@@ -1187,7 +1191,7 @@ private function configureOptions(OptionsResolver $resolver): void | |||
$resolver->setAllowedTypes('in_app_exclude', 'string[]'); | |||
$resolver->setAllowedTypes('in_app_include', 'string[]'); | |||
$resolver->setAllowedTypes('logger', ['null', LoggerInterface::class]); | |||
$resolver->setAllowedTypes('spotlight', 'bool'); | |||
$resolver->setAllowedTypes('spotlight', ['bool', 'string', 'null']); | |||
$resolver->setAllowedTypes('spotlight_url', 'string'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably obsolete now. (this referring to spotlight_url
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this should be marked as deprecated, can't remove it yet but will be slated to be removed in 5.x will update the code to mark it as such!
return [ | ||
['', false, $defaultSpotlightUrl], | ||
['true', true, $defaultSpotlightUrl], | ||
['1', true, $defaultSpotlightUrl], | ||
['false', false, $defaultSpotlightUrl], | ||
['0', false, $defaultSpotlightUrl], | ||
['null', false, $defaultSpotlightUrl], | ||
['http://localhost:1234', true, 'http://localhost:1234'], | ||
['some invalid looking value', false, $defaultSpotlightUrl], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the logic we used in Python SDK first (and then ported to JS): https://github.com/getsentry/sentry-python/pull/3443/files#diff-e9f88ca6368ce622839e078ed26c741a927752c01ceae64cd504d3ae86de6fd2R74-R75
@BYK ? |
Lol -- @cleptric was wondering if you have any objections as last time we talked about this you seemed on the fence for making |
My opinion on this didn't change, but I won't object these changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sending back for deprecation changes.
return false; | ||
} | ||
|
||
if (str_starts_with($booleanOrUrl, 'http')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious why CI does not fail here, as str_starts_with
is only available since PHP 8.0. We removed all polyfills, so maybe our CI setup adds some intransparent extensions?
I would prefer we use FILTER_VALIDATE_URL here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's required by any Symfony package, it's their approach to use them always. In our case, it's symfony/options-resolver
: https://packagist.org/packages/symfony/options-resolver#v5.4.45
This reads
SENTRY_SPOTLIGHT
environment variable as source of truth and also allows passing the URL directly to thespotlight
option.Related getsentry/spotlight#545 and getsentry/spotlight#482