Skip to content

Conversation

@richardelms
Copy link
Contributor

@richardelms richardelms commented Dec 5, 2025

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):

  • Added a new FeatureFlag class to represent feature flags with a name and optional variant.
  • Introduced a thread-safe FeatureFlagStore class to manage feature flag storage and merging logic.
  • Updated the Configuration, Bugsnag, and Report classes 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:

  • Enhanced BugsnagAppender to allow feature flags to be configured via logback.xml and 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]

@richardelms richardelms changed the base branch from next to integration/uplift-2025 December 5, 2025 10:37
@richardelms richardelms requested a review from Copilot December 15, 2025 14:47
@richardelms richardelms self-assigned this Dec 15, 2025
Copy link

Copilot AI left a 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 FeatureFlag and FeatureFlagStore classes to manage feature flags with insertion order preservation
  • Integrated feature flags into Configuration, Bugsnag, and Report classes 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.

@richardelms richardelms requested a review from Copilot December 16, 2025 10:36
Copy link

Copilot AI left a 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.

@richardelms richardelms marked this pull request as ready for review December 19, 2025 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants