-
Notifications
You must be signed in to change notification settings - Fork 155
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
Add http.route tag to SymfonyIntegration.php #2710
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2710 +/- ##
============================================
- Coverage 77.85% 8.32% -69.53%
- Complexity 2212 2216 +4
============================================
Files 227 104 -123
Lines 26561 9223 -17338
Branches 988 0 -988
============================================
- Hits 20678 768 -19910
- Misses 5357 8455 +3098
+ Partials 526 0 -526
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 201 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Hey @Julian-Louis, thanks for taking the initiative here! I think this approach may not be fully correct. Like, normalization is basically trying to recognize ids, but if you have routes which contain a name / a string identifier, not matching these patterns, the parameter will be assigned wrongly, I think. E.g. let's assume a route |
Hello, thank you for your feedback ! |
Hello @bwoebi, I revisited my code and implemented a new approach! By using a reflection class, I had access to the Symfony container, allowing me to utilize the router matcher. This allows me to accurately retrieve the actual parameters and URL of the route. And I normalized the URL by replacing parameter keys with corresponding values in the URL. What do you think of it ? |
Hmm @Julian-Louis, I think this code has another missing case: Now a route I've been looking through the Symfony code right now, and am finding Router::getRouteCollection(), which contains all routes with their names and paths. Either the $router->options['cache_dir'] is set and the Router::getRouteCollection() is loaded if uncached or it's not set and it's always present. A direct mapping from a cache file should be quite fast then I suppose? Note that I have no idea what I'm talking about though, not an expert in Symfony, just navigating through their codebase and trying to figure out what's going on there. Please tell me if my suggestion is unreasonable :-) |
@bwoebi I'm not a big symfony expert too, but I'll try to take a look on the way you suggest |
I think the current solution is probably viable. It's not 100% correct (e.g. I also have no idea of the performance characteristics; I'll leave that to somebody else from my team to evaluate :-) |
Hello, this is draft pull request adds the http.route tag to the Symfony integration.
Noticing that PR #2477 was closed, I decided to take the initiative to implement this feature.
Can you please provide your feedback on this proposal/implementation? If approved, I'll proceed with implementing tests to further validate the changes.
Thank you for your review !
Reviewer checklist