Skip to content

Commit

Permalink
Merge pull request #1462 from bugsnag/release/v7.10.5
Browse files Browse the repository at this point in the history
Release v7.10.5
  • Loading branch information
bengourley committed Jul 5, 2021
2 parents 677a0a9 + 47e5121 commit 1adf8ea
Show file tree
Hide file tree
Showing 182 changed files with 6,814 additions and 273 deletions.
149 changes: 147 additions & 2 deletions .buildkite/react-native-cli-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,19 @@ steps:
env:
REACT_NATIVE_VERSION: "rn0_63_expo_ejected"

- label: ':runner: RN 0.64 CLI tests'
depends_on: "cli-maze-image"
timeout_in_minutes: 20
plugins:
docker-compose#v3.7.0:
run: react-native-cli-tool-maze-runner
use-aliases: true
command: ["features/cli-tests"]
env:
REACT_NATIVE_VERSION: "rn0_64"

#
# Built app test fixtures
# Built app test fixtures - Android
#
- label: ':docker: Build RN Android Builder image'
key: 'android-builder-image'
Expand Down Expand Up @@ -161,6 +172,39 @@ steps:
artifact_paths:
- build/rn0_63_expo_ejected.apk

- label: ':android: Init and build RN 0.64 apk (non-Hermes)'
key: 'rn-0-64-apk'
depends_on:
- 'android-builder-image'
timeout_in_minutes: 15
env:
DEBUG: true
REACT_NATIVE_VERSION: rn0_64
plugins:
- docker-compose#v3.7.0:
run: react-native-cli-android-builder
command: ["features/build-app-tests/build-android-app.feature"]
artifact_paths:
- build/rn0_64.apk

- label: ':android: Init and build RN 0.64 apk (Hermes)'
key: 'rn-0-64-hermes-apk'
depends_on:
- 'android-builder-image'
timeout_in_minutes: 15
env:
DEBUG: true
REACT_NATIVE_VERSION: rn0_64_hermes
plugins:
- docker-compose#v3.7.0:
run: react-native-cli-android-builder
command: ["features/build-app-tests/build-android-app.feature"]
artifact_paths:
- build/rn0_64_hermes.apk

#
# Built app test fixtures - iOS
#
- label: ':ios: Init and build RN 0.60 ipa'
key: 'rn-0-60-ipa'
timeout_in_minutes: 30
Expand Down Expand Up @@ -216,8 +260,30 @@ steps:
commands:
- test/react-native-cli/scripts/init-and-build-test.sh rn0_63_expo_ejected

- label: ':ios: Init and build RN 0.64 ipa (non-Hermes)'
key: 'rn-0-64-ipa'
timeout_in_minutes: 30
agents:
queue: 'opensource-mac-cocoa-11'
env:
DEBUG: true
artifact_paths: build/rn0_64.ipa
commands:
- test/react-native-cli/scripts/init-and-build-test.sh rn0_64

- label: ':ios: Init and build RN 0.64 ipa (Hermes)'
key: 'rn-0-64-hermes-ipa'
timeout_in_minutes: 30
agents:
queue: 'opensource-mac-cocoa-11'
env:
DEBUG: true
artifact_paths: build/rn0_64_hermes.ipa
commands:
- test/react-native-cli/scripts/init-and-build-test.sh rn0_64_hermes

#
# Init, build and notify end-to-end tests
# Init, build and notify end-to-end tests - Android
#
- label: ':runner: RN 0.60 Android end-to-end tests'
depends_on: "rn-0-60-apk"
Expand Down Expand Up @@ -314,6 +380,47 @@ steps:
concurrency: 9
concurrency_group: 'browserstack-app'

- label: ':runner: RN 0.64 Android end-to-end tests (non-Hermes)'
depends_on: "rn-0-64-apk"
timeout_in_minutes: 10
plugins:
artifacts#v1.2.0:
download: "build/rn0_64.apk"
docker-compose#v3.7.0:
pull: react-native-cli-maze-runner
run: react-native-cli-maze-runner
use-aliases: true
command:
- --app=build/rn0_64.apk
- --farm=bs
- --device=ANDROID_11_0
- --a11y-locator
- features/run-app-tests
concurrency: 9
concurrency_group: 'browserstack-app'

- label: ':runner: RN 0.64 Android end-to-end tests (Hermes)'
depends_on: "rn-0-64-hermes-apk"
timeout_in_minutes: 10
plugins:
artifacts#v1.2.0:
download: "build/rn0_64_hermes.apk"
docker-compose#v3.7.0:
pull: react-native-cli-maze-runner
run: react-native-cli-maze-runner
use-aliases: true
command:
- --app=build/rn0_64_hermes.apk
- --farm=bs
- --device=ANDROID_11_0
- --a11y-locator
- features/run-app-tests
concurrency: 9
concurrency_group: 'browserstack-app'

#
# Init, build and notify end-to-end tests - iOS
#
- label: ':runner: RN 0.60 iOS end-to-end tests'
depends_on: "rn-0-60-ipa"
timeout_in_minutes: 10
Expand Down Expand Up @@ -408,3 +515,41 @@ steps:
- features/run-app-tests
concurrency: 9
concurrency_group: 'browserstack-app'

- label: ':runner: RN 0.64 iOS end-to-end tests (non-Hermes)'
depends_on: "rn-0-64-ipa"
timeout_in_minutes: 10
plugins:
artifacts#v1.2.0:
download: "build/rn0_64.ipa"
docker-compose#v3.7.0:
pull: react-native-cli-maze-runner
run: react-native-cli-maze-runner
use-aliases: true
command:
- --app=build/rn0_64.ipa
- --farm=bs
- --device=IOS_14
- --a11y-locator
- features/run-app-tests
concurrency: 9
concurrency_group: 'browserstack-app'

- label: ':runner: RN 0.64 iOS end-to-end tests (Hermes)'
depends_on: "rn-0-64-hermes-ipa"
timeout_in_minutes: 10
plugins:
artifacts#v1.2.0:
download: "build/rn0_64_hermes.ipa"
docker-compose#v3.7.0:
pull: react-native-cli-maze-runner
run: react-native-cli-maze-runner
use-aliases: true
command:
- --app=build/rn0_64_hermes.ipa
- --farm=bs
- --device=IOS_14
- --a11y-locator
- features/run-app-tests
concurrency: 9
concurrency_group: 'browserstack-app'
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## 7.10.5 (2021-07-05)

### Fixed

- (plugin-console-breadcrumbs): Ensure console breadcrumbs do not run in Expo's dev environment and obscure log line numbers [#1453](https://github.com/bugsnag/bugsnag-js/pull/1453)
- (browser): "Bugsnag" loaded breadcrumb now has the type "state" rather than "navigation" [#1460](https://github.com/bugsnag/bugsnag-js/pull/1460)
- (plugin-react-native-unhandled-rejections): Remove flow syntax [#1461](https://github.com/bugsnag/bugsnag-js/pull/1461)

### Added

- (expo): User ID now defaults to `device.id` if no user is set [#1454](https://github.com/bugsnag/bugsnag-js/pull/1454)
- (browser): User ID now defaults to `device.id` if no user is set (when `collectUserIp=false`) [#1456](https://github.com/bugsnag/bugsnag-js/pull/1456)

### Changed

- (react-native): Update bugsnag-cocoa to v6.10.0
- Fix an issue that could cause C++ exceptions with very long descriptions to not be reported. [bugsnag-cocoa#1137](https://github.com/bugsnag/bugsnag-cocoa/pull/1137)
- Improve performance of adding metadata by using async file I/O. [bugsnag-cocoa#1133](https://github.com/bugsnag/bugsnag-cocoa/pull/1133)
- Improve performance of leaving breadcrumbs by using async file I/O. [bugsnag-cocoa#1124](https://github.com/bugsnag/bugsnag-cocoa/pull/1124)

## 7.10.4 (2021-06-28)

### Fixed
Expand Down
68 changes: 39 additions & 29 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,6 @@ CI runs on Buildkite. Tests are run automatically on any branch from within this

## Releases

Before creating any release:

- run `npm install` in the root of the project and `npm run bootstrap` to ensure the top-level node_modules and leaf node_modules are all correct for the branch you have checked out.
- ensure you are logged in to npm and that you have access to publish to the following on npm
- any packages in the `@bugsnag` namespace
- the `bugsnag-expo-cli` package
- ensure you have an AWS key pair with access to our S3 bucket and cloudfront distribution. Export these in your environment as `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` (if you're going to publish to the CDN)

To start a release:

- decide on a version number
Expand All @@ -83,23 +75,39 @@ To start a release:
Once the release PR has been approved:

- merge the PR into master
- `git checkout master` and `git pull`

You are now ready to make the release:
You are now ready to make the release. Releases are done using Docker and Docker compose. You do not need to have the release branch checked out on your local machine to make a release – the container pulls a fresh clone of the repo down from GitHub. Prerequisites:

```
lerna version [major | minor | patch]
lerna publish from-git
```
- You will need to clone the repository and have Docker running on your local machine.
- Ensure you are logged in to npm and that you have access to publish to the following on npm
- any packages in the `@bugsnag` namespace
- the `bugsnag-expo-cli` package
- Ensure you have an AWS key pair with access to our S3 bucket and cloudfront distribution. Export these in your environment as `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` (if you're going to publish to the CDN)
- Ensure your `.gitconfig` file in your home directory is configured to contain your name and email address
- Generate a [personal access token](https://github.com/settings/tokens/new) on GitHub and store it somewhere secure

<small>Note: if a prerelease was made, to graduate it into a normal release you will want to use `patch` as the version.</small>
Build the release container:

At this point it is sensible to perform some manual smoke tests to ensure the new version on npm works as expected. Only then publish to the CDN:
`docker-compose build release`

Then make the release:

```
npm run cdn-upload
GITHUB_USER=<your github username> \
GITHUB_ACCESS_TOKEN=<generate a personal access token> \
AWS_ACCESS_KEY_ID=xxx \
AWS_SECRET_ACCESS_KEY=xxx \
RELEASE_BRANCH=master \
VERSION=patch \
docker-compose run release
```

This process is interactive and will require you to confirm that you want to publish the changed packages. It will also prompt for 2FA.

Browser bundles are automatically uploaded to the CDN if they have changed.

<small>Note: if a prerelease was made, to graduate it into a normal release you will want to use `patch` as the version.</small>

Finally:

- create a release on GitHub https://github.com/bugsnag/bugsnag-js/releases/new
Expand All @@ -115,28 +123,30 @@ Finally:

### Prereleases

If you are starting a new prerelease, use one of the following commands:
If you are starting a new prerelease, use one of the following values for the `VERSION` variable in the release command:

```
lerna version [premajor | preminor | prepatch]
VERSION=[premajor | preminor | prepatch]
```

For subsequent iterations on that release, run:
For subsequent iterations on that release, use:

```
lerna version prerelease
VERSION=prerelease
```

If you want to publish the release to npm, use the following command:
For example:

```
lerna publish from-git --dist-tag next
GITHUB_USER=<your github username> \
GITHUB_ACCESS_TOKEN=<generate a personal access token> \
AWS_ACCESS_KEY_ID=xxx \
AWS_SECRET_ACCESS_KEY=xxx \
RELEASE_BRANCH=master \
VERSION=preminor \
docker-compose run
```

The `--dist-tag next` part ensures that it is not installed by unsuspecting users who do not specify a version – npm automatically adds the `latest` tag to a published module unless one is specified.

If you want to publish the release to the CDN, use the following command:
Prereleases will automatically be published to npm with the dist tag `next` and browser bundles are automatically uploaded to the CDN.

```
lerna run cdn-upload
```
The dist tag ensures that prereleases are not installed by unsuspecting users who do not specify a version – npm automatically adds the `latest` tag to a published module unless one is specified.
43 changes: 43 additions & 0 deletions bin/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/usr/bin/env bash

set -euxo pipefail

error_missing_field () {
echo "Missing required env var: $1"
exit 1
}

# Ensure all required variables are set before doing any work
if [[ -z ${GITHUB_USER:-} ]]; then error_missing_field "GITHUB_USER"; fi
if [[ -z ${GITHUB_ACCESS_TOKEN:-} ]]; then error_missing_field "GITHUB_ACCESS_TOKEN"; fi
if [[ -z ${RELEASE_BRANCH:-} ]]; then error_missing_field "RELEASE_BRANCH"; fi
if [[ -z ${VERSION:-} ]]; then error_missing_field "VERSION"; fi
if [[ -z ${AWS_ACCESS_KEY_ID:-} ]]; then error_missing_field "AWS_ACCESS_KEY_ID"; fi
if [[ -z ${AWS_SECRET_ACCESS_KEY:-} ]]; then error_missing_field "AWS_SECRET_ACCESS_KEY"; fi

git clone --single-branch \
--branch "$RELEASE_BRANCH" \
https://"$GITHUB_USER":"$GITHUB_ACCESS_TOKEN"@github.com/bugsnag/bugsnag-js.git

cd /app/bugsnag-js

# "ci" rather than "install" ensures the process doesn't make the work tree dirty by modifying lockfiles
npm ci
npm run bootstrap -- --ci

# check if the browser package changed – if it didn't we don't need to upload to the CDN
BROWSER_PACKAGE_CHANGED=$(npx lerna changed --parseable | grep -c packages/js$ || test $? = 1;)

case $VERSION in
"prerelease" | "prepatch" | "preminor" | "premajor")
npx lerna publish "$VERSION" --dist-tag next
;;

*)
npx lerna publish "$VERSION"
;;
esac

if [ "$BROWSER_PACKAGE_CHANGED" -eq 1 ]; then
npm run cdn-upload
fi
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,22 @@ services:
- ./build:/app/build
- ./test/react-native-cli/features/:/app/features/

release:
build:
context: .
dockerfile: dockerfiles/Dockerfile.release
environment:
GITHUB_USER:
GITHUB_ACCESS_TOKEN:
RELEASE_BRANCH:
AWS_ACCESS_KEY_ID:
AWS_SECRET_ACCESS_KEY:
VERSION:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
volumes:
- ~/.gitconfig:/home/releaser/.gitconfig
- ~/.npmrc:/home/releaser/.npmrc

networks:
default:
name: ${BUILDKITE_JOB_ID:-js-maze-runner}
14 changes: 14 additions & 0 deletions dockerfiles/Dockerfile.release
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:lts-alpine
RUN apk add --update git bash python3 make gcc g++ openssh-client curl

RUN addgroup -S admins
RUN adduser -S releaser -G admins

WORKDIR /app

RUN chown -R releaser:admins /app
USER releaser

COPY ./bin/release.sh ./

CMD ./release.sh
Loading

0 comments on commit 1adf8ea

Please sign in to comment.