fastlane-plugin-wpmreleasetoolkit 5.4.0 → 5.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_downloadmetadata_action.rb +4 -4
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_preflight.rb +0 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_download_helper.rb +29 -6
- data/lib/fastlane/plugin/wpmreleasetoolkit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 858fcaeb7ccaa13b2b3990d36aa1c9aa15f9f9cb90c7ee7bb6941442f2c97847
|
4
|
+
data.tar.gz: '067942032d28224600deae4333b427e3eda6af56d65fb83eefb5ef4e3c07b868'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb6a9f16072c66b7458d4a0787b300cdddd0d87ae99cc886ecc5d64a733d11f046a27c6167b7150fd73c358d9f6c3c85e03b10d4b5c76202fa5273560b5b523e
|
7
|
+
data.tar.gz: ca606aef9d929fe6ae3c1f821575e07fc4b672929b61ad7174a1f7e43dea8c2698ed63c696c62506beca226581f726fccadc01930e15b5e8088aa7908e2f0a6c
|
@@ -19,14 +19,14 @@ module Fastlane
|
|
19
19
|
|
20
20
|
params[:locales].each do |loc|
|
21
21
|
if loc.is_a?(Array)
|
22
|
-
|
23
|
-
complete_url = "#{params[:project_url]}#{loc[0]}/default/export-translations
|
22
|
+
UI.message "Downloading language: #{loc[1]}"
|
23
|
+
complete_url = "#{params[:project_url]}#{loc[0]}/default/export-translations/?filters[status]=current&format=json"
|
24
24
|
downloader.download(loc[1], complete_url, loc[1] == params[:source_locale])
|
25
25
|
end
|
26
26
|
|
27
27
|
if loc.is_a?(String)
|
28
|
-
|
29
|
-
complete_url = "#{params[:project_url]}#{loc}/default/export-translations
|
28
|
+
UI.message "Downloading language: #{loc}"
|
29
|
+
complete_url = "#{params[:project_url]}#{loc}/default/export-translations/?filters[status]=current&format=json"
|
30
30
|
downloader.download(loc, complete_url, loc == params[:source_locale])
|
31
31
|
end
|
32
32
|
end
|
@@ -16,12 +16,7 @@ module Fastlane
|
|
16
16
|
def download(target_locale, glotpress_url, is_source)
|
17
17
|
uri = URI(glotpress_url)
|
18
18
|
response = Net::HTTP.get_response(uri)
|
19
|
-
response
|
20
|
-
|
21
|
-
@alternates.clear
|
22
|
-
loc_data = JSON.parse(response.body) rescue loc_data = nil
|
23
|
-
parse_data(target_locale, loc_data, is_source)
|
24
|
-
reparse_alternates(target_locale, loc_data, is_source) unless @alternates.length == 0
|
19
|
+
handle_glotpress_download(response: response, locale: target_locale, is_source: is_source)
|
25
20
|
end
|
26
21
|
|
27
22
|
# Parse JSON data and update the local files
|
@@ -100,6 +95,34 @@ module Fastlane
|
|
100
95
|
def get_target_file_path(locale, file_name)
|
101
96
|
"#{@target_folder}/#{locale}/#{file_name}"
|
102
97
|
end
|
98
|
+
|
99
|
+
private
|
100
|
+
|
101
|
+
def handle_glotpress_download(response:, locale:, is_source:)
|
102
|
+
case response.code
|
103
|
+
when '200'
|
104
|
+
# All good, parse the result
|
105
|
+
UI.success("Successfully downloaded `#{locale}`.")
|
106
|
+
@alternates.clear
|
107
|
+
loc_data = JSON.parse(response.body) rescue loc_data = nil
|
108
|
+
parse_data(locale, loc_data, is_source)
|
109
|
+
reparse_alternates(target_locale, loc_data, is_source) unless @alternates.length == 0
|
110
|
+
when '301'
|
111
|
+
# Follow the redirect
|
112
|
+
UI.message("Received 301 for `#{locale}`. Following redirect...")
|
113
|
+
download(locale, response.header['location'], is_source)
|
114
|
+
when '429'
|
115
|
+
# We got rate-limited, offer to try again
|
116
|
+
if UI.confirm("Retry downloading `#{locale}` after receiving 429 from the API?")
|
117
|
+
download(locale, response.uri, is_source)
|
118
|
+
else
|
119
|
+
UI.error("Abandoning `#{locale}` download as requested.")
|
120
|
+
end
|
121
|
+
else
|
122
|
+
message = "Received unexpected #{response.code} from request to URI #{response.uri}."
|
123
|
+
UI.abort_with_message!(message) unless UI.confirm("#{message} Continue anyway?")
|
124
|
+
end
|
125
|
+
end
|
103
126
|
end
|
104
127
|
end
|
105
128
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-wpmreleasetoolkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Automattic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|