Skip to content

Commit

Permalink
Merge pull request #151 from bugsnag/release/v2.6.3
Browse files Browse the repository at this point in the history
v2.6.3 Release
  • Loading branch information
joshedney authored Nov 26, 2024
2 parents 63cb657 + 72d065e commit fb854da
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 33 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Changelog
## 2.6.2 (2024-10-17)

## 2.6.2 (2024-11-26)

### Fixes
- Ensure that the node package is configured correctly so that you can run `npx @bugsnag/cli` and `yarn bugsnag-cli`. [144](https://github.com/bugsnag/bugsnag-cli/pull/144)
Expand Down
1 change: 1 addition & 0 deletions features/base-fixtures/rn0_69/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ source 'https://rubygems.org'
ruby '>= 2.6.10'

gem 'cocoapods', '1.14.3'
gem 'xcodeproj', '< 1.26.0'
1 change: 1 addition & 0 deletions features/base-fixtures/rn0_70/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ source 'https://rubygems.org'
ruby '>= 2.6.10'

gem 'cocoapods', '1.14.3'
gem 'xcodeproj', '< 1.26.0'
1 change: 1 addition & 0 deletions features/base-fixtures/rn0_72/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ source 'https://rubygems.org'
ruby '>= 2.6.10'

gem 'cocoapods', '1.14.3'
gem 'xcodeproj', '< 1.26.0'
4 changes: 0 additions & 4 deletions features/dsym/dsym_upload.feature
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ Feature: dSYM Upload Integration Tests
Then the sourcemaps Content-Type header is valid multipart form-data
And the sourcemap payload field "apiKey" equals "1234567890ABCDEF1234567890ABCDEF"

Scenario: Attempt to upload a single dSYM sourcemap using path containing one dSYM but --project-root is not defined in the command
When I run bugsnag-cli with upload dsym --upload-api-root-url=http://localhost:9339 --api-key=1234567890ABCDEF1234567890ABCDEF features/dsym/fixtures/single-dsym
Then I should see the Project Root error

Scenario: Build and Upload dSYM
When I make the "features/base-fixtures/dsym"
Then I wait for the build to succeed
Expand Down
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ display_help() {
EOS
}

VERSION="2.6.2"
VERSION="2.6.3"

while [[ "$#" -gt 0 ]]; do
case "$1" in
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/bugsnag/bugsnag-cli/pkg/utils"
)

var package_version = "2.6.2"
var package_version = "2.6.3"

func main() {
commands := options.CLI{}
Expand Down
30 changes: 18 additions & 12 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,16 @@ features/base-fixtures/rn0_69/android:

.PHONY: features/base-fixtures/rn0_69/ios
features/base-fixtures/rn0_69/ios:
cd $@/../ && npm i && bundle install
cd $@ && pod install
cd $@/../ && npm i
cd $@ && bundle install
cd $@ && bundle exec pod install --repo-update
cd $@ && xcodebuild -workspace rn0_69.xcworkspace -scheme rn0_69 -configuration Release -sdk iphoneos build

.PHONY: features/base-fixtures/rn0_69/ios/archive
features/base-fixtures/rn0_69/ios/archive:
cd features/base-fixtures/rn0_69/ios/../ && npm i && bundle install
cd features/base-fixtures/rn0_69/ios/ && pod install
cd features/base-fixtures/rn0_69/ && npm i
cd features/base-fixtures/rn0_69/ios/ && bundle install
cd features/base-fixtures/rn0_69/ios/ && bundle exec pod install --repo-update
cd features/base-fixtures/rn0_69/ios/ && xcrun xcodebuild -scheme rn0_69 -workspace rn0_69.xcworkspace -configuration Release -archivePath "../rn0_69.xcarchive" -allowProvisioningUpdates archive

.PHONY: features/base-fixtures/rn0_70/android
Expand All @@ -117,14 +119,16 @@ features/base-fixtures/rn0_70/android:

.PHONY: features/base-fixtures/rn0_70/ios
features/base-fixtures/rn0_70/ios:
cd $@/../ && npm i && bundle install
cd $@ && pod install
cd $@/../ && npm i
cd $@ && bundle install
cd $@ && bundle exec pod install --repo-update
cd $@ && xcodebuild -workspace rn0_70.xcworkspace -scheme rn0_70 -configuration Release -sdk iphoneos build

.PHONY: features/base-fixtures/rn0_70/ios/archive
features/base-fixtures/rn0_70/ios/archive:
cd features/base-fixtures/rn0_70/ios/../ && npm i && bundle install
cd features/base-fixtures/rn0_70/ios/ && pod install
cd features/base-fixtures/rn0_70/ && npm i
cd features/base-fixtures/rn0_70/ios/ && bundle install
cd features/base-fixtures/rn0_70/ios/ && bundle exec pod install --repo-update
cd features/base-fixtures/rn0_70/ios/ && xcrun xcodebuild -scheme rn0_70 -workspace rn0_70.xcworkspace -configuration Release -archivePath "../rn0_70.xcarchive" -allowProvisioningUpdates archive

.PHONY: features/base-fixtures/rn0_72/android
Expand All @@ -134,14 +138,16 @@ features/base-fixtures/rn0_72/android:

.PHONY: features/base-fixtures/rn0_72/ios
features/base-fixtures/rn0_72/ios:
cd $@/../ && npm i && bundle install
cd $@ && pod install
cd $@/../ && npm i
cd $@ && bundle install
cd $@ && bundle exec pod install --repo-update
cd $@ && xcodebuild -workspace rn0_72.xcworkspace -scheme rn0_72 -configuration Release -sdk iphoneos build

.PHONY: features/base-fixtures/rn0_72/ios/archive
features/base-fixtures/rn0_72/ios/archive:
cd features/base-fixtures/rn0_72/ios/../ && npm i && bundle install
cd features/base-fixtures/rn0_72/ios/ && pod install
cd features/base-fixtures/rn0_72/ && npm i
cd features/base-fixtures/rn0_72/ios && bundle install
cd features/base-fixtures/rn0_72/ios/ && bundle exec pod install --repo-update
cd features/base-fixtures/rn0_72/ios/ && xcrun xcodebuild -scheme rn0_72 -workspace rn0_72.xcworkspace -configuration Release -archivePath "../rn0_72.xcarchive" -allowProvisioningUpdates archive

.PHONY: features/base-fixtures/js-webpack4
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bugsnag/cli",
"version": "2.6.2",
"version": "2.6.3",
"description": "BugSnag CLI",
"main": "install.js",
"bin": {
Expand Down
15 changes: 8 additions & 7 deletions pkg/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,14 @@ type Dsym struct {
}

type Js struct {
Path utils.Paths `arg:"" name:"path" help:"The path to the directory or file to upload" type:"path" default:"."`
BaseUrl string `help:"For directory-based uploads, the URL of the base directory for the minified JavaScript files that the source maps relate to. The relative path is appended onto this for each file. Asterisks can be used as a wildcard."`
Bundle string `help:"Path to the minified JavaScript file that the source map relates to. If this is not provided then the file will be obtained when an error event is received." type:"path"`
BundleUrl string `help:"For single file uploads, the URL of the minified JavaScript file that the source map relates to. Asterisks can be used as a wildcard."`
ProjectRoot string `help:"The path to strip from the beginning of source file names referenced in stacktraces on the BugSnag dashboard" type:"path"`
SourceMap string `help:"Path to the source map file. This usually has the .min.js extension." type:"path"`
VersionName string `help:"The version of the app that the source map applies to. Defaults to the version in the package.json file (if found)."`
Path utils.Paths `arg:"" name:"path" help:"The path to the directory or file to upload" type:"path" default:"."`
BaseUrl string `help:"For directory-based uploads, the URL of the base directory for the minified JavaScript files that the source maps relate to. The relative path is appended onto this for each file. Asterisks can be used as a wildcard."`
Bundle string `help:"Path to the minified JavaScript file that the source map relates to. If this is not provided then the file will be obtained when an error event is received." type:"path"`
BundleUrl string `help:"For single file uploads, the URL of the minified JavaScript file that the source map relates to. Asterisks can be used as a wildcard."`
ProjectRoot string `help:"The path to strip from the beginning of source file names referenced in stacktraces on the BugSnag dashboard" type:"path"`
SourceMap string `help:"Path to the source map file. This usually has the .min.js extension." type:"path"`
VersionName string `help:"The version of the app that the source map applies to. Defaults to the version in the package.json file (if found)."`
CodeBundleId string `help:"A unique identifier for the JavaScript bundle"`
}

type ReactNative struct {
Expand Down
10 changes: 6 additions & 4 deletions pkg/upload/dsym.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ func ProcessDsym(options options.CLI, endpoint string, logger log.Logger) error
}

if xcodeProjPath != "" {
dsymOptions.ProjectRoot = ios.GetDefaultProjectRoot(xcodeProjPath, dsymOptions.ProjectRoot)
logger.Debug(fmt.Sprintf("Defaulting to '%s' as the project root", dsymOptions.ProjectRoot))
if dsymOptions.ProjectRoot == "" {
dsymOptions.ProjectRoot = ios.GetDefaultProjectRoot(xcodeProjPath, dsymOptions.ProjectRoot)
logger.Info(fmt.Sprintf("Setting `--project-root` from Xcode project settings: %s", dsymOptions.ProjectRoot))
}

// Get build settings and dsymPath

// If options.Scheme is set explicitly, check if it exists
if dsymOptions.Scheme != "" {
_, err := ios.IsSchemeInPath(xcodeProjPath, dsymOptions.Scheme)
Expand Down Expand Up @@ -85,7 +86,8 @@ func ProcessDsym(options options.CLI, endpoint string, logger log.Logger) error
}

if dsymOptions.ProjectRoot == "" {
return fmt.Errorf("--project-root is required when uploading dSYMs from a directory that is not an Xcode project or workspace")
dsymOptions.ProjectRoot, _ = os.Getwd()
logger.Info(fmt.Sprintf("Setting `--project-root` to current working directory: %s", dsymOptions.ProjectRoot))
}

if dsymPath == "" {
Expand Down
2 changes: 1 addition & 1 deletion pkg/upload/js.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ func uploadSingleSourceMap(options options.CLI, jsOptions options.Js, endpoint s
logger.Debug(fmt.Sprintf("Generated URL %s using the base URL %s", url, jsOptions.BaseUrl))
}

uploadOptions, err := utils.BuildJsUploadOptions(options.ApiKey, jsOptions.VersionName, url, jsOptions.ProjectRoot, options.Upload.Overwrite)
uploadOptions, err := utils.BuildJsUploadOptions(options.ApiKey, jsOptions.VersionName, jsOptions.CodeBundleId, url, jsOptions.ProjectRoot, options.Upload.Overwrite)

if err != nil {
return fmt.Errorf("failed to build upload options: %s", err.Error())
Expand Down
6 changes: 5 additions & 1 deletion pkg/utils/upload-options.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func BuildReactNativeUploadOptions(apiKey string, appVersion string, versionCode
return uploadOptions, nil
}

func BuildJsUploadOptions(apiKey string, versionName string, bundleUrl string, projectRoot string, overwrite bool) (map[string]string, error) {
func BuildJsUploadOptions(apiKey string, versionName string, codeBundleId string, bundleUrl string, projectRoot string, overwrite bool) (map[string]string, error) {
uploadOptions := make(map[string]string)

if apiKey != "" {
Expand All @@ -164,6 +164,10 @@ func BuildJsUploadOptions(apiKey string, versionName string, bundleUrl string, p
uploadOptions["projectRoot"] = projectRoot
}

if codeBundleId != "" {
uploadOptions["codeBundleId"] = codeBundleId
}

if overwrite {
uploadOptions["overwrite"] = "true"
}
Expand Down

0 comments on commit fb854da

Please sign in to comment.