fastlane 2.126.0.beta.20190606200048 → 2.126.0.beta.20190607200028

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/fastlane/lib/fastlane/actions/app_store_build_number.rb +1 -1
  3. data/fastlane/lib/fastlane/version.rb +1 -1
  4. data/fastlane_core/lib/fastlane_core/build_watcher.rb +3 -4
  5. data/pilot/lib/pilot/build_manager.rb +7 -7
  6. data/pilot/lib/pilot/manager.rb +2 -2
  7. data/pilot/lib/pilot/tester_exporter.rb +3 -3
  8. data/pilot/lib/pilot/tester_manager.rb +2 -2
  9. data/spaceship/lib/spaceship/connect_api.rb +2 -17
  10. data/spaceship/lib/spaceship/connect_api/{models/model.rb → model.rb} +5 -4
  11. data/spaceship/lib/spaceship/connect_api/response.rb +4 -7
  12. data/spaceship/lib/spaceship/connect_api/testflight/base.rb +41 -0
  13. data/spaceship/lib/spaceship/connect_api/testflight/client.rb +553 -0
  14. data/spaceship/lib/spaceship/connect_api/testflight/models/app.rb +99 -0
  15. data/spaceship/lib/spaceship/connect_api/testflight/models/beta_app_localization.rb +30 -0
  16. data/spaceship/lib/spaceship/connect_api/testflight/models/beta_app_review_detail.rb +34 -0
  17. data/spaceship/lib/spaceship/connect_api/testflight/models/beta_app_review_submission.rb +28 -0
  18. data/spaceship/lib/spaceship/connect_api/testflight/models/beta_build_localization.rb +22 -0
  19. data/spaceship/lib/spaceship/connect_api/testflight/models/beta_build_metric.rb +26 -0
  20. data/spaceship/lib/spaceship/connect_api/testflight/models/beta_group.rb +43 -0
  21. data/spaceship/lib/spaceship/connect_api/testflight/models/beta_tester.rb +58 -0
  22. data/spaceship/lib/spaceship/connect_api/testflight/models/beta_tester_metric.rb +45 -0
  23. data/spaceship/lib/spaceship/connect_api/testflight/models/build.rb +146 -0
  24. data/spaceship/lib/spaceship/connect_api/testflight/models/build_beta_detail.rb +58 -0
  25. data/spaceship/lib/spaceship/connect_api/testflight/models/build_delivery.rb +38 -0
  26. data/spaceship/lib/spaceship/connect_api/testflight/models/pre_release_version.rb +22 -0
  27. data/spaceship/lib/spaceship/connect_api/testflight/models/user.rb +52 -0
  28. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +27 -0
  29. data/spaceship/lib/spaceship/test_flight/build.rb +3 -3
  30. data/spaceship/lib/spaceship/test_flight/build_trains.rb +1 -1
  31. metadata +34 -33
  32. data/spaceship/lib/spaceship/connect_api/base.rb +0 -39
  33. data/spaceship/lib/spaceship/connect_api/client.rb +0 -551
  34. data/spaceship/lib/spaceship/connect_api/models/app.rb +0 -97
  35. data/spaceship/lib/spaceship/connect_api/models/beta_app_localization.rb +0 -28
  36. data/spaceship/lib/spaceship/connect_api/models/beta_app_review_detail.rb +0 -32
  37. data/spaceship/lib/spaceship/connect_api/models/beta_app_review_submission.rb +0 -26
  38. data/spaceship/lib/spaceship/connect_api/models/beta_build_localization.rb +0 -20
  39. data/spaceship/lib/spaceship/connect_api/models/beta_build_metric.rb +0 -24
  40. data/spaceship/lib/spaceship/connect_api/models/beta_group.rb +0 -41
  41. data/spaceship/lib/spaceship/connect_api/models/beta_tester.rb +0 -56
  42. data/spaceship/lib/spaceship/connect_api/models/beta_tester_metric.rb +0 -43
  43. data/spaceship/lib/spaceship/connect_api/models/build.rb +0 -144
  44. data/spaceship/lib/spaceship/connect_api/models/build_beta_detail.rb +0 -56
  45. data/spaceship/lib/spaceship/connect_api/models/build_delivery.rb +0 -36
  46. data/spaceship/lib/spaceship/connect_api/models/pre_release_version.rb +0 -20
  47. data/spaceship/lib/spaceship/connect_api/models/user.rb +0 -50
@@ -0,0 +1,99 @@
1
+ require_relative '../../model'
2
+ require_relative './build'
3
+
4
+ module Spaceship
5
+ module ConnectAPI
6
+ module TestFlight
7
+ class App
8
+ include Spaceship::ConnectAPI::Model
9
+
10
+ attr_accessor :name
11
+ attr_accessor :bundle_id
12
+ attr_accessor :sku
13
+ attr_accessor :primary_locale
14
+ attr_accessor :removed
15
+ attr_accessor :is_aag
16
+
17
+ self.attr_mapping({
18
+ "name" => "name",
19
+ "bundleId" => "bundle_id",
20
+ "sku" => "sku",
21
+ "primaryLocale" => "primary_locale",
22
+ "removed" => "removed",
23
+ "isAAG" => "is_aag"
24
+ })
25
+
26
+ def self.type
27
+ return "apps"
28
+ end
29
+
30
+ #
31
+ # Apps
32
+ #
33
+
34
+ def self.all(filter: {}, includes: nil, limit: nil, sort: nil)
35
+ resps = testflight_client.get_apps(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
36
+ return resps.map(&:to_models).flatten
37
+ end
38
+
39
+ def self.find(bundle_id)
40
+ return all(filter: { bundleId: bundle_id }).find do |app|
41
+ app.bundle_id == bundle_id
42
+ end
43
+ end
44
+
45
+ def self.get(app_id: nil, includes: nil)
46
+ return testflight_client.get_app(app_id: app_id, includes: includes).first
47
+ end
48
+
49
+ #
50
+ # Beta Testers
51
+ #
52
+
53
+ def get_beta_testers(filter: {}, includes: nil, limit: nil, sort: nil)
54
+ filter ||= {}
55
+ filter[:apps] = id
56
+
57
+ resps = testflight_client.get_beta_testers(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
58
+ return resps.map(&:to_models).flatten
59
+ end
60
+
61
+ #
62
+ # Builds
63
+ #
64
+
65
+ def get_builds(filter: {}, includes: nil, limit: nil, sort: nil)
66
+ filter ||= {}
67
+ filter[:app] = id
68
+
69
+ resps = testflight_client.get_builds(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
70
+ return resps.map(&:to_models).flatten
71
+ end
72
+
73
+ def get_build_deliveries(filter: {}, includes: nil, limit: nil, sort: nil)
74
+ filter ||= {}
75
+ filter[:app] = id
76
+
77
+ resps = testflight_client.get_build_deliveries(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
78
+ return resps.map(&:to_models).flatten
79
+ end
80
+
81
+ def get_beta_app_localizations(filter: {}, includes: nil, limit: nil, sort: nil)
82
+ filter ||= {}
83
+ filter[:app] = id
84
+
85
+ resps = testflight_client.get_beta_app_localizations(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
86
+ return resps.map(&:to_models).flatten
87
+ end
88
+
89
+ def get_beta_groups(filter: {}, includes: nil, limit: nil, sort: nil)
90
+ filter ||= {}
91
+ filter[:app] = id
92
+
93
+ resps = testflight_client.get_beta_groups(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
94
+ return resps.map(&:to_models).flatten
95
+ end
96
+ end
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,30 @@
1
+ require_relative '../../model'
2
+ module Spaceship
3
+ module ConnectAPI
4
+ module TestFlight
5
+ class BetaAppLocalization
6
+ include Spaceship::ConnectAPI::Model
7
+
8
+ attr_accessor :feedback_email
9
+ attr_accessor :marketing_url
10
+ attr_accessor :privacy_policy_url
11
+ attr_accessor :tv_os_privacy_policy
12
+ attr_accessor :description
13
+ attr_accessor :locale
14
+
15
+ attr_mapping({
16
+ "feedbackEmail" => "feedback_email",
17
+ "marketingUrl" => "marketing_url",
18
+ "privacyPolicyUrl" => "privacy_policy_url",
19
+ "tvOsPrivacyPolicy" => "tv_os_privacy_policy",
20
+ "description" => "description",
21
+ "locale" => "locale"
22
+ })
23
+
24
+ def self.type
25
+ return "betaAppLocalizations"
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,34 @@
1
+ require_relative '../../model'
2
+ module Spaceship
3
+ module ConnectAPI
4
+ module TestFlight
5
+ class BetaAppReviewDetail
6
+ include Spaceship::ConnectAPI::Model
7
+
8
+ attr_accessor :contact_first_name
9
+ attr_accessor :contact_last_name
10
+ attr_accessor :contact_phone
11
+ attr_accessor :contact_email
12
+ attr_accessor :demo_account_name
13
+ attr_accessor :demo_account_password
14
+ attr_accessor :demo_account_required
15
+ attr_accessor :notes
16
+
17
+ attr_mapping({
18
+ "contactFirstName" => "contact_first_name",
19
+ "contactLastName" => "contact_last_name",
20
+ "contactPhone" => "contact_phone",
21
+ "contactEmail" => "contact_email",
22
+ "demoAccountName" => "demo_account_name",
23
+ "demoAccountPassword" => "demo_account_password",
24
+ "demoAccountRequired" => "demo_account_required",
25
+ "notes" => "notes"
26
+ })
27
+
28
+ def self.type
29
+ return "betaAppReviewDetails"
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,28 @@
1
+ require_relative '../../model'
2
+ module Spaceship
3
+ module ConnectAPI
4
+ module TestFlight
5
+ class BetaAppReviewSubmission
6
+ include Spaceship::ConnectAPI::Model
7
+
8
+ attr_accessor :beta_review_state
9
+
10
+ attr_mapping({
11
+ "betaReviewState" => "beta_review_state"
12
+ })
13
+
14
+ def self.type
15
+ return "betaAppReviewSubmissions"
16
+ end
17
+
18
+ #
19
+ # API
20
+ #
21
+
22
+ def delete!
23
+ return testflight_client.delete_beta_app_review_submission(beta_app_review_submission_id: id)
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,22 @@
1
+ require_relative '../../model'
2
+ module Spaceship
3
+ module ConnectAPI
4
+ module TestFlight
5
+ class BetaBuildLocalization
6
+ include Spaceship::ConnectAPI::Model
7
+
8
+ attr_accessor :whats_new
9
+ attr_accessor :locale
10
+
11
+ attr_mapping({
12
+ "whatsNew" => "whats_new",
13
+ "locale" => "locale"
14
+ })
15
+
16
+ def self.type
17
+ return "betaBuildLocalizations"
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,26 @@
1
+ require_relative '../../model'
2
+ module Spaceship
3
+ module ConnectAPI
4
+ module TestFlight
5
+ class BetaBuildMetric
6
+ include Spaceship::ConnectAPI::Model
7
+
8
+ attr_accessor :install_count
9
+ attr_accessor :crash_count
10
+ attr_accessor :invite_count
11
+ attr_accessor :seven_day_tester_count
12
+
13
+ attr_mapping({
14
+ "installCount" => "install_count",
15
+ "crashCount" => "crash_count",
16
+ "inviteCount" => "invite_count",
17
+ "sevenDayTesterCount" => "seven_day_tester_count"
18
+ })
19
+
20
+ def self.type
21
+ return "betaBuildMetrics"
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,43 @@
1
+ require_relative '../../model'
2
+ module Spaceship
3
+ module ConnectAPI
4
+ module TestFlight
5
+ class BetaGroup
6
+ include Spaceship::ConnectAPI::Model
7
+
8
+ attr_accessor :name
9
+ attr_accessor :created_date
10
+ attr_accessor :is_internal_group
11
+ attr_accessor :public_link_enabled
12
+ attr_accessor :public_link_id
13
+ attr_accessor :public_link_limit_enabled
14
+ attr_accessor :public_link_limit
15
+ attr_accessor :public_link
16
+
17
+ attr_mapping({
18
+ "name" => "name",
19
+ "createdDate" => "created_date",
20
+ "isInternalGroup" => "is_internal_group",
21
+ "publicLinkEnabled" => "public_link_enabled",
22
+ "publicLinkId" => "public_link_id",
23
+ "publicLinkLimitEnabled" => "public_link_limit_enabled",
24
+ "publicLinkLimit" => "public_link_limit",
25
+ "publicLink" => "public_link"
26
+ })
27
+
28
+ def self.type
29
+ return "betaGroups"
30
+ end
31
+
32
+ #
33
+ # API
34
+ #
35
+
36
+ # beta_testers - [{email: "", firstName: "", lastName: ""}]
37
+ def post_bulk_beta_tester_assignments(beta_testers: nil)
38
+ return testflight_client.post_bulk_beta_tester_assignments(beta_group_id: id, beta_testers: beta_testers)
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,58 @@
1
+ require_relative '../../model'
2
+ module Spaceship
3
+ module ConnectAPI
4
+ module TestFlight
5
+ class BetaTester
6
+ include Spaceship::ConnectAPI::Model
7
+
8
+ attr_accessor :first_name
9
+ attr_accessor :last_name
10
+ attr_accessor :email
11
+ attr_accessor :invite_type
12
+ attr_accessor :invitation
13
+
14
+ attr_accessor :apps
15
+ attr_accessor :beta_groups
16
+ attr_accessor :beta_tester_metrics
17
+
18
+ attr_mapping({
19
+ "firstName" => "first_name",
20
+ "lastName" => "last_name",
21
+ "email" => "email",
22
+ "inviteType" => "invite_type",
23
+ "invitation" => "invitation",
24
+
25
+ "apps" => "apps",
26
+ "betaGroups" => "beta_groups",
27
+ "betaTesterMetrics" => "beta_tester_metrics"
28
+ })
29
+
30
+ def self.type
31
+ return "betaTesters"
32
+ end
33
+
34
+ #
35
+ # API
36
+ #
37
+
38
+ def self.all(filter: {}, includes: nil, limit: nil, sort: nil)
39
+ return testflight_client.get_beta_testers(filter: filter, includes: includes)
40
+ end
41
+
42
+ def self.find(email: nil, includes: nil)
43
+ return all(filter: { email: email }, includes: includes).first
44
+ end
45
+
46
+ def delete_from_apps(apps: nil)
47
+ app_ids = apps.map(&:id)
48
+ return testflight_client.delete_beta_tester_from_apps(beta_tester_id: id, app_ids: app_ids)
49
+ end
50
+
51
+ def delete_from_beta_groups(beta_groups: nil)
52
+ beta_group_ids = beta_groups.map(&:id)
53
+ return testflight_client.delete_beta_tester_from_beta_groups(beta_tester_id: id, beta_group_ids: beta_group_ids)
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,45 @@
1
+ require_relative '../../model'
2
+ module Spaceship
3
+ module ConnectAPI
4
+ module TestFlight
5
+ class BetaTesterMetric
6
+ include Spaceship::ConnectAPI::Model
7
+
8
+ attr_accessor :install_count
9
+ attr_accessor :crash_count
10
+ attr_accessor :session_count
11
+ attr_accessor :beta_tester_state
12
+ attr_accessor :last_modified_date
13
+ attr_accessor :installed_cf_bundle_short_version_string
14
+ attr_accessor :installed_cf_bundle_version
15
+
16
+ attr_mapping({
17
+ "installCount" => "install_count",
18
+ "crashCount" => "crash_count",
19
+ "sessionCount" => "session_count",
20
+ "betaTesterState" => "beta_tester_state",
21
+ "lastModifiedDate" => "last_modified_date",
22
+ "installedCfBundleShortVersionString" => "installed_cf_bundle_short_version_string",
23
+ "installedCfBundleVersion" => "installed_cf_bundle_version"
24
+ })
25
+
26
+ module BetaTesterState
27
+ INSTALLED = "INSTALLED"
28
+ NO_BUILDS = "NO_BUILDS"
29
+ end
30
+
31
+ def self.type
32
+ return "betaTesterMetrics"
33
+ end
34
+
35
+ #
36
+ # Helpers
37
+ #
38
+
39
+ def installed?
40
+ return beta_tester_state == BetaTesterState::INSTALLED
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,146 @@
1
+ require_relative '../../model'
2
+ require 'spaceship/test_flight/build'
3
+ module Spaceship
4
+ module ConnectAPI
5
+ module TestFlight
6
+ class Build
7
+ include Spaceship::ConnectAPI::Model
8
+
9
+ attr_accessor :version
10
+ attr_accessor :uploaded_date
11
+ attr_accessor :expiration_date
12
+ attr_accessor :expired
13
+ attr_accessor :min_os_version
14
+ attr_accessor :icon_asset_token
15
+ attr_accessor :processing_state
16
+ attr_accessor :uses_non_exempt_encryption
17
+
18
+ attr_accessor :app
19
+ attr_accessor :beta_app_review_submission
20
+ attr_accessor :beta_build_metrics
21
+ attr_accessor :build_beta_detail
22
+ attr_accessor :pre_release_version
23
+
24
+ attr_mapping({
25
+ "version" => "version",
26
+ "uploadedDate" => "uploaded_date",
27
+ "expirationDate" => "expiration_date",
28
+ "expired" => "expired",
29
+ "minOsVersion" => "min_os_version",
30
+ "iconAssetToken" => "icon_asset_token",
31
+ "processingState" => "processing_state",
32
+ "usesNonExemptEncryption" => "uses_non_exempt_encryption",
33
+
34
+ "app" => "app",
35
+ "betaAppReviewSubmission" => "beta_app_review_submission",
36
+ "betaBuildMetrics" => "beta_build_metrics",
37
+ "buildBetaDetail" => "build_beta_detail",
38
+ "preReleaseVersion" => "pre_release_version"
39
+ })
40
+
41
+ ESSENTIAL_INCLUDES = "app,buildBetaDetail,preReleaseVersion"
42
+
43
+ module ProcessingState
44
+ PROCESSING = "PROCESSING"
45
+ FAILED = "FAILED"
46
+ INVALID = "INVALID"
47
+ VALID = "VALID"
48
+ end
49
+
50
+ def self.type
51
+ return "builds"
52
+ end
53
+
54
+ #
55
+ # Helpers
56
+ #
57
+
58
+ def app_version
59
+ raise "No pre_release_version included" unless pre_release_version
60
+ return pre_release_version.version
61
+ end
62
+
63
+ def app_id
64
+ raise "No app included" unless app
65
+ return app.id
66
+ end
67
+
68
+ def bundle_id
69
+ raise "No app included" unless app
70
+ return app.bundle_id
71
+ end
72
+
73
+ def processed?
74
+ return processing_state != ProcessingState::PROCESSING
75
+ end
76
+
77
+ def ready_for_beta_submission?
78
+ raise "No build_beat_detail included" unless build_beta_detail
79
+ return build_beta_detail.ready_for_beta_submission?
80
+ end
81
+
82
+ # This is here temporarily until the removal of Spaceship::TestFlight
83
+ def to_testflight_build
84
+ h = {
85
+ 'buildVersion' => version,
86
+ 'uploadDate' => uploaded_date,
87
+ 'externalState' => processed? ? Spaceship::TestFlight::Build::BUILD_STATES[:active] : Spaceship::TestFlight::Build::BUILD_STATES[:processing],
88
+ 'appAdamId' => app_id,
89
+ 'bundleId' => bundle_id,
90
+ 'trainVersion' => app_version
91
+ }
92
+
93
+ return Spaceship::TestFlight::Build.new(h)
94
+ end
95
+
96
+ #
97
+ # API
98
+ #
99
+
100
+ def self.all(app_id: nil, version: nil, build_number: nil, includes: ESSENTIAL_INCLUDES, sort: "-uploadedDate", limit: 30)
101
+ resps = testflight_client.get_builds(
102
+ filter: { app: app_id, "preReleaseVersion.version" => version, version: build_number },
103
+ includes: includes,
104
+ sort: sort,
105
+ limit: limit
106
+ ).all_pages
107
+ return resps.map(&:to_models).flatten
108
+ end
109
+
110
+ def self.get(build_id: nil, includes: ESSENTIAL_INCLUDES)
111
+ return testflight_client.get_build(build_id: build_id, includes: includes).first
112
+ end
113
+
114
+ def add_beta_groups(beta_groups: nil)
115
+ beta_groups ||= []
116
+ beta_group_ids = beta_groups.map(&:id)
117
+ return testflight_client.add_beta_groups_to_build(build_id: id, beta_group_ids: beta_group_ids)
118
+ end
119
+
120
+ def get_beta_build_localizations(filter: {}, includes: nil, limit: nil, sort: nil)
121
+ resps = testflight_client.get_beta_build_localizations(
122
+ filter: { build: id },
123
+ includes: includes,
124
+ sort: sort,
125
+ limit: limit
126
+ ).all_pages
127
+ return resps.map(&:to_models).flatten
128
+ end
129
+
130
+ def get_build_beta_details(filter: {}, includes: nil, limit: nil, sort: nil)
131
+ resps = testflight_client.get_build_beta_details(
132
+ filter: { build: id },
133
+ includes: includes,
134
+ sort: sort,
135
+ limit: limit
136
+ ).all_pages
137
+ return resps.map(&:to_models).flatten
138
+ end
139
+
140
+ def post_beta_app_review_submission
141
+ return testflight_client.post_beta_app_review_submissions(build_id: id)
142
+ end
143
+ end
144
+ end
145
+ end
146
+ end