-
Notifications
You must be signed in to change notification settings - Fork 130
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
feat(spec): Added designated initializer to BugsnagConfiguration #446
feat(spec): Added designated initializer to BugsnagConfiguration #446
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.
Haven't finished going through everything, but I added a few initial thoughts. In addition, I had one which didn't cleanly apply to the current diff:
- The declaration for
Configuration.apiKey
is marked asnullable
where it should now benonnull
.
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.
Looks good and overall works as expected. I have one interface concern particularly for Swift that I've added inline.
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.
The implementation looks good! Added a couple comments for future proofing against accidental regressions in the tests.
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.
Looks like a nice changeset 🎉
Happy to approve on the basis that this will be rebased + tests will pass on CI before merging.
(effectively) removed convenience init, updated ObjC tests, added Swift test, adjusted designated initializer's Swift exposure fix: Updated .gitignore to exclude IDEWorkspaceChecks.plist
Co-Authored-By: Delisa <[email protected]>
Co-Authored-By: Delisa <[email protected]>
Added .md files to project to make updates simpler.
Adding swift has broken the Xcode 10.2 env, fix by creating a dir https://stackoverflow.com/questions/55389080/
ac94f68
to
1d43f5d
Compare
(effectively) removed convenience init, updated ObjC tests, added Swift test, adjusted designated initializer's Swift exposure fix: Updated .gitignore to exclude IDEWorkspaceChecks.plist
Adding swift has broken the Xcode 10.2 env, fix by creating a dir https://stackoverflow.com/questions/55389080/
…e rigorous testing.
…ion-designated-initializer
…:bugsnag/bugsnag-cocoa into add-configuration-designated-initializer
…iguration-designated-initializer # Conflicts: # CHANGELOG.md # Tests/BugsnagEventTests.m
Goal
The notifier spec. states that an
apiKey
must be provided when initializing aBugsnagConfiguration
. To this end removing the default constructor and providing a new apiKey-accepting designated initializer is the solution.Design
An initializer has been added to
BugsnagConfiguration
and its designated status indicated with theNS_DESIGNATED_INITIALIZER
macro.init()
is required (calls to designated initializers MUST call super) but has been made to fail if called. It was desired to provideapiKey
as an unnamed parameter but theNS_SWIFT_NAME
macro doesn't appear to offer this functionality.Changeset
A new initializer was added. The default
init()
was made to fail.Tests
Unit tests were added to ensure that the new initializer performed as expected. All tests that depended on the default init() have been modified to use the new initializer. A Swift test was added to ensure that the method is exposed correctly.
Review
Outstanding Questions
master
for fixes,next
forfeatures)