fastlane-plugin-bugsnag 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 57b215435ee483ac067b8476b40366d4040791e56311709e1e73533f356a0658
4
- data.tar.gz: 27f72d72fff57102bc787434b2b06dc5272b7001877d4993e99122fd15a1c5d7
3
+ metadata.gz: 2d1a05778ac305a52d3d186c4f8210fd37b67a86e1c738dc82ec187094ac5896
4
+ data.tar.gz: 138124efd6fc4b08dd8b28262b34b89db018d4c5f8ecbdd95d12fa118bd2afa1
5
5
  SHA512:
6
- metadata.gz: 7ca750f77a93d83b0d786eff7e99a843551bdd4a59ee0585dfe83f2239c777381b33188810844ca1a227cc7e3fd489f90712cf470ab2ad19bc0c05a515caf757
7
- data.tar.gz: a819e53c15fa5cfa35da10d4021535b91b5b52eddc56b0a22bb86f8c77ac0c21e2abc46b83d3d5ccad33cf0864ec2bc71aab97a50777058c2177e717a12968ee
6
+ metadata.gz: 6077446540b8180aa8953db6f961eba67e585af79e7007e254bbd47fedf90da22d5bdba1374db49d77cb9159dd4c6c0552353883ccc0769788199f6d88ca0d4b
7
+ data.tar.gz: 991cc2b7bd6a9c59c1e4225d5e86cf9d8d422f16e1a667b2cd0457d481f0e4f1f753d2eaaada274343590bfede4cb8d50b8ef300339d4900c267ad47f5740b8e
@@ -0,0 +1,7 @@
1
+ class FindInfoPlist
2
+ def self.default_info_plist_path
3
+ # Find first 'Info.plist' in the current working directory
4
+ # ignoring any in 'build', or 'test' folders
5
+ return Dir.glob("./{ios/,}*/Info.plist").reject{|path| path =~ /build|test/i }.sort.first
6
+ end
7
+ end
@@ -1,5 +1,6 @@
1
1
  require "xmlsimple"
2
2
  require "json"
3
+ require_relative "find_info_plist_path"
3
4
 
4
5
  module Fastlane
5
6
  module Actions
@@ -38,6 +39,9 @@ module Fastlane
38
39
  payload[:sourceControl][:repository] = params[:repository] if params[:repository]
39
40
  payload[:sourceControl][:provider] = params[:provider] if params[:provider]
40
41
 
42
+ # If provided apply metadata to payload.
43
+ payload[:metadata] = params[:metadata]
44
+
41
45
  payload.reject! {|k,v| v == nil || (v.is_a?(Hash) && v.empty?)}
42
46
 
43
47
  if payload[:apiKey].nil? || !payload[:apiKey].is_a?(String)
@@ -167,7 +171,12 @@ module Fastlane
167
171
  FastlaneCore::ConfigItem.new(key: :endpoint,
168
172
  description: "Bugsnag deployment endpoint",
169
173
  optional: true,
170
- default_value: "https://build.bugsnag.com")
174
+ default_value: "https://build.bugsnag.com"),
175
+ FastlaneCore::ConfigItem.new(key: :metadata,
176
+ description: "Metadata",
177
+ optional:true,
178
+ type: Object,
179
+ default_value: nil)
171
180
  ]
172
181
  end
173
182
 
@@ -196,7 +205,7 @@ module Fastlane
196
205
  when nil
197
206
  if file_path = default_android_manifest_path
198
207
  return file_path
199
- elsif file_path = default_info_plist_path
208
+ elsif file_path = FindInfoPlist.default_info_plist_path
200
209
  return file_path
201
210
  end
202
211
  when :android
@@ -204,7 +213,7 @@ module Fastlane
204
213
  return file_path
205
214
  end
206
215
  else
207
- if file_path = default_info_plist_path
216
+ if file_path = FindInfoPlist.default_info_plist_path
208
217
  return file_path
209
218
  end
210
219
  end
@@ -224,10 +233,6 @@ module Fastlane
224
233
  end
225
234
  end
226
235
 
227
- def self.default_info_plist_path
228
- Dir.glob("./{ios/,}*/Info.plist").reject {|path| path =~ /build|test/i }.sort.first
229
- end
230
-
231
236
  def self.load_options_from_plist file_path
232
237
  options = {}
233
238
  plist_getter = Fastlane::Actions::GetInfoPlistValueAction
@@ -319,7 +324,7 @@ module Fastlane
319
324
  nil
320
325
  end
321
326
  end
322
-
327
+
323
328
  def self.send_notification(url, body)
324
329
  require "net/http"
325
330
  uri = URI.parse(url)
@@ -1,3 +1,5 @@
1
+ require_relative "find_info_plist_path"
2
+
1
3
  module Fastlane
2
4
  module Actions
3
5
  class UploadSymbolsToBugsnagAction < Action
@@ -131,18 +133,12 @@ module Fastlane
131
133
  env_name: "BUGSNAG_CONFIG_FILE",
132
134
  description: "Info.plist location",
133
135
  optional: true,
134
- default_value: default_info_plist_path)
136
+ default_value: FindInfoPlist.default_info_plist_path)
135
137
  ]
136
138
  end
137
139
 
138
140
  private
139
141
 
140
- def self.default_info_plist_path
141
- # Find first 'Info.plist' in the current working directory
142
- # ignoring any in 'build', or 'test' folders
143
- return Dir.glob("./{ios/,}*/Info.plist").reject{|path| path =~ /build|test/i }.sort.first
144
- end
145
-
146
142
  def self.options_from_info_plist file_path
147
143
  plist_getter = Fastlane::Actions::GetInfoPlistValueAction
148
144
  bugsnag_dict = plist_getter.run(path: file_path, key: "bugsnag")
@@ -185,8 +181,8 @@ module Fastlane
185
181
  # returns true if `gym` created some dSYMs for us to upload
186
182
  # https://docs.fastlane.tools/actions/gym/#lane-variables
187
183
  def self.gym_dsyms?
188
- if defined?(SharedValues::DSYM_PATHS)
189
- if Actions.lane_context[SharedValues::DSYM_PATHS]
184
+ if defined?(SharedValues::DSYM_OUTPUT_PATH)
185
+ if Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH]
190
186
  true
191
187
  end
192
188
  end
@@ -195,8 +191,8 @@ module Fastlane
195
191
  # returns true if `download_dsyms` created some dSYMs for us to upload
196
192
  # https://docs.fastlane.tools/actions/download_dsyms/#lane-variables
197
193
  def self.download_dsym_dsyms?
198
- if defined?(SharedValues::DSYM_OUTPUT_PATH)
199
- if Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH]
194
+ if defined?(SharedValues::DSYM_PATHS)
195
+ if Actions.lane_context[SharedValues::DSYM_PATHS]
200
196
  true
201
197
  end
202
198
  end
@@ -205,10 +201,10 @@ module Fastlane
205
201
  def self.default_dsym_paths
206
202
  vendor_regex = %r{\.\/vendor.*}
207
203
  paths = Dir["./**/*.dSYM.zip"].reject{|f| f[vendor_regex] } + Dir["./**/*.dSYM"].reject{|f| f[vendor_regex] } # scrape the sub directories for zips and dSYMs
208
- paths += coerce_array(Actions.lane_context[SharedValues::DSYM_PATHS]) if gym_dsyms? # set by `download_dsyms` Fastlane action
209
- paths += coerce_array(Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH]) if download_dsym_dsyms? # set by `gym` Fastlane action
204
+ paths += coerce_array(Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH]) if gym_dsyms? # set by `gym` Fastlane action
205
+ paths += coerce_array(Actions.lane_context[SharedValues::DSYM_PATHS]) if download_dsym_dsyms? # set by `download_dsyms` Fastlane action
210
206
  parse_dsym_paths(paths.uniq)
211
207
  end
212
208
  end
213
209
  end
214
- end
210
+ end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Bugsnag
3
- VERSION = "2.2.0"
3
+ VERSION = "2.3.0"
4
4
  end
5
5
  end
@@ -121,5 +121,41 @@ describe BuildAction do
121
121
  end
122
122
  end
123
123
  end
124
+
125
+ context 'metadata added to payload' do
126
+ it "single key:value pair added" do
127
+ expect(BuildAction).to receive(:send_notification) do |url, body|
128
+ payload = ::JSON.load(body)
129
+ expect(payload['appVersion']).to eq '4.0-project'
130
+ expect(payload['apiKey']).to eq '12345678901234567890123456789DDD'
131
+ expect(payload['metadata']).to eq '"test1": "First test"'
132
+ end
133
+
134
+ Dir.chdir(File.join(FIXTURE_PATH, 'ios_proj')) do
135
+ run_with({
136
+ app_version: '4.0-project',
137
+ api_key: '12345678901234567890123456789DDD',
138
+ metadata: '"test1": "First test"'
139
+ })
140
+ end
141
+ end
142
+
143
+ it "multiple key:value pairs added" do
144
+ expect(BuildAction).to receive(:send_notification) do |url, body|
145
+ payload = ::JSON.load(body)
146
+ expect(payload['appVersion']).to eq '4.0-project'
147
+ expect(payload['apiKey']).to eq '12345678901234567890123456789DDD'
148
+ expect(payload['metadata']).to eq '"test1": "First test", "test2": "Second test", "test3": "Third test"'
149
+ end
150
+
151
+ Dir.chdir(File.join(FIXTURE_PATH, 'ios_proj')) do
152
+ run_with({
153
+ app_version: '4.0-project',
154
+ api_key: '12345678901234567890123456789DDD',
155
+ metadata: '"test1": "First test", "test2": "Second test", "test3": "Third test"'
156
+ })
157
+ end
158
+ end
159
+ end
124
160
  end
125
161
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-bugsnag
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delisa Mason
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-15 00:00:00.000000000 Z
11
+ date: 2023-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xml-simple
@@ -136,7 +136,7 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: 2.28.5
139
- description:
139
+ description:
140
140
  email: iskanamagus@gmail.com
141
141
  executables: []
142
142
  extensions: []
@@ -145,6 +145,7 @@ files:
145
145
  - LICENSE.txt
146
146
  - bugsnag-dsym-upload
147
147
  - lib/fastlane/plugin/bugsnag.rb
148
+ - lib/fastlane/plugin/bugsnag/actions/find_info_plist_path.rb
148
149
  - lib/fastlane/plugin/bugsnag/actions/send_build_to_bugsnag.rb
149
150
  - lib/fastlane/plugin/bugsnag/actions/upload_symbols_to_bugsnag.rb
150
151
  - lib/fastlane/plugin/bugsnag/version.rb
@@ -167,7 +168,7 @@ homepage: https://github.com/bugsnag/bugsnag-dsym-upload
167
168
  licenses:
168
169
  - MIT
169
170
  metadata: {}
170
- post_install_message:
171
+ post_install_message:
171
172
  rdoc_options: []
172
173
  require_paths:
173
174
  - lib
@@ -182,8 +183,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
183
  - !ruby/object:Gem::Version
183
184
  version: '0'
184
185
  requirements: []
185
- rubygems_version: 3.0.3
186
- signing_key:
186
+ rubygems_version: 3.1.4
187
+ signing_key:
187
188
  specification_version: 4
188
189
  summary: Uploads dSYM files to Bugsnag
189
190
  test_files: