Skip to content

Commit

Permalink
Merge branch 'next' into convert-tests-to-jest-2
Browse files Browse the repository at this point in the history
  • Loading branch information
djskinner authored Aug 19, 2020
2 parents 99eefdb + d89bd36 commit 393e15f
Show file tree
Hide file tree
Showing 726 changed files with 90,851 additions and 250 deletions.
8 changes: 8 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ steps:
message: '${BUILDKITE_MESSAGE}'
async: true

- label: 'Trigger React-native pipeline'
trigger: 'at-bugsnag-react-native'
build:
branch: '${BUILDKITE_BRANCH}'
commit: '${BUILDKITE_COMMIT}'
message: '${BUILDKITE_MESSAGE}'
async: true

- label: 'Lint'
timeout_in_minutes: 10
plugins:
Expand Down
112 changes: 112 additions & 0 deletions .buildkite/react-native-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
steps:
- label: ':docker: Build and publish JS packages'
plugins:
- docker-compose#v3.3.0:
build: publisher
image-repository: 855461928731.dkr.ecr.us-west-1.amazonaws.com/js

- wait

- label: ':docker: Build React-Native Android Builder image'
timeout_in_minutes: 30
plugins:
- improbable-eng/metahook:
post-checkout: scripts/gather-react-native-files.sh
- docker-compose#v3.3.0:
build: react-native-android-builder
image-repository: 855461928731.dkr.ecr.us-west-1.amazonaws.com/js
cache-from: react-native-android-builder:855461928731.dkr.ecr.us-west-1.amazonaws.com/js:ci-${BRANCH_NAME}
- docker-compose#v3.3.0:
push: react-native-android-builder:855461928731.dkr.ecr.us-west-1.amazonaws.com/js:ci-${BRANCH_NAME}

- wait

- label: ':docker: Build React-native 0.60 apk'
env:
REACT_NATIVE_VERSION: "rn0.60"
plugins:
- docker-compose#v3.3.0:
run: react-native-android-builder
artifact_paths:
- build/rn0.60.apk

- label: ':ios: Build React-native 0.60 ipa'
agents:
queue: "opensource-mac"
env:
REACT_NATIVE_VERSION: rn0.60
artifact_paths: build/rn0.60.ipa
commands:
- npm run test:build-react-native-ios

- label: ':docker: Build React-native 0.63 apk'
env:
REACT_NATIVE_VERSION: "rn0.63"
plugins:
- docker-compose#v3.3.0:
run: react-native-android-builder
artifact_paths:
- build/rn0.63.apk

- label: ':ios: Build React-native 0.63 ipa'
agents:
queue: "opensource-mac"
env:
REACT_NATIVE_VERSION: rn0.63
artifact_paths: build/rn0.63.ipa
commands:
- npm run test:build-react-native-ios

- wait

- label: ':android: React-native 0.60 Android 9'
plugins:
artifacts#v1.2.0:
download: "build/rn0.60.apk"
docker-compose#v3.3.0:
run: react-native-maze-runner
use-aliases: true
env:
DEVICE_TYPE: "ANDROID_9"
APP_LOCATION: "build/rn0.60.apk"
concurrency: 10
concurrency_group: 'browserstack-app'

- label: ':ios: React-native 0.60 iOS 12'
plugins:
artifacts#v1.2.0:
download: "build/rn0.60.ipa"
docker-compose#v3.1.0:
run: react-native-maze-runner
use-aliases: true
env:
DEVICE_TYPE: "IOS_12"
APP_LOCATION: "build/rn0.60.ipa"
concurrency: 10
concurrency_group: 'browserstack-app'

- label: ':android: React-native 0.63 Android 9'
plugins:
artifacts#v1.2.0:
download: "build/rn0.63.apk"
docker-compose#v3.3.0:
run: react-native-maze-runner
use-aliases: true
env:
DEVICE_TYPE: "ANDROID_9"
APP_LOCATION: "build/rn0.63.apk"
concurrency: 10
concurrency_group: 'browserstack-app'

- label: ':ios: React-native 0.63 iOS 12'
plugins:
artifacts#v1.2.0:
download: "build/rn0.63.ipa"
docker-compose#v3.1.0:
run: react-native-maze-runner
use-aliases: true
env:
DEVICE_TYPE: "IOS_12"
APP_LOCATION: "build/rn0.63.ipa"
concurrency: 10
concurrency_group: 'browserstack-app'
9 changes: 2 additions & 7 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
node_modules
.git
examples
**/node_modules
!packages/plugin-node-surrounding-code/test/fixtures/node_modules/mock-module/index.js
lerna-debug.log
npm-debug.log
Dockerfile
Dockerfile*
docker-compose.yml
**/*.tgz
.buildkite
**/*.tgz
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ fixtures
scratch
coverage
packages/core/types/test/*.js
packages/react-native/android/build/reports
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ const ruleOverrides = {
// (Explicit) any has its valid use cases
'@typescript-eslint/no-explicit-any': 'off',

// We use noop functions liberally (() => {})
'@typescript-eslint/no-empty-function': 'off',

// This incorrectly fails on TypeScript method override signatures
'no-dupe-class-members': 'off',

// Disable all rules that require parserServices (for now)
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-misused-promises': 'off',
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build
docker-temp
node_modules
lerna-debug.log
coverage
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## 7.3.2 (2020-08-17)

### Fixed

- (react-native): Ensure type definitions are included the @bugsnag/react-native package. [#1002](https://github.com/bugsnag/bugsnag-js/pull/1002)

## 7.3.1 (2020-08-11)

### Fixed

- (plugin-react): Reinstate updated code after a bad merge on the type definitions. [#987](https://github.com/bugsnag/bugsnag-js/pull/987)

## 7.3.0 (2020-08-10)

As of this version, this repo contains our brand new notifier for React Native `@bugsnag/react-native`. See the [docs](https://docs.bugsnag.com/platforms/react-native/react-native) and [upgrade guide](packages/react-native/UPGRADING.md) for more info.

Some minor internal changes to shared code were made to support the new notifier, but no external changes are required for existing `@bugsnag/js` or `@bugsnag/expo` users to upgrade to this version.

## 7.2.1 (2020-07-22)

### Fixed
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Bugsnag error monitoring & reporting for JavaScript

Automatically detect JavaScript errors in the browser, Node.js and Expo, with plugins for React, Vue, Angular, Express, Restify and Koa. Get cross-platform error detection for handled and unhandled errors with real-time error alerts and detailed diagnostic reports.
Automatically detect JavaScript errors in the browser, Node.js, React Native and Expo, with plugins for React, Vue, Angular, Express, Restify and Koa. Get cross-platform error detection for handled and unhandled errors with real-time error alerts and detailed diagnostic reports.

Learn more about [JavaScript error reporting](https://www.bugsnag.com/platforms/javascript/) from Bugsnag.
Learn more about [JavaScript error reporting](https://www.bugsnag.com/platforms/javascript/) and [React Native error reporting](https://www.bugsnag.com/platforms/react-native-error-reporting/) from Bugsnag.

---

This is a monorepo (managed with [Lerna](https://lernajs.io/)) containing our universal error reporting client [`@bugsnag/js`](/packages/js) and our Expo client [`@bugsnag/expo`](/packages/expo), along with:
This is a monorepo (managed with [Lerna](https://lernajs.io/)) containing our universal error reporting client [`@bugsnag/js`](/packages/js), our Expo client [`@bugsnag/expo`](/packages/expo) and our React Native client [`@bugsnag/react-native`](/packages/react-native), along with:

- the core Bugsnag libraries for reporting errors ([`@bugsnag/core`](/packages/core))
- plugins for supporting various frameworks (e.g. [`@bugsnag/plugin-react`](/packages/plugin-react))
Expand Down Expand Up @@ -48,7 +48,7 @@ Use the following plugins and guides to integrate Bugsnag with various framework
| Framework | Bugsnag notifier | Documentation |
| ---------- | -------------- | --------------|
| Expo | [@bugsnag/expo](packages/expo) | [Expo docs](https://docs.bugsnag.com/platforms/react-native/expo/) |
| React Native | [bugsnag-react-native](https://github.com/bugsnag/bugsnag-react-native) (lives in a separate repo) | [React Native docs](https://docs.bugsnag.com/platforms/react-native/react-native/) |
| React Native | [@bugsnag/react-native](packages/react-native) | [React Native docs](https://docs.bugsnag.com/platforms/react-native/react-native/) |

## Support

Expand Down
67 changes: 67 additions & 0 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,70 @@ EXPO_P12_PATH=xxx \
EXPO_IOS_DIST_P12_PASSWORD=xxx \
npm run test:expo:ios
```

### React-native

The React-native tests drive real, remote mobile devices using BrowserStack. As a Bugsnag employee you can access the necessary credentials in our shared password manager.

In addition, the react-native test fixture requires the current version of the repo to be published to a locally owned NPM repository (! Not the official NPMJS repository !). This can be locally or remotely hosted, but should be versioned appropriately. Three bits of information will need to be passed into the test run as environment variables in order to access this package:

- `REG_BASIC_CREDENTIAL`: the basic auth credentials of an account able to access the repository
- `REG_NPM_EMAIL`: the email of the user accessing the repository
- `REGISTRY_URL`: the remote address of the repository

The targeted release of `@bugsnag/react-native` must be tagged with the short hash of the current commit in order to be picked up by the gradle build process.

There may be several react-native versions that can be targeted.
These should be set to the `REACT_NATIVE_VERSION` environment variable according to the table below:

| React native fixture | `REACT_NATIVE_VERSION` |
|----------------------|------------------------|
| 0.60 | `rn0.60` |

The following environment variables need to be set:

- `DEVICE_TYPE` - the mobile operating system you want to test on – one of:
- ANDROID_5
- ANDROID_6_0
- ANDROID_7_1
- ANDROID_8_1
- ANDROID_9_0
- ANDROID_10_0
- IOS_10
- IOS_11
- IOS_12
- `BROWSER_STACK_USERNAME`
- `BROWSER_STACK_ACCESS_KEY`
- `REACT_NATIVE_VERSION`
- `REG_BASIC_CREDENTIAL`
- `REG_NPM_EMAIL`
- `REGISTRY_URL`

By default, the test fixture used to run tests against will be built with a version of @bugsnag/react-native for the current branch/commit, e.g. `7.2.0-my-branch.231f6ef7`.
This can be overridden using the environment variable NOTIFIER_VERSION and is useful during development when making test, but not notifier, changes.

To run against an android device:

```sh
DEVICE_TYPE=ANDROID_9.0 \
REACT_NATIVE_VERSION=rn0.60 \
REG_BASIC_CREDENTIAL=xxx \
REG_NPM_EMAIL=xxx \
REGISTRY_URL=xxx \
BROWSER_STACK_USERNAME=xxx \
BROWSER_STACK_ACCESS_KEY=xxx \
npm run test:react-native:android
```

To run against an iOS device:

```
DEVICE_TYPE=ANDROID_9.0 \
REACT_NATIVE_VERSION=rn0.60 \
REG_BASIC_CREDENTIAL=xxx \
REG_NPM_EMAIL=xxx \
REGISTRY_URL=xxx \
BROWSER_STACK_USERNAME=xxx \
BROWSER_STACK_ACCESS_KEY=xxx \
npm run test:react-native:ios
```
8 changes: 8 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Upgrading
=========

## `bugsnag-react-native@*` to `@bugsnag/react-native@7.3`

As of `v7.3` of the [`bugsnag-js` monorepo](https://github.com/bugsnag/bugsnag-js) it contains Bugsnag's SDK for React Native. This additional notifier joins `@bugsnag/js` and `@bugsnag/expo` in its unified version scheme, so the first version of `@bugsnag/react-native` is `v7.3.0`.

The previous Bugsnag React Native SDK – [`bugsnag-react-native`](https://github.com/bugsnag/bugsnag-react-native) – continues to be available and will receive critical bug fixes, but it is no longer under active development and won't receive new features.

See the [React Native upgrade guide](/packages/react-native/UPGRADING.md) for specific instructions on how to upgrade from `bugsnag-react-native` to `@bugsnag/react-native`.

## 7.0 to 7.1

This release contains an update to the way the React and Vue plugins work, allowing the reference to the framework to be supplied after Bugsnag has been initialized.
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = api => {
plugins.push(['@babel/plugin-proposal-class-properties', { loose: true }])
plugins.push(['@babel/plugin-transform-modules-commonjs'])
overrides.push({
test: './node_modules/react-native/**/*',
test: 'node_modules/react-native/**/*',
presets: ['module:metro-react-native-babel-preset']
})
overrides.push({
Expand Down
56 changes: 56 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ services:
dockerfile: dockerfiles/Dockerfile.package
volumes:
- .:/app/build

publisher:
build:
context: .
dockerfile: dockerfiles/Dockerfile.publisher
args:
- BUILDKITE=${BUILDKITE}
- REG_BASIC_CREDENTIAL
- REG_NPM_EMAIL
- PUBLISH_URL
- BRANCH_NAME

ci:
build:
context: .
Expand Down Expand Up @@ -104,6 +116,50 @@ services:
volumes:
- ./build:/app/test/expo/features/fixtures/build

react-native-android-builder:
build:
context: .
dockerfile: dockerfiles/Dockerfile.react-native-android-builder
args:
- REG_BASIC_CREDENTIAL
- REG_NPM_EMAIL
environment:
VERBOSE:
DEBUG:
BRANCH_NAME:
BUILDKITE:
REGISTRY_URL:
REACT_NATIVE_VERSION:
NOTIFIER_VERSION:
networks:
default:
aliases:
- maze-runner
volumes:
- ./build:/app/build
- ./test:/app/test

react-native-maze-runner:
build:
context: .
dockerfile: dockerfiles/Dockerfile.react-native
args:
- BUILDKITE_BUILD_NUMBER
environment:
VERBOSE:
DEBUG:
BROWSER_STACK_USERNAME:
BROWSER_STACK_ACCESS_KEY:
BROWSER_STACK_LOCAL_IDENTIFIER: ${BUILDKITE_JOB_ID:-maze-runner}
APP_LOCATION:
DEVICE_TYPE:
networks:
default:
aliases:
- maze-runner
volumes:
- ./build:/app/test/react-native/build

networks:
default:
name: ${BUILDKITE_JOB_ID:-js-maze-runner}
1 change: 1 addition & 0 deletions dockerfiles/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ COPY babel.config.js lerna.json .eslintignore .eslintrc.js jest.config.js tsconf
ADD min_packages.tar .
COPY bin ./bin
RUN npx lerna bootstrap --concurrency 1
COPY scripts ./scripts
COPY packages ./packages
RUN npm run build
Loading

0 comments on commit 393e15f

Please sign in to comment.