fastlane 2.155.1 → 2.157.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +72 -72
  3. data/deliver/lib/deliver.rb +1 -0
  4. data/deliver/lib/deliver/app_screenshot_iterator.rb +95 -0
  5. data/deliver/lib/deliver/detect_values.rb +4 -1
  6. data/deliver/lib/deliver/languages.rb +7 -0
  7. data/deliver/lib/deliver/loader.rb +4 -5
  8. data/deliver/lib/deliver/queue_worker.rb +64 -0
  9. data/deliver/lib/deliver/runner.rb +7 -5
  10. data/deliver/lib/deliver/upload_screenshots.rb +143 -128
  11. data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +120 -0
  12. data/fastlane/lib/fastlane/actions/commit_version_bump.rb +1 -1
  13. data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +2 -0
  14. data/fastlane/lib/fastlane/actions/docs/upload_to_testflight.md +17 -1
  15. data/fastlane/lib/fastlane/actions/set_changelog.rb +2 -2
  16. data/fastlane/lib/fastlane/actions/sonar.rb +5 -0
  17. data/fastlane/lib/fastlane/actions/spaceship_stats.rb +73 -0
  18. data/fastlane/lib/fastlane/actions/upload_to_testflight.rb +4 -0
  19. data/fastlane/lib/fastlane/version.rb +1 -1
  20. data/fastlane/swift/Deliverfile.swift +1 -1
  21. data/fastlane/swift/DeliverfileProtocol.swift +1 -1
  22. data/fastlane/swift/Fastlane.swift +68 -8
  23. data/fastlane/swift/Gymfile.swift +1 -1
  24. data/fastlane/swift/GymfileProtocol.swift +1 -1
  25. data/fastlane/swift/Matchfile.swift +1 -1
  26. data/fastlane/swift/MatchfileProtocol.swift +1 -1
  27. data/fastlane/swift/Precheckfile.swift +1 -1
  28. data/fastlane/swift/PrecheckfileProtocol.swift +1 -1
  29. data/fastlane/swift/Scanfile.swift +1 -1
  30. data/fastlane/swift/ScanfileProtocol.swift +1 -1
  31. data/fastlane/swift/Screengrabfile.swift +1 -1
  32. data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
  33. data/fastlane/swift/Snapshotfile.swift +1 -1
  34. data/fastlane/swift/SnapshotfileProtocol.swift +1 -1
  35. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +71 -42
  36. data/fastlane_core/lib/fastlane_core/project.rb +1 -0
  37. data/gym/lib/gym/error_handler.rb +1 -1
  38. data/gym/lib/gym/generators/build_command_generator.rb +0 -1
  39. data/pilot/lib/pilot/build_manager.rb +18 -4
  40. data/pilot/lib/pilot/manager.rb +15 -5
  41. data/pilot/lib/pilot/options.rb +16 -0
  42. data/produce/lib/produce/itunes_connect.rb +2 -2
  43. data/scan/lib/scan/test_command_generator.rb +3 -1
  44. data/screengrab/lib/screengrab/runner.rb +8 -7
  45. data/sigh/lib/sigh/runner.rb +9 -5
  46. data/snapshot/lib/snapshot/test_command_generator_base.rb +3 -1
  47. data/spaceship/lib/spaceship.rb +4 -0
  48. data/spaceship/lib/spaceship/client.rb +2 -0
  49. data/spaceship/lib/spaceship/connect_api.rb +0 -15
  50. data/spaceship/lib/spaceship/connect_api/api_client.rb +270 -0
  51. data/spaceship/lib/spaceship/connect_api/client.rb +139 -213
  52. data/spaceship/lib/spaceship/connect_api/models/profile.rb +3 -2
  53. data/spaceship/lib/spaceship/connect_api/provisioning/client.rb +8 -17
  54. data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +75 -64
  55. data/spaceship/lib/spaceship/connect_api/spaceship.rb +94 -0
  56. data/spaceship/lib/spaceship/connect_api/testflight/client.rb +8 -17
  57. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +288 -277
  58. data/spaceship/lib/spaceship/connect_api/token.rb +46 -5
  59. data/spaceship/lib/spaceship/connect_api/token_refresh_middleware.rb +24 -0
  60. data/spaceship/lib/spaceship/connect_api/tunes/client.rb +8 -17
  61. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +717 -706
  62. data/spaceship/lib/spaceship/connect_api/users/client.rb +8 -17
  63. data/spaceship/lib/spaceship/connect_api/users/users.rb +28 -17
  64. data/spaceship/lib/spaceship/stats_middleware.rb +65 -0
  65. metadata +25 -18
  66. data/sigh/lib/sigh/.runner.rb.swp +0 -0
  67. data/spaceship/lib/spaceship/connect_api/models/.device.rb.swp +0 -0
@@ -1,27 +1,18 @@
1
- require_relative '../client'
1
+ require_relative '../api_client'
2
+ require_relative './users'
2
3
  require_relative '../../tunes/tunes_client'
3
4
 
4
5
  module Spaceship
5
6
  class ConnectAPI
6
7
  module Users
7
- class Client < Spaceship::ConnectAPI::Client
8
- def self.instance
9
- # Verify there is a token or a client that can be used
10
- if Spaceship::ConnectAPI.token
11
- if @client.nil? || @client.token != Spaceship::ConnectAPI.token
12
- @client = Client.new(token: Spaceship::ConnectAPI.token)
13
- end
14
- elsif Spaceship::Tunes.client
15
- # Initialize new client if new or if team changed
16
- if @client.nil? || @client.team_id != Spaceship::Tunes.client.team_id
17
- @client = Client.client_with_authorization_from(Spaceship::Tunes.client)
18
- end
19
- end
8
+ class Client < Spaceship::ConnectAPI::APIClient
9
+ def initialize(cookie: nil, current_team_id: nil, token: nil, another_client: nil)
10
+ another_client ||= Spaceship::Tunes.client if cookie.nil? && token.nil?
20
11
 
21
- # Need to handle not having a client but this shouldn't ever happen
22
- raise "Please login using `Spaceship::Tunes.login('user', 'password')`" unless @client
12
+ super(cookie: cookie, current_team_id: current_team_id, token: token, another_client: another_client)
23
13
 
24
- @client
14
+ self.extend(Spaceship::ConnectAPI::Users::API)
15
+ self.users_request_client = self
25
16
  end
26
17
 
27
18
  def self.hostname
@@ -3,26 +3,37 @@ require 'spaceship/connect_api/users/client'
3
3
  module Spaceship
4
4
  class ConnectAPI
5
5
  module Users
6
- #
7
- # users
8
- #
6
+ module API
7
+ def users_request_client=(users_request_client)
8
+ @users_request_client = users_request_client
9
+ end
9
10
 
10
- def get_users(filter: {}, includes: nil, limit: nil, sort: nil)
11
- params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
12
- Client.instance.get("users", params)
13
- end
11
+ def users_request_client
12
+ return @users_request_client if @users_request_client
13
+ raise TypeError, "You need to instantiate this module with users_request_client"
14
+ end
15
+
16
+ #
17
+ # users
18
+ #
19
+
20
+ def get_users(filter: {}, includes: nil, limit: nil, sort: nil)
21
+ params = users_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
22
+ users_request_client.get("users", params)
23
+ end
14
24
 
15
- def add_user_visible_apps(user_id: nil, app_ids: nil)
16
- body = {
17
- data: app_ids.map do |app_id|
18
- {
19
- type: "apps",
20
- id: app_id
21
- }
22
- end
23
- }
25
+ def add_user_visible_apps(user_id: nil, app_ids: nil)
26
+ body = {
27
+ data: app_ids.map do |app_id|
28
+ {
29
+ type: "apps",
30
+ id: app_id
31
+ }
32
+ end
33
+ }
24
34
 
25
- Client.instance.post("users/#{user_id}/relationships/visibleApps", body)
35
+ users_request_client.post("users/#{user_id}/relationships/visibleApps", body)
36
+ end
26
37
  end
27
38
  end
28
39
  end
@@ -0,0 +1,65 @@
1
+ require 'faraday'
2
+
3
+ require_relative 'globals'
4
+
5
+ module Spaceship
6
+ class StatsMiddleware < Faraday::Middleware
7
+ ServiceOption = Struct.new(:name, :url, :auth_type)
8
+ URLLog = Struct.new(:url, :auth_type)
9
+ class << self
10
+ def services
11
+ return @services if @services
12
+
13
+ require_relative 'tunes/tunes_client'
14
+ require_relative 'portal/portal_client'
15
+ require_relative 'connect_api/testflight/client'
16
+ require_relative 'connect_api/provisioning/client'
17
+
18
+ @services ||= [
19
+ ServiceOption.new("App Store Connect API (official)", "api.appstoreconnect.apple.com", "JWT"),
20
+ ServiceOption.new("App Store Connect API (web session)", Spaceship::ConnectAPI::TestFlight::Client.hostname.gsub("https://", ""), "Web session"),
21
+ ServiceOption.new("App Store Connect API (web session)", Spaceship::ConnectAPI::Provisioning::Client.hostname.gsub("https://", ""), "Web session"),
22
+ ServiceOption.new("Legacy iTunesConnect Auth", "idmsa.apple.com", "Web session"),
23
+ ServiceOption.new("Legacy iTunesConnect Auth", "appstoreconnect.apple.com/olympus/v1/", "Web session"),
24
+ ServiceOption.new("Legacy iTunesConnect", Spaceship::TunesClient.hostname.gsub("https://", ""), "Web session"),
25
+ ServiceOption.new("Legacy iTunesConnect Developer Portal", Spaceship::PortalClient.hostname.gsub("https://", ""), "Web session")
26
+ ]
27
+ end
28
+
29
+ def service_stats
30
+ @service_stats ||= Hash.new(0)
31
+ end
32
+
33
+ def request_logs
34
+ @request_logs ||= []
35
+ @request_logs
36
+ end
37
+ end
38
+
39
+ def initialize(app)
40
+ super(app)
41
+ end
42
+
43
+ def call(env)
44
+ log(env)
45
+ @app.call(env)
46
+ end
47
+
48
+ def log(env)
49
+ return false unless env && env.url && (uri = URI.parse(env.url.to_s))
50
+ service = StatsMiddleware.services.find do |s|
51
+ uri.to_s.include?(s.url)
52
+ end
53
+
54
+ service = ServiceOption.new("Unknown", uri.host, "Unknown") if service.nil?
55
+ StatsMiddleware.service_stats[service] += 1
56
+
57
+ StatsMiddleware.request_logs << URLLog.new(uri.to_s, service.auth_type)
58
+
59
+ return true
60
+ rescue => e
61
+ puts("Failed to log spaceship stats - #{e.message}") if Spaceship::Globals.verbose?
62
+ return false
63
+ end
64
+ end
65
+ end
metadata CHANGED
@@ -1,35 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.155.1
4
+ version: 2.157.0
5
5
  platform: ruby
6
6
  authors:
7
- - Luka Mirosevic
7
+ - Josh Holtz
8
8
  - Daniel Jankowski
9
+ - Jimmy Dee
9
10
  - Olivier Halligon
10
- - Josh Holtz
11
+ - Jorge Revuelta H
12
+ - Helmut Januschka
11
13
  - Jérôme Lacoste
14
+ - Felix Krause
12
15
  - Iulian Onofrei
13
- - Maksym Grebenets
14
- - Max Ott
15
- - Kohki Miki
16
+ - Matthew Ellis
17
+ - Aaron Brager
16
18
  - Danielle Tomlinson
17
- - Andrew McBurney
18
19
  - Manu Wallner
20
+ - Andrew McBurney
21
+ - Max Ott
22
+ - Luka Mirosevic
23
+ - Maksym Grebenets
24
+ - Kohki Miki
25
+ - Jan Piotrowski
26
+ - Stefan Natchev
19
27
  - Joshua Liebowitz
20
28
  - Fumiya Nakamura
21
- - Felix Krause
22
- - Jimmy Dee
23
- - Jorge Revuelta H
24
- - Aaron Brager
25
- - Stefan Natchev
26
- - Helmut Januschka
27
- - Jan Piotrowski
28
- - Matthew Ellis
29
29
  autorequire:
30
30
  bindir: bin
31
31
  cert_chain: []
32
- date: 2020-08-06 00:00:00.000000000 Z
32
+ date: 2020-08-27 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: slack-notifier
@@ -944,14 +944,17 @@ files:
944
944
  - deliver/lib/assets/summary.html.erb
945
945
  - deliver/lib/deliver.rb
946
946
  - deliver/lib/deliver/app_screenshot.rb
947
+ - deliver/lib/deliver/app_screenshot_iterator.rb
947
948
  - deliver/lib/deliver/commands_generator.rb
948
949
  - deliver/lib/deliver/detect_values.rb
949
950
  - deliver/lib/deliver/download_screenshots.rb
950
951
  - deliver/lib/deliver/generate_summary.rb
951
952
  - deliver/lib/deliver/html_generator.rb
953
+ - deliver/lib/deliver/languages.rb
952
954
  - deliver/lib/deliver/loader.rb
953
955
  - deliver/lib/deliver/module.rb
954
956
  - deliver/lib/deliver/options.rb
957
+ - deliver/lib/deliver/queue_worker.rb
955
958
  - deliver/lib/deliver/runner.rb
956
959
  - deliver/lib/deliver/setup.rb
957
960
  - deliver/lib/deliver/submit_for_review.rb
@@ -988,6 +991,7 @@ files:
988
991
  - fastlane/lib/fastlane/actions/add_extra_platforms.rb
989
992
  - fastlane/lib/fastlane/actions/add_git_tag.rb
990
993
  - fastlane/lib/fastlane/actions/app_store_build_number.rb
994
+ - fastlane/lib/fastlane/actions/app_store_connect_api_key.rb
991
995
  - fastlane/lib/fastlane/actions/appaloosa.rb
992
996
  - fastlane/lib/fastlane/actions/appetize.rb
993
997
  - fastlane/lib/fastlane/actions/appetize_viewing_url_generator.rb
@@ -1174,6 +1178,7 @@ files:
1174
1178
  - fastlane/lib/fastlane/actions/snapshot.rb
1175
1179
  - fastlane/lib/fastlane/actions/sonar.rb
1176
1180
  - fastlane/lib/fastlane/actions/spaceship_logs.rb
1181
+ - fastlane/lib/fastlane/actions/spaceship_stats.rb
1177
1182
  - fastlane/lib/fastlane/actions/splunkmint.rb
1178
1183
  - fastlane/lib/fastlane/actions/spm.rb
1179
1184
  - fastlane/lib/fastlane/actions/ssh.rb
@@ -1556,7 +1561,6 @@ files:
1556
1561
  - sigh/README.md
1557
1562
  - sigh/lib/assets/resign.sh
1558
1563
  - sigh/lib/sigh.rb
1559
- - sigh/lib/sigh/.runner.rb.swp
1560
1564
  - sigh/lib/sigh/commands_generator.rb
1561
1565
  - sigh/lib/sigh/download_all.rb
1562
1566
  - sigh/lib/sigh/local_manage.rb
@@ -1609,10 +1613,10 @@ files:
1609
1613
  - spaceship/lib/spaceship/client.rb
1610
1614
  - spaceship/lib/spaceship/commands_generator.rb
1611
1615
  - spaceship/lib/spaceship/connect_api.rb
1616
+ - spaceship/lib/spaceship/connect_api/api_client.rb
1612
1617
  - spaceship/lib/spaceship/connect_api/client.rb
1613
1618
  - spaceship/lib/spaceship/connect_api/file_uploader.rb
1614
1619
  - spaceship/lib/spaceship/connect_api/model.rb
1615
- - spaceship/lib/spaceship/connect_api/models/.device.rb.swp
1616
1620
  - spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb
1617
1621
  - spaceship/lib/spaceship/connect_api/models/app.rb
1618
1622
  - spaceship/lib/spaceship/connect_api/models/app_category.rb
@@ -1658,9 +1662,11 @@ files:
1658
1662
  - spaceship/lib/spaceship/connect_api/provisioning/client.rb
1659
1663
  - spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb
1660
1664
  - spaceship/lib/spaceship/connect_api/response.rb
1665
+ - spaceship/lib/spaceship/connect_api/spaceship.rb
1661
1666
  - spaceship/lib/spaceship/connect_api/testflight/client.rb
1662
1667
  - spaceship/lib/spaceship/connect_api/testflight/testflight.rb
1663
1668
  - spaceship/lib/spaceship/connect_api/token.rb
1669
+ - spaceship/lib/spaceship/connect_api/token_refresh_middleware.rb
1664
1670
  - spaceship/lib/spaceship/connect_api/tunes/client.rb
1665
1671
  - spaceship/lib/spaceship/connect_api/tunes/tunes.rb
1666
1672
  - spaceship/lib/spaceship/connect_api/users/client.rb
@@ -1699,6 +1705,7 @@ files:
1699
1705
  - spaceship/lib/spaceship/portal/website_push.rb
1700
1706
  - spaceship/lib/spaceship/provider.rb
1701
1707
  - spaceship/lib/spaceship/spaceauth_runner.rb
1708
+ - spaceship/lib/spaceship/stats_middleware.rb
1702
1709
  - spaceship/lib/spaceship/test_flight.rb
1703
1710
  - spaceship/lib/spaceship/test_flight/app_test_info.rb
1704
1711
  - spaceship/lib/spaceship/test_flight/base.rb
Binary file