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 ThreadSafe annotation to com.bugsnag.android, remove infer dependency #370

Merged
merged 3 commits into from Oct 1, 2018

Conversation

fractalwrench
Copy link
Contributor

@fractalwrench fractalwrench commented Sep 4, 2018

Goal

Removes the need for a compile-time dependency on the infer-annotation artefact.

Changeset

  • Added @ThreadSafe annotation to bugsnag package
  • Removed imports of infer-annotation
  • Altered build process so that the infer property must be set to compile infer-annotation artefact

Tests

  • Ran ./infer.sh
  • Ran ./gradlew sdk:assemble to confirm
  • Ran generatePomFileForProductionPublication task to confirm that the generated POM excludes the infer-annotation dependency.
  • Ran existing unit/mazerunner tests on CI

Discussion

Alternative Approaches

We could attempt forking Uber's infer plugin, which is deprecated.

Linked issues

Fixes #366

Review

For the submitter, initial self-review:

  • Commented on code changes inline explain the reasoning behind the approach
  • Reviewed the test cases added for completeness and possible points for discussion
  • A changelog entry was added for the goal of this pull request
  • Check the scope of the changeset - is everything in the diff required for the pull request?
  • This pull request is ready for:
    • Initial review of the intended approach, not yet feature complete
    • Structural review of the classes, functions, and properties modified
    • Final review

For the pull request reviewer(s), this changeset has been reviewed for:

  • Consistency across platforms for structures or concepts added or modified
  • Consistency between the changeset and the goal stated above
  • Internal consistency with the rest of the library - is there any overlap between existing interfaces and any which have been added?
  • Usage friction - is the proposed change in usage cumbersome or complicated?
  • Performance and complexity - are there any cases of unexpected O(n^3) when iterating, recursing, flat mapping, etc?
  • Concurrency concerns - if components are accessed asynchronously, what issues will arise
  • Thoroughness of added tests and any missing edge cases
  • Idiomatic use of the language

infer.sh Outdated
@@ -1,3 +1,5 @@
#!/usr/bin/env bash
./gradlew clean && infer --disable-issue-type "NULL_DEREFERENCE" \
--disable-issue-type "RESOURCE_LEAK" -- ./gradlew sdk:build
--disable-issue-type "RESOURCE_LEAK" \
--threadsafe-aliases "[\"ThreadSafe\"]" \
Copy link
Contributor Author

Choose a reason for hiding this comment

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

adds com.bugsnag.android.ThreadSafe as an alias for com.facebook.infer.annotation.ThreadSafe

@fractalwrench fractalwrench requested a review from a team September 4, 2018 10:52
Copy link
Contributor

@kattrali kattrali left a comment

Choose a reason for hiding this comment

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

Seems pretty magical (in a good way). Shouldn't there be something in the contrib guide about how to run this and what its for?

CHANGELOG.md Outdated

### Bug fixes

* Add ThreadSafe annotation to com.bugsnag.android, remove infer dependency [#370](https://github.com/bugsnag/bugsnag-android/pull/370)
Copy link
Contributor

Choose a reason for hiding this comment

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

This should also link the fixed issue.

kattrali added a commit to bugsnag/bugsnag-react-native that referenced this pull request Sep 28, 2018
React Native includes a different version of ThreadSafe, breaking the
build in React Native apps which include bugsnag-react-native. This is
fixed by bugsnag/bugsnag-android#370.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 68.545% when pulling 7c1910f on update-infer-setup into b70c558 on master.

@fractalwrench fractalwrench merged commit b4c1dd3 into master Oct 1, 2018
@fractalwrench fractalwrench deleted the update-infer-setup branch October 1, 2018 08:14
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.

None yet

3 participants