-
Notifications
You must be signed in to change notification settings - Fork 33
Feature flags #247
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
base: integration/uplift-2025
Are you sure you want to change the base?
Feature flags #247
Conversation
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.
Pull request overview
This PR implements feature flag functionality across the Bugsnag Java SDK, allowing users to annotate error reports with information about active experiments or A/B tests. Feature flags can be set at configuration, client, and event levels, with support for optional variants and proper inheritance/override behavior.
- Added core
FeatureFlagandFeatureFlagStoreclasses to manage feature flags with insertion order preservation - Integrated feature flags into
Configuration,Bugsnag, andReportclasses with add/clear operations - Added logback appender support for configuring feature flags via XML
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| bugsnag/src/main/java/com/bugsnag/FeatureFlag.java | Core feature flag model with name and optional variant |
| bugsnag/src/main/java/com/bugsnag/FeatureFlagStore.java | Thread-safe storage maintaining insertion order |
| bugsnag/src/main/java/com/bugsnag/Configuration.java | Added feature flag methods to configuration |
| bugsnag/src/main/java/com/bugsnag/Bugsnag.java | Added client-level feature flag support with store initialization |
| bugsnag/src/main/java/com/bugsnag/Report.java | Added event-level feature flags with inheritance from config and client |
| bugsnag/src/main/java/com/bugsnag/BugsnagAppender.java | Added logback XML configuration support for feature flags |
| bugsnag/src/main/java/com/bugsnag/logback/LogbackFeatureFlag.java | Configuration bean for logback XML parsing |
| bugsnag/src/test/java/com/bugsnag/*.java | Comprehensive unit tests for feature flag functionality |
| features/*.java | End-to-end test scenarios for feature flags |
| features/feature_flags.feature | Cucumber test specifications |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bugsnag/src/test/java/com/bugsnag/ConfigurationFeatureFlagTest.java
Outdated
Show resolved
Hide resolved
bugsnag/src/test/java/com/bugsnag/ConfigurationFeatureFlagTest.java
Outdated
Show resolved
Hide resolved
bugsnag/src/test/java/com/bugsnag/ConfigurationFeatureFlagTest.java
Outdated
Show resolved
Hide resolved
bugsnag/src/test/java/com/bugsnag/ConfigurationFeatureFlagTest.java
Outdated
Show resolved
Hide resolved
bugsnag/src/test/java/com/bugsnag/ConfigurationFeatureFlagTest.java
Outdated
Show resolved
Hide resolved
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.
Pull request overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request introduces first-class support for feature flags in the Bugsnag Java notifier, enabling users to annotate error reports with feature flag information for better experimentation and release tracking. The changes add new APIs for managing feature flags at the configuration, client, and report levels, and ensure feature flag data is included in error reports. Additionally, the Logback integration is updated to support feature flags via configuration.
Feature flag support (core):
FeatureFlagclass to represent feature flags with a name and optional variant.FeatureFlagStoreclass to manage feature flag storage and merging logic.Configuration,Bugsnag, andReportclasses to include APIs for adding, clearing, and retrieving feature flags, and to ensure flags are propagated and merged correctly at all levels. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]Logback integration:
BugsnagAppenderto allow feature flags to be configured vialogback.xmland manipulated at runtime, ensuring they are added to the Bugsnag client and included in error reports. [1] [2] [3] [4]These changes provide a comprehensive and flexible way to track feature flag exposure in error reports, supporting use cases like A/B testing and gradual rollouts.
References:
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17]