Skip to content

Commit

Permalink
Merge branch 'next' into anr-message-improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
fractalwrench committed Aug 14, 2019
2 parents 3ba4c5e + 78eeab3 commit c6dd9b7
Show file tree
Hide file tree
Showing 203 changed files with 405 additions and 480 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## TBD

* Migrate dependencies to androidx
[#554](https://github.com/bugsnag/bugsnag-android/pull/554)

* Improve ANR error message information
[#553](https://github.com/bugsnag/bugsnag-android/pull/553)

## 4.18.0-beta01 (2019-08-09)

* Improve ANR error message information
Expand Down
99 changes: 1 addition & 98 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,101 +127,4 @@ this version when you next run the app.

# Releasing a New Version

If you are a project maintainer, you can build and release a new version of
`bugsnag-android` as follows:

## One-time setup

- Create a [Bintray](https://bintray.com/signup/oss) account, and ask a Bugsnag admin to add you to the organisation
- Create a [Sonatype JIRA](https://issues.sonatype.org) account
- Ask in the [Bugsnag Sonatype JIRA ticket](https://issues.sonatype.org/browse/OSSRH-5533) to become a contributor
- Ask an existing contributor (likely Simon) to confirm in the ticket
- Wait for Sonatype them to confirm the approval
- Create a file `~/.gradle/gradle.properties` with the following contents:

```ini
# Your credentials for https://oss.sonatype.org/
# NOTE: An equals sign (`=`) in any of these fields will break the parser
# NOTE: Do not wrap any field in quotes

NEXUS_USERNAME=your-nexus-username
NEXUS_PASSWORD=your-nexus-password
nexusUsername=your-nexus-username
nexusPassword=your-nexus-password

# Your credentials for Bintray
# From https://bintray.com/profile
bintray_user=your-bintray-username
# Get your Bintray API key from https://bintray.com/profile/edit > API Key
bintray_api_key=your-api-key

# GPG key details
# Your key must be added to a public key server, such as http://keys.gnupg.net:
# 1. Get your key id by running `gpg --list-keys --keyid-format=short`. It
# should be 8-character hexadecimal.
# 2. Export your key using `gpg --armor --export <key-id>`
# 3. Upload to a server using `gpg --keyserver hkp://keys.gnupg.net --send-keys <key-id>`
signing.keyId=<key-id>
signing.password=your-gpg-key-passphrase
signing.secretKeyRingFile=/Users/{username}/.gnupg/secring.gpg
```

## Every time

### Pre-release Checklist

- [ ] Does the build pass on the CI server?
- [ ] Are all Docs PRs ready to go?
- [ ] Do the installation instructions work when creating an example app from scratch?
- [ ] Has all new functionality been manually tested on a release build?
- [ ] Ensure the example app sends an unhandled error
- [ ] Ensure the example app sends a handled error
- [ ] If a response is not received from the server, is the report queued for later?
- [ ] If no network connection is available, is the report queued for later?
- [ ] On a throttled network, is the request timeout reasonable, and the main thread not blocked by any visible UI freeze? (Throttling can be achieved by setting both endpoints to "https://httpstat.us/200?sleep=5000")
- [ ] Are queued reports sent asynchronously?
- Native functionality checks:
- [ ] Rotate the device before notifying. Is the orientation at the time
persisted in the report on the dashboard?
- [ ] Rotate the device before causing a native crash. Is the orientation at
the time of the crash persisted in the report on the dashboard?
- [ ] Wait a few seconds before a native crash. Does the reported duration in
foreground match your expectation? Is the value for "inForeground" correct?
- [ ] Do the function names demangle correctly when using notify?
- [ ] Have the installation instructions been updated on the [dashboard](https://github.com/bugsnag/dashboard-js/tree/master/js/dashboard/components/integration_instructions) as well as the [docs site](https://github.com/bugsnag/docs.bugsnag.com)?
- [ ] Do the installation instructions work for a manual integration?

### Making the release

- Make a PR to release the following changes to master, creating a release
branch from the "next" branch if this is a feature release:
- [ ] Update the version number and dex count badge by running `make VERSION=[number] bump`
- [ ] Inspect the updated CHANGELOG, README, and version files to ensure they are correct
- Once merged:
- Pull the latest changes (checking out master if necessary) and build by running `./gradlew assembleRelease`
- Release to GitHub:
- [ ] Run `git tag vX.X.X && git push origin --tags`
- [ ] Create a release from your new tag on [GitHub Releases](https://github.com/bugsnag/bugsnag-android/releases)
- [ ] Release to Maven Central and Bintray by running `./gradlew assembleRelease publish bintrayUpload`
- [ ] "Promote" the release build on Maven Central:
- Go to the [sonatype open source dashboard](https://oss.sonatype.org/index.html#stagingRepositories)
- Click the search box at the top right, and type “com.bugsnag”
- Select the com.bugsnag staging repository
- Click the “close” button in the toolbar, no message
- Click the “refresh” button
- Select the com.bugsnag closed repository
- Click the “release” button in the toolbar
- Open the Bintray repositories and publish the new artifacts:
- [ ] [SDK repo](https://bintray.com/bugsnag/maven/bugsnag-android/_latestVersion)
- [ ] [NDK repo](https://bintray.com/bugsnag/maven/bugsnag-android-ndk/_latestVersion)
- Merge outstanding docs PRs related to this release


### Post-release Checklist

_(May take some time to propagate to maven central and bintray)_

- [ ] Have all Docs PRs been merged?
- [ ] Can a freshly created example app send an error report from a release build using the released artefact?
- [ ] Do the existing example apps send an error report using the released artifact?
- [ ] Make releases to downstream libraries, if appropriate (generally for bug fixes)
Full details of how to release can be found in [the release guide](`RELEASING.md`)
101 changes: 101 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Releasing a New Version

If you are a project maintainer, you can build and release a new version of
`bugsnag-android` as follows:

## One-time setup

- Create a [Bintray](https://bintray.com/signup/oss) account, and ask a Bugsnag admin to add you to the organisation
- Create a [Sonatype JIRA](https://issues.sonatype.org) account
- Ask in the [Bugsnag Sonatype JIRA ticket](https://issues.sonatype.org/browse/OSSRH-5533) to become a contributor
- Ask an existing contributor (likely Simon) to confirm in the ticket
- Wait for Sonatype them to confirm the approval
- Create a file `~/.gradle/gradle.properties` with the following contents:

```ini
# Your credentials for https://oss.sonatype.org/
# NOTE: An equals sign (`=`) in any of these fields will break the parser
# NOTE: Do not wrap any field in quotes

NEXUS_USERNAME=your-nexus-username
NEXUS_PASSWORD=your-nexus-password
nexusUsername=your-nexus-username
nexusPassword=your-nexus-password

# Your credentials for Bintray
# From https://bintray.com/profile
bintray_user=your-bintray-username
# Get your Bintray API key from https://bintray.com/profile/edit > API Key
bintray_api_key=your-api-key

# GPG key details
# Your key must be added to a public key server, such as http://keys.gnupg.net:
# 1. Get your key id by running `gpg --list-keys --keyid-format=short`. It
# should be 8-character hexadecimal.
# 2. Export your key using `gpg --armor --export <key-id>`
# 3. Upload to a server using `gpg --keyserver hkp://keys.gnupg.net --send-keys <key-id>`
signing.keyId=<key-id>
signing.password=your-gpg-key-passphrase
signing.secretKeyRingFile=/Users/{username}/.gnupg/secring.gpg
```

## Every time

### Pre-release Checklist

- [ ] Has the full test suite been triggered on Buildkite and does it pass?
- [ ] Does the build pass on the CI server?
- [ ] Are all Docs PRs ready to go?
- [ ] Do the installation instructions work when creating an example app from scratch?
- [ ] Has all new functionality been manually tested on a release build?
- [ ] Ensure the example app sends an unhandled error
- [ ] Ensure the example app sends a handled error
- [ ] If a response is not received from the server, is the report queued for later?
- [ ] If no network connection is available, is the report queued for later?
- [ ] On a throttled network, is the request timeout reasonable, and the main thread not blocked by any visible UI freeze? (Throttling can be achieved by setting both endpoints to "https://httpstat.us/200?sleep=5000")
- [ ] Are queued reports sent asynchronously?
- Native functionality checks:
- [ ] Rotate the device before notifying. Is the orientation at the time
persisted in the report on the dashboard?
- [ ] Rotate the device before causing a native crash. Is the orientation at
the time of the crash persisted in the report on the dashboard?
- [ ] Wait a few seconds before a native crash. Does the reported duration in
foreground match your expectation? Is the value for "inForeground" correct?
- [ ] Do the function names demangle correctly when using notify?
- [ ] Have the installation instructions been updated on the [dashboard](https://github.com/bugsnag/dashboard-js/tree/master/js/dashboard/components/integration_instructions) as well as the [docs site](https://github.com/bugsnag/docs.bugsnag.com)?
- [ ] Do the installation instructions work for a manual integration?

### Making the release

- Make a PR to release the following changes to master, creating a release
branch from the "next" branch if this is a feature release:
- [ ] Update the version number and dex count badge by running `make VERSION=[number] bump`
- [ ] Inspect the updated CHANGELOG, README, and version files to ensure they are correct
- Once merged:
- Pull the latest changes (checking out master if necessary) and build by running `./gradlew assembleRelease`
- Release to GitHub:
- [ ] Run `git tag vX.X.X && git push origin --tags`
- [ ] Create a release from your new tag on [GitHub Releases](https://github.com/bugsnag/bugsnag-android/releases)
- [ ] Release to Maven Central and Bintray by running `./gradlew assembleRelease publish bintrayUpload`
- [ ] "Promote" the release build on Maven Central:
- Go to the [sonatype open source dashboard](https://oss.sonatype.org/index.html#stagingRepositories)
- Click the search box at the top right, and type “com.bugsnag”
- Select the com.bugsnag staging repository
- Click the “close” button in the toolbar, no message
- Click the “refresh” button
- Select the com.bugsnag closed repository
- Click the “release” button in the toolbar
- Open the Bintray repositories and publish the new artifacts:
- [ ] [SDK repo](https://bintray.com/bugsnag/maven/bugsnag-android/_latestVersion)
- [ ] [NDK repo](https://bintray.com/bugsnag/maven/bugsnag-android-ndk/_latestVersion)
- Merge outstanding docs PRs related to this release


### Post-release Checklist

_(May take some time to propagate to maven central and bintray)_

- [ ] Have all Docs PRs been merged?
- [ ] Can a freshly created example app send an error report from a release build using the released artefact?
- [ ] Do the existing example apps send an error report using the released artifact?
- [ ] Make releases to downstream libraries, if appropriate (generally for bug fixes)
2 changes: 1 addition & 1 deletion bugsnag-android-core/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<application android:label="Bugsnag Android Tests"></application>

<instrumentation
android:name="android.support.test.runner.AndroidJUnitRunner"
android:name="androidx.test.runner.AndroidJUnitRunner"
android:targetPackage="com.bugsnag.android">
<meta-data
android:name="listener"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.bugsnag.android

import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Test

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.bugsnag.android

import android.support.test.InstrumentationRegistry
import android.content.Context
import androidx.test.core.app.ApplicationProvider
import com.bugsnag.android.BugsnagTestUtils.mapToJson
import org.junit.Assert.assertEquals
import org.junit.Before
Expand All @@ -26,7 +27,7 @@ class AppDataOverrideTest {
config.appVersion = "1.2.3"
config.releaseStage = "test-stage"

val context = InstrumentationRegistry.getContext()
val context = ApplicationProvider.getApplicationContext<Context>()
val packageManager = context.packageManager
val obj = AppData(context, packageManager, config, sessionTracker)
this.appData = obj.appData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import android.content.Context;
import android.content.pm.PackageManager;
import android.support.test.InstrumentationRegistry;
import androidx.test.core.app.ApplicationProvider;

import org.json.JSONException;
import org.json.JSONObject;
Expand Down Expand Up @@ -34,7 +34,7 @@ public class AppDataSummaryTest {
*/
@Before
public void setUp() throws Exception {
Context context = InstrumentationRegistry.getContext();
Context context = ApplicationProvider.getApplicationContext();
PackageManager packageManager = context.getPackageManager();
Configuration config = new Configuration("api-key");
AppData obj = new AppData(context, packageManager, config, sessionTracker);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

import android.content.Context;
import android.content.pm.PackageManager;
import android.support.test.InstrumentationRegistry;

import androidx.test.core.app.ApplicationProvider;

import org.json.JSONException;
import org.json.JSONObject;
Expand Down Expand Up @@ -43,7 +44,7 @@ public void setUp() throws Exception {
when(sessionTracker.isInForeground()).thenReturn(true);
when(sessionTracker.getDurationInForegroundMs(anyLong())).thenReturn(500L);

Context context = InstrumentationRegistry.getContext();
Context context = ApplicationProvider.getApplicationContext();
PackageManager packageManager = context.getPackageManager();
Configuration config = new Configuration("api-key");
AppData obj = new AppData(context, packageManager, config, sessionTracker);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@ package com.bugsnag.android

import org.junit.Assert.assertEquals

import android.support.test.filters.SmallTest
import android.support.test.runner.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.bugsnag.android.BugsnagTestUtils.generateSessionTracker

import org.junit.Test
import org.junit.runner.RunWith

@RunWith(AndroidJUnit4::class)
@SmallTest
class BeforeNotifyTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,15 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;

import android.support.annotation.NonNull;
import android.support.test.InstrumentationRegistry;
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;
import androidx.annotation.NonNull;
import androidx.test.filters.SmallTest;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

import java.util.HashMap;

@RunWith(AndroidJUnit4.class)
@SmallTest
public class BeforeRecordBreadcrumbsTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;

import android.support.annotation.NonNull;
import android.support.test.InstrumentationRegistry;
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;
import androidx.annotation.NonNull;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.filters.SmallTest;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

@RunWith(AndroidJUnit4.class)
@SmallTest
public class BeforeSendTest {

Expand Down Expand Up @@ -42,7 +39,7 @@ public void deliver(@NonNull Report report,
lastReport = report;
}
});
client = new Client(InstrumentationRegistry.getContext(), config);
client = new Client(ApplicationProvider.getApplicationContext(), config);
}

@After
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,18 @@ package com.bugsnag.android
import com.bugsnag.android.BreadcrumbType.MANUAL
import org.junit.Assert.assertEquals

import android.support.test.filters.SmallTest
import android.support.test.runner.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.bugsnag.android.BugsnagTestUtils.*

import org.json.JSONException
import org.junit.After
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith

import java.io.IOException
import java.util.HashMap
import java.util.Locale

@RunWith(AndroidJUnit4::class)
@SmallTest
class BreadcrumbsTest {

Expand Down
Loading

0 comments on commit c6dd9b7

Please sign in to comment.