Skip to content
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 support for feature flags #758

Merged
merged 24 commits into from
Dec 1, 2022
Merged

Add support for feature flags #758

merged 24 commits into from
Dec 1, 2022

Commits on Nov 30, 2022

  1. Add FeatureFlag class

    imjoehaines committed Nov 30, 2022
    Configuration menu
    Copy the full SHA
    fd37682 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e4ca5e0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9fcc5c8 View commit details
    Browse the repository at this point in the history
  4. Add FeatureFlag#valid?

    This returns true if:
    
    - name is a string with at least 1 character
    - variant is nil OR variant is a string
    imjoehaines committed Nov 30, 2022
    Configuration menu
    Copy the full SHA
    92c8950 View commit details
    Browse the repository at this point in the history
  5. Drop feature flags that are invalid

    The FeatureFlagDelegate now ensures flags are valid before storing them,
    so we no longer deliver flags with invalid names
    imjoehaines committed Nov 30, 2022
    Configuration menu
    Copy the full SHA
    5e25613 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    21b7edb View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    0e2171a View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    eca29f4 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    9c4506f View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    ff88b6c View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    748f556 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    4562158 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    3901a48 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    33cc5e6 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    9735247 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    6abf4ba View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    f1f416e View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    7ff633c View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    d32fe09 View commit details
    Browse the repository at this point in the history
  20. Store feature flags per-request

    This allows users to add feature flags to Bugsnag whenever they interact
    with their feature flag service, e.g.
    
    ```ruby
    flag = get_flag_from_service('new-login-page')
    
    if flag.enabled?
      Bugsnag.add_feature_flag('new-login-page')
      # render new login page
    else
      Bugsnag.clear_feature_flag('new-login-page')
      # render old login page
    end
    ```
    
    The previous implementation relied on event's already being request
    specific, but meant feature flags would usually have to be added in an
    on_error callback
    imjoehaines committed Nov 30, 2022
    Configuration menu
    Copy the full SHA
    7d943a8 View commit details
    Browse the repository at this point in the history
  21. Refactor feature flag methods into a new module

    Now that the implementations of add_/clear_feature_flag(s) are the same,
    we can use a module to implement these methods and save us from having
    copy pasted methods/docs in 3 places
    imjoehaines committed Nov 30, 2022
    Configuration menu
    Copy the full SHA
    b18801e View commit details
    Browse the repository at this point in the history
  22. Enable YARD's 'embed-mixins' option

    This embeds methods from included modules directly into the class' docs,
    rather than linking to them separately
    
    This makes the docs a lot clearer when a class includes some methods
    from a module as they are now listed next to every other method
    imjoehaines committed Nov 30, 2022
    Configuration menu
    Copy the full SHA
    08b3be4 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    92d2c5c View commit details
    Browse the repository at this point in the history
  24. Update changelog

    imjoehaines committed Nov 30, 2022
    Configuration menu
    Copy the full SHA
    25784ea View commit details
    Browse the repository at this point in the history