Class: Fastlane::Actions::SupplyTest

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/supply_test/actions/supply_test_action.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.authorsObject



501
502
503
# File 'lib/fastlane/plugin/supply_test/actions/supply_test_action.rb', line 501

def authors
  ["Doruk Kangal"]
end

.available_optionsObject



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
# File 'lib/fastlane/plugin/supply_test/actions/supply_test_action.rb', line 52

def available_options
  [
    FastlaneCore::ConfigItem.new(
      key: :package_name,
      env_name: "SUPPLY_PACKAGE_NAME",
      short_option: "-p",
      description: "The package name of the application to use",
      code_gen_sensitive: true,
      default_value: CredentialsManager::AppfileConfig.try_fetch_value(:package_name),
      default_value_dynamic: true
    ),

    FastlaneCore::ConfigItem.new(
      key: :version_name,
      env_name: "SUPPLY_VERSION_NAME",
      short_option: "-n",
      optional: true,
      description: "Version name (used when uploading new apks/aabs) - defaults to 'versionName' in build.gradle or AndroidManifest.xml",
      default_value: CredentialsManager::AppfileConfig.try_fetch_value(:version_name),
      default_value_dynamic: true
    ),

    FastlaneCore::ConfigItem.new(
      key: :version_code,
      env_name: "SUPPLY_VERSION_CODE",
      short_option: "-C",
      optional: true,
      type: Integer,
      description: "Version code (used when updating rollout or promoting specific versions)",
      default_value: CredentialsManager::AppfileConfig.try_fetch_value(:version_code),
      default_value_dynamic: true
    ),

    FastlaneCore::ConfigItem.new(
      key: :release_status,
      env_name: "SUPPLY_RELEASE_STATUS",
      short_option: "-e",
      optional: true,
      description: "Release status (used when uploading new apks/aabs) - valid values are #{Supply::ReleaseStatus::ALL.join(', ')}",
      default_value: Supply::ReleaseStatus::COMPLETED,
      default_value_dynamic: true,
      verify_block: proc do |value|
        UI.user_error!("Value must be one of '#{Supply::RELEASE_STATUS}'") unless Supply::ReleaseStatus::ALL.include?(value)
      end
    ),

    FastlaneCore::ConfigItem.new(
      key: :track,
      short_option: "-a",
      env_name: "SUPPLY_TRACK",
      description: "The track of the application to use. The default available tracks are: #{Supply::Tracks::DEFAULTS.join(', ')}",
      default_value: Supply::Tracks::DEFAULT,
      type: String,
      verify_block: proc do |value|
        UI.user_error!("'rollout' is no longer a valid track name - please use 'production' instead") if value.casecmp('rollout').zero?
      end
    ),

    FastlaneCore::ConfigItem.new(
      key: :rollout,
      short_option: "-r",
      description: "The percentage of the user fraction when uploading to the rollout track (setting to 1 will complete the rollout)",
      optional: true,
      verify_block: proc do |value|
        min = 0.0
        max = 1.0
        UI.user_error!("Invalid value '#{value}', must be greater than #{min} and less than #{max}") unless value.to_f > min && value.to_f <= max
      end
    ),

    FastlaneCore::ConfigItem.new(
      key: :metadata_path,
      env_name: "SUPPLY_METADATA_PATH",
      short_option: "-m",
      optional: true,
      description: "Path to the directory containing the metadata files",
      default_value: (Dir["./fastlane/metadata/android"] + Dir["./metadata"]).first,
      default_value_dynamic: true
    ),

    FastlaneCore::ConfigItem.new(
      key: :key,
      env_name: "SUPPLY_KEY",
      short_option: "-k",
      conflicting_options: [:json_key],
      deprecated: 'Use `--json_key` instead',
      description: "The p12 File used to authenticate with Google",
      code_gen_sensitive: true,
      default_value: Dir["*.p12"].first || CredentialsManager::AppfileConfig.try_fetch_value(:keyfile),
      default_value_dynamic: true,
      verify_block: proc do |value|
        UI.user_error!("Could not find p12 file at path '#{File.expand_path(value)}'") unless File.exist?(File.expand_path(value))
      end
    ),

    FastlaneCore::ConfigItem.new(
      key: :issuer,
      env_name: "SUPPLY_ISSUER",
      short_option: "-i",
      conflicting_options: [:json_key],
      deprecated: 'Use `--json_key` instead',
      description: "The issuer of the p12 file (email address of the service account)",
      code_gen_sensitive: true,
      default_value: CredentialsManager::AppfileConfig.try_fetch_value(:issuer),
      default_value_dynamic: true,
      verify_block: proc do |value|
        UI.important("DEPRECATED --issuer OPTION. Use --json_key instead")
      end
    ),

    FastlaneCore::ConfigItem.new(
      key: :json_key,
      env_name: "SUPPLY_JSON_KEY",
      short_option: "-j",
      conflicting_options: [:issuer, :key, :json_key_data],
      optional: true, # this shouldn't be optional but is until --key and --issuer are completely removed
      description: "The path to a file containing service account JSON, used to authenticate with Google",
      code_gen_sensitive: true,
      default_value: CredentialsManager::AppfileConfig.try_fetch_value(:json_key_file),
      default_value_dynamic: true,
      verify_block: proc do |value|
        UI.user_error!("Could not find service account json file at path '#{File.expand_path(value)}'") unless File.exist?(File.expand_path(value))
        UI.user_error!("'#{value}' doesn't seem to be a JSON file") unless FastlaneCore::Helper.json_file?(File.expand_path(value))
      end
    ),

    FastlaneCore::ConfigItem.new(
      key: :json_key_data,
      env_name: "SUPPLY_JSON_KEY_DATA",
      short_option: "-c",
      conflicting_options: [:issuer, :key, :json_key],
      optional: true,
      description: "The raw service account JSON data used to authenticate with Google",
      code_gen_sensitive: true,
      default_value: CredentialsManager::AppfileConfig.try_fetch_value(:json_key_data_raw),
      default_value_dynamic: true,
      verify_block: proc do |value|
        begin
          JSON.parse(value)
        rescue JSON::ParserError
          UI.user_error!("Could not parse service account json  JSON::ParseError")
        end
      end
    ),

    FastlaneCore::ConfigItem.new(
      key: :apk,
      env_name: "SUPPLY_APK",
      description: "Path to the APK file to upload",
      short_option: "-b",
      conflicting_options: [:apk_paths, :aab, :aab_paths],
      code_gen_sensitive: true,
      default_value: Dir["*.apk"].last || Dir[File.join("app", "build", "outputs", "apk", "app-Release.apk")].last,
      default_value_dynamic: true,
      optional: true,
      verify_block: proc do |value|
        UI.user_error!("Could not find apk file at path '#{value}'") unless File.exist?(value)
        UI.user_error!("apk file is not an apk") unless value.end_with?('.apk')
      end
    ),

    FastlaneCore::ConfigItem.new(
      key: :apk_paths,
      env_name: "SUPPLY_APK_PATHS",
      conflicting_options: [:apk, :aab, :aab_paths],
      code_gen_sensitive: true,
      optional: true,
      type: Array,
      description: "An array of paths to APK files to upload",
      short_option: "-u",
      verify_block: proc do |value|
        UI.user_error!("Could not evaluate array from '#{value}'") unless value.kind_of?(Array)
        value.each do |path|
          UI.user_error!("Could not find apk file at path '#{path}'") unless File.exist?(path)
          UI.user_error!("file at path '#{path}' is not an apk") unless path.end_with?('.apk')
        end
      end
    ),

    FastlaneCore::ConfigItem.new(
      key: :aab,
      env_name: "SUPPLY_AAB",
      description: "Path to the AAB file to upload",
      short_option: "-f",
      conflicting_options: [:apk, :apk_paths, :aab_paths],
      code_gen_sensitive: true,
      default_value: Dir["*.aab"].last || Dir[File.join("app", "build", "outputs", "bundle", "release", "bundle.aab")].last,
      default_value_dynamic: true,
      optional: true,
      verify_block: proc do |value|
        UI.user_error!("Could not find aab file at path '#{value}'") unless File.exist?(value)
        UI.user_error!("aab file is not an aab") unless value.end_with?('.aab')
      end
    ),

    FastlaneCore::ConfigItem.new(
      key: :aab_paths,
      env_name: "SUPPLY_AAB_PATHS",
      conflicting_options: [:apk, :apk_paths, :aab],
      code_gen_sensitive: true,
      optional: true,
      type: Array,
      description: "An array of paths to AAB files to upload",
      short_option: "-z",
      verify_block: proc do |value|
        UI.user_error!("Could not evaluate array from '#{value}'") unless value.kind_of?(Array)
        value.each do |path|
          UI.user_error!("Could not find aab file at path '#{path}'") unless File.exist?(path)
          UI.user_error!("file at path '#{path}' is not an aab") unless path.end_with?('.aab')
        end
      end
    ),

    FastlaneCore::ConfigItem.new(
      key: :skip_upload_apk,
      env_name: "SUPPLY_SKIP_UPLOAD_APK",
      optional: true,
      description: "Whether to skip uploading APK",
      type: Boolean,
      default_value: false
    ),

    FastlaneCore::ConfigItem.new(
      key: :skip_upload_aab,
      env_name: "SUPPLY_SKIP_UPLOAD_AAB",
      optional: true,
      description: "Whether to skip uploading AAB",
      type: Boolean,
      default_value: false
    ),

    FastlaneCore::ConfigItem.new(
      key: :skip_upload_metadata,
      env_name: "SUPPLY_SKIP_UPLOAD_METADATA",
      optional: true,
      description: "Whether to skip uploading metadata, changelogs not included",
      type: Boolean,
      default_value: false
    ),

    FastlaneCore::ConfigItem.new(
      key: :skip_upload_changelogs,
      env_name: "SUPPLY_SKIP_UPLOAD_CHANGELOGS",
      optional: true,
      description: "Whether to skip uploading changelogs",
      type: Boolean,
      default_value: false
    ),

    FastlaneCore::ConfigItem.new(
      key: :skip_upload_images,
      env_name: "SUPPLY_SKIP_UPLOAD_IMAGES",
      optional: true,
      description: "Whether to skip uploading images, screenshots not included",
      type: Boolean,
      default_value: false
    ),

    FastlaneCore::ConfigItem.new(
      key: :skip_upload_screenshots,
      env_name: "SUPPLY_SKIP_UPLOAD_SCREENSHOTS",
      optional: true,
      description: "Whether to skip uploading SCREENSHOTS",
      type: Boolean,
      default_value: false
    ),

    FastlaneCore::ConfigItem.new(
      key: :track_promote_to,
      env_name: "SUPPLY_TRACK_PROMOTE_TO",
      optional: true,
      description: "The track to promote to. The default available tracks are: #{Supply::Tracks::DEFAULTS.join(', ')}",
      verify_block: proc do |value|
        UI.user_error!("'rollout' is no longer a valid track name - please use 'production' instead") if value.casecmp('rollout').zero?
      end
    ),

    FastlaneCore::ConfigItem.new(
      key: :track_promote_release_status,
      env_name: "SUPPLY_TRACK_PROMOTE_RELEASE_STATUS",
      optional: true,
      description: "Promoted track release status (used when promoting a track) - valid values are #{Supply::ReleaseStatus::ALL.join(', ')}",
      default_value: Supply::ReleaseStatus::COMPLETED,
      verify_block: proc do |value|
        UI.user_error!("Value must be one of '#{Supply::RELEASE_STATUS}'") unless Supply::ReleaseStatus::ALL.include?(value)
      end
    ),

    FastlaneCore::ConfigItem.new(
      key: :validate_only,
      env_name: "SUPPLY_VALIDATE_ONLY",
      optional: true,
      description: "Only validate changes with Google Play rather than actually publish",
      type: Boolean,
      default_value: false
    ),

    FastlaneCore::ConfigItem.new(
      key: :mapping,
      env_name: "SUPPLY_MAPPING",
      description: "Path to the mapping file to upload (mapping.txt or native-debug-symbols.zip alike)",
      short_option: "-d",
      conflicting_options: [:mapping_paths],
      optional: true,
      verify_block: proc do |value|
        UI.user_error!("Could not find mapping file at path '#{value}'") unless File.exist?(value)
      end
    ),

    FastlaneCore::ConfigItem.new(
      key: :mapping_paths,
      env_name: "SUPPLY_MAPPING_PATHS",
      conflicting_options: [:mapping],
      optional: true,
      type: Array,
      description: "An array of paths to mapping files to upload (mapping.txt or native-debug-symbols.zip alike)",
      short_option: "-s",
      verify_block: proc do |value|
        UI.user_error!("Could not evaluate array from '#{value}'") unless value.kind_of?(Array)
        value.each do |path|
          UI.user_error!("Could not find mapping file at path '#{path}'") unless File.exist?(path)
        end
      end
    ),

    FastlaneCore::ConfigItem.new(
      key: :root_url,
      env_name: "SUPPLY_ROOT_URL",
      description: "Root URL for the Google Play API. The provided URL will be used for API calls in place of https://www.googleapis.com/",
      optional: true,
      verify_block: proc do |value|
        UI.user_error!("Could not parse URL '#{value}'") unless value =~ URI.regexp
      end
    ),

    FastlaneCore::ConfigItem.new(
      key: :check_superseded_tracks,
      env_name: "SUPPLY_CHECK_SUPERSEDED_TRACKS",
      optional: true,
      description: "Check the other tracks for superseded versions and disable them",
      deprecated: "Google Play does this automatically now",
      type: Boolean,
      default_value: false
    ),

    FastlaneCore::ConfigItem.new(
      key: :timeout,
      env_name: "SUPPLY_TIMEOUT",
      optional: true,
      description: "Timeout for read, open, and send (in seconds)",
      type: Integer,
      default_value: 300
    ),

    FastlaneCore::ConfigItem.new(
      key: :deactivate_on_promote,
      env_name: "SUPPLY_DEACTIVATE_ON_PROMOTE",
      optional: true,
      description: "When promoting to a new track, deactivate the binary in the origin track",
      deprecated: "Google Play does this automatically now",
      type: Boolean,
      default_value: true
    ),

    FastlaneCore::ConfigItem.new(
      key: :version_codes_to_retain,
      optional: true,
      type: Array,
      description: "An array of version codes to retain when publishing a new APK",
      verify_block: proc do |version_codes|
        version_codes = version_codes.map(&:to_i)
        UI.user_error!("Could not evaluate array from '#{version_codes}'") unless version_codes.kind_of?(Array)
        version_codes.each do |version_code|
          UI.user_error!("Version code '#{version_code}' is not an integer") if version_code == 0
        end
      end
    ),

    FastlaneCore::ConfigItem.new(
      key: :changes_not_sent_for_review,
      env_name: "SUPPLY_CHANGES_NOT_SENT_FOR_REVIEW",
      description: "Indicates that the changes in this edit will not be reviewed until they are explicitly sent for review from the Google Play Console UI",
      type: Boolean,
      default_value: false
    ),

    FastlaneCore::ConfigItem.new(
      key: :rescue_changes_not_sent_for_review,
      env_name: "SUPPLY_RESCUE_CHANGES_NOT_SENT_FOR_REVIEW",
      description: "Catches changes_not_sent_for_review errors when an edit is committed and retries with the configuration that the error message recommended",
      type: Boolean,
      default_value: true
    ),

    FastlaneCore::ConfigItem.new(
      key: :in_app_update_priority,
      env_name: "SUPPLY_IN_APP_UPDATE_PRIORITY",
      optional: true,
      type: Integer,
      description: "In-app update priority for all the newly added apks in the release. Can take values between [0,5]",
      verify_block: proc do |in_app_update_priority|
        in_app_update_priority = in_app_update_priority.to_i
        UI.user_error!("Invalid in_app_update_priority value '#{in_app_update_priority}'. Values must be between [0,5]") unless (0..5).member?(in_app_update_priority)
      end
    ),

    FastlaneCore::ConfigItem.new(
      key: :obb_main_references_version,
      env_name: "SUPPLY_OBB_MAIN_REFERENCES_VERSION",
      description: "References version of 'main' expansion file",
      optional: true,
      type: Numeric
    ),

    FastlaneCore::ConfigItem.new(
      key: :obb_main_file_size,
      env_name: "SUPPLY_OBB_MAIN_FILE SIZE",
      description: "Size of 'main' expansion file in bytes",
      optional: true,
      type: Numeric
    ),

    FastlaneCore::ConfigItem.new(
      key: :obb_patch_references_version,
      env_name: "SUPPLY_OBB_PATCH_REFERENCES_VERSION",
      description: "References version of 'patch' expansion file",
      optional: true,
      type: Numeric
    ),

    FastlaneCore::ConfigItem.new(
      key: :obb_patch_file_size,
      env_name: "SUPPLY_OBB_PATCH_FILE SIZE",
      description: "Size of 'patch' expansion file in bytes",
      optional: true,
      type: Numeric
    ),

    FastlaneCore::ConfigItem.new(
      key: :ack_bundle_installation_warning,
      env_name: "ACK_BUNDLE_INSTALLATION_WARNING",
      description: "Must be set to true if the bundle installation may trigger a warning on user devices (e.g can only be downloaded over wifi). Typically this is required for bundles over 150MB",
      optional: true,
      type: Boolean,
      default_value: false
    )
  ]
end

.descriptionObject



505
506
507
# File 'lib/fastlane/plugin/supply_test/actions/supply_test_action.rb', line 505

def description
  "Import another Fastfile from given url to use its lanes"
end

.detailsObject



509
510
511
# File 'lib/fastlane/plugin/supply_test/actions/supply_test_action.rb', line 509

def details
  "This is useful if you have shared lanes across multiple apps and you want to store a Fastfile in a url"
end

.example_codeObject



513
514
515
516
517
518
519
# File 'lib/fastlane/plugin/supply_test/actions/supply_test_action.rb', line 513

def example_code
  "import_from_url(
  url: '<the url of the Fastfile to be downloaded>', # Required and cannot be empty,
  path: '<the path of the Fastfile to be downloaded>', # Optional and default is fastlane/.cache
  file_name: '<the name of the Fastfile to be downloaded>' # Optional and default is DownloadedFastfile
)"
end

.run(params) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/fastlane/plugin/supply_test/actions/supply_test_action.rb', line 8

def run(params)
  new.verify_config(
    params[:package_name],
    params[:version_name],
    params[:version_code],
    params[:release_status],
    params[:track],
    params[:rollout],
    params[:metadata_path],
    params[:key],
    params[:issuer],
    params[:json_key],
    params[:json_key_data],
    params[:apk],
    params[:apk_paths],
    params[:aab],
    params[:aab_paths],
    params[:skip_upload_apk],
    params[:skip_upload_aab],
    params[:skip_upload_metadata],
    params[:skip_upload_changelogs],
    params[:skip_upload_images],
    params[:skip_upload_screenshots],
    params[:track_promote_to],
    params[:track_promote_release_status],
    params[:validate_only],
    params[:mapping],
    params[:mapping_paths],
    params[:root_url],
    params[:check_superseded_tracks],
    params[:timeout],
    params[:deactivate_on_promote],
    params[:version_codes_to_retain],
    params[:changes_not_sent_for_review],
    params[:rescue_changes_not_sent_for_review],
    params[:in_app_update_priority],
    params[:obb_main_references_version],
    params[:obb_main_file_size],
    params[:obb_patch_references_version],
    params[:obb_patch_file_size],
    params[:ack_bundle_installation_warning]
  )
end

Instance Method Details

#verify_config(package_name, version_name, version_code, release_status, track, rollout, metadata_path, key, issuer, json_key, json_key_data, apk, apk_paths, aab, aab_paths, skip_upload_apk, skip_upload_aab, skip_upload_metadata, skip_upload_changelogs, skip_upload_images, skip_upload_screenshots, track_promote_to, track_promote_release_status, validate_only, mapping, mapping_paths, root_url, check_superseded_tracks, timeout, deactivate_on_promote, version_codes_to_retain, changes_not_sent_for_review, rescue_changes_not_sent_for_review, in_app_update_priority, obb_main_references_version, obb_main_file_size, obb_patch_references_version, obb_patch_file_size, ack_bundle_installation_warning) ⇒ Object



522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
# File 'lib/fastlane/plugin/supply_test/actions/supply_test_action.rb', line 522

def verify_config(
  package_name, version_name, version_code, release_status, track, rollout, ,
  key, issuer, json_key, json_key_data, apk, apk_paths, aab, aab_paths, skip_upload_apk,
  skip_upload_aab, , skip_upload_changelogs, skip_upload_images,
  skip_upload_screenshots, track_promote_to, track_promote_release_status, validate_only, mapping,
  mapping_paths, root_url, check_superseded_tracks, timeout, deactivate_on_promote, version_codes_to_retain,
  changes_not_sent_for_review, rescue_changes_not_sent_for_review, in_app_update_priority, obb_main_references_version,
  obb_main_file_size, obb_patch_references_version, obb_patch_file_size, ack_bundle_installation_warning
)
  puts("Doruk Kangal")

  unless  || SupplyTest.config[:apk] || SupplyTest.config[:apk_paths] || SupplyTest.config[:aab] || SupplyTest.config[:aab_paths] || (SupplyTest.config[:track] && SupplyTest.config[:track_promote_to]) || (SupplyTest.config[:track] && SupplyTest.config[:rollout])
    UI.user_error!("No local metadata, apks, aab, or track to promote were found, make sure to run `fastlane supply_test init` to setup supply_test")
  end

  # Can't upload both at apk and aab at same time
  # Need to error out users when there both apks and aabs are detected
  apk_paths = [SupplyTest.config[:apk], SupplyTest.config[:apk_paths]].flatten.compact
  could_upload_apk = !apk_paths.empty? && !SupplyTest.config[:skip_upload_apk]
  could_upload_aab = SupplyTest.config[:aab] && !SupplyTest.config[:skip_upload_aab]
  if could_upload_apk && could_upload_aab
    UI.user_error!("Cannot provide both apk(s) and aab - use `skip_upload_apk`, `skip_upload_aab`, or  make sure to remove any existing .apk or .aab files that are no longer needed")
  end

  if SupplyTest.config[:release_status] == SupplyTest::ReleaseStatus::DRAFT && SupplyTest.config[:rollout]
    UI.user_error!(%(Cannot specify rollout percentage when the release status is set to 'draft'))
  end

  if SupplyTest.config[:track_promote_release_status] == SupplyTest::ReleaseStatus::DRAFT && SupplyTest.config[:rollout]
    UI.user_error!(%(Cannot specify rollout percentage when the track promote release status is set to 'draft'))
  end

  unless SupplyTest.config[:version_codes_to_retain].nil?
    SupplyTest.config[:version_codes_to_retain] = SupplyTest.config[:version_codes_to_retain].map(&:to_i)
  end
end