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

Load configuration from Plist files #582

Merged
merged 4 commits into from
May 7, 2020
Merged

Load configuration from Plist files #582

merged 4 commits into from
May 7, 2020

Conversation

fractalwrench
Copy link
Contributor

@fractalwrench fractalwrench commented May 4, 2020

Goal

Allows loading of Configuration from Plist files, without creating a configuration object up front in code.

Changeset

  • Added BugsnagConfiguration.loadConfig() method, which reads from the main bundle's plist. Note that the naming is a required deviation from the spec due to an existing method on NSObject
  • Added non-public class BSGConfigurationBuilder which loads configuration options from the plist under the 'bugsnag' key
  • Updated BugsnagConfiguration to set the apiKey property to an empty string if it is not a valid value or a string value. Previous behaviour was to keep it as the passed in value, even if the object was of a different type (such as a dictionary)

Reads the following values:

apiKey
appType
appVersion
autoDetectErrors
autoTrackSessions
bundleVersion
persistUser
releaseStage
enabledReleaseStages
endpoints
maxBreadcrumbs
redactedKeys
sendThreads

Tests

  • Added unit tests to verify the default and overridden values of configuration options loaded from a plist
  • Added a mazerunner scenario which loads configuration from a plist

@fractalwrench fractalwrench force-pushed the v6-config-load branch 14 times, most recently from 5c32bc6 to 2c81c86 Compare May 5, 2020 15:16
@fractalwrench fractalwrench marked this pull request as ready for review May 5, 2020 16:40
@fractalwrench fractalwrench requested a review from robinmacharg May 5, 2020 16:40
Copy link
Contributor

@robinmacharg robinmacharg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Couple of small nits to address.

OSX/Info.plist Show resolved Hide resolved
OSX/Info.plist Outdated Show resolved Hide resolved
Source/BSGConfigurationBuilder.h Show resolved Hide resolved
@robinmacharg robinmacharg self-requested a review May 6, 2020 15:32
Copy link
Contributor

@robinmacharg robinmacharg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

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.

3 participants