-
-
Notifications
You must be signed in to change notification settings - Fork 27
feat(sentry): add backwards compatibility for legacy configuration keys #992
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
Conversation
Add compatibility layer to support old Sentry configuration structure while maintaining new API. This ensures smooth migration path for users upgrading from previous versions. Changes: - Map `sentry.tracing.spans` to `sentry.tracing_spans` - Map `sentry.tracing.extra_tags` to `sentry.tracing_tags` - Migrate `sentry.tracing.enable.*` to flat `sentry.tracing.*` structure - Add `compatibilityConfigurations()` method to handle legacy config migration This maintains backwards compatibility while supporting the simplified configuration structure introduced in recent refactoring.
|
Warning Rate limit exceeded@huangdijia has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 19 minutes and 16 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
总览在 变更
代码审查工作量评估🎯 2 (简单) | ⏱️ ~8 分钟
相关的 PR
诗
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/sentry/src/Listener/SetupSentryListener.php(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
src/*/src/**/*.php
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
All component PHP code must use the namespace pattern FriendsOfHyperf{ComponentName}
Files:
src/sentry/src/Listener/SetupSentryListener.php
**/*.php
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.php: Code style must follow PSR-12 and be formatted by PHP-CS-Fixer per .php-cs-fixer.php
Run PHPStan and keep the codebase passing per phpstan.neon.dist
Files:
src/sentry/src/Listener/SetupSentryListener.php
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (17)
- GitHub Check: Test on PHP 8.1 with Swoole 6.0.2
- GitHub Check: Test on PHP 8.2 with Swoole 6.1.1
- GitHub Check: Test on PHP 8.1 with Swoole 5.1.8
- GitHub Check: Test on PHP 8.1 with Swoole 6.1.1
- GitHub Check: Test on PHP 8.2 with Swoole 6.0.2
- GitHub Check: Test on PHP 8.2 with Swoole 5.1.8
- GitHub Check: Test on PHP 8.3 with Swoole 5.1.8
- GitHub Check: Test on PHP 8.3 with Swoole 6.0.2
- GitHub Check: Test on PHP 8.3 with Swoole 6.1.1
- GitHub Check: Test on PHP 8.2 with Swoole 5.1.8
- GitHub Check: Test on PHP 8.1 with Swoole 6.1.1
- GitHub Check: Test on PHP 8.3 with Swoole 5.1.8
- GitHub Check: Test on PHP 8.3 with Swoole 6.1.1
- GitHub Check: Test on PHP 8.1 with Swoole 5.1.8
- GitHub Check: Test on PHP 8.2 with Swoole 6.0.2
- GitHub Check: Test on PHP 8.2 with Swoole 6.1.1
- GitHub Check: Test on PHP 8.3 with Swoole 6.0.2
🔇 Additional comments (3)
src/sentry/src/Listener/SetupSentryListener.php (3)
81-81: 调用时机正确。在
process()方法开始时调用配置兼容性处理是合理的,确保在其他设置步骤之前完成配置迁移。
90-92: 迁移逻辑正确。正确地检查了源键存在且目标键不存在的情况,避免了覆盖用户的新配置。
94-96: 迁移逻辑正确。与第一个迁移保持一致,正确地处理了配置键的迁移。
…ys (#992) * feat(sentry): add backwards compatibility for legacy configuration keys Add compatibility layer to support old Sentry configuration structure while maintaining new API. This ensures smooth migration path for users upgrading from previous versions. Changes: - Map `sentry.tracing.spans` to `sentry.tracing_spans` - Map `sentry.tracing.extra_tags` to `sentry.tracing_tags` - Migrate `sentry.tracing.enable.*` to flat `sentry.tracing.*` structure - Add `compatibilityConfigurations()` method to handle legacy config migration This maintains backwards compatibility while supporting the simplified configuration structure introduced in recent refactoring. * refactor(sentry): streamline compatibility configuration mapping for tracing keys --------- Co-authored-by: Deeka Wong <8337659+huangdijia@users.noreply.github.com>
Summary
This PR adds a backwards compatibility layer for legacy Sentry configuration keys to ensure a smooth migration path for users upgrading from previous versions.
Changes
compatibilityConfigurations()method to handle legacy config migrationsentry.tracing.spans→sentry.tracing_spanssentry.tracing.extra_tags→sentry.tracing_tagssentry.tracing.enable.*to flatsentry.tracing.*structureContext
Recent refactoring simplified the Sentry configuration structure (#991, #990). This PR ensures that existing configurations using the old structure continue to work without requiring immediate migration.
Test Plan
sentry.tracing.spans,sentry.tracing.extra_tags,sentry.tracing.enable) are properly migratedSummary by CodeRabbit
Bug Fixes