shopify-cli 2.20.0 → 2.20.1

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: 9fb2bcf8db165a28ff5753227eb1aae9d2d83e65e8a2cee8a8a2ed4e7f8d7d4b
4
- data.tar.gz: 5ab1e805308119941d84932997959926011281ea4a2b48d5517ca43c3794661c
3
+ metadata.gz: 2bab2227e665dd4dec8e90ca261705072971a838f85d19bcbb85d18ed1a1d5b0
4
+ data.tar.gz: 90e22472586a681a26974882b79ac3fd326fdcf696db2aa29201ab5d9a37c2b0
5
5
  SHA512:
6
- metadata.gz: a6c2ba75cadbc318cae8615890386c1c3aa8100405d12e070627470448d367daf96a65390e6afad6b6d70ae8bdbc7e27f8d7dbdccf5b69e4fde12f6bca681b94
7
- data.tar.gz: 66699ed47aa46b23f3dfe4dba39a9e15c23e135db254a22db2e4800d0865be49b23bca70eb9733a497bd2a87a2e8aa6db00e887da53a4f83881f719983eda906
6
+ metadata.gz: 24701865a98be1b3062ff7644fff3d35b61532803e96c39d84c7fae636b8205531e57e41641d1222dbd09275288e4dee2f2f94c837d58846212a0f4ed1643b28
7
+ data.tar.gz: 6e5c53ef75f07879d338692ce9271749002c13f8174a19fe3857b3396ec1512a2368770ec50bd24de2a0c9dc325dddb5b3547564c79cc360a40d1b19b35d2c50
@@ -0,0 +1,22 @@
1
+ name: Contributor License Agreement (CLA)
2
+
3
+ on:
4
+ pull_request_target:
5
+ types: [opened, synchronize]
6
+ issue_comment:
7
+ types: [created]
8
+
9
+ jobs:
10
+ cla:
11
+ runs-on: ubuntu-latest
12
+ if: |
13
+ (github.event.issue.pull_request
14
+ && !github.event.issue.pull_request.merged_at
15
+ && contains(github.event.comment.body, 'signed')
16
+ )
17
+ || (github.event.pull_request && !github.event.pull_request.merged)
18
+ steps:
19
+ - uses: Shopify/shopify-cla-action@v1
20
+ with:
21
+ github-token: ${{ secrets.GITHUB_TOKEN }}
22
+ cla-token: ${{ secrets.CLA_TOKEN }}
data/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## Version 2.20.1 - 2022-07-18
6
+
7
+ ### Fixed
8
+ * [#2458](https://github.com/Shopify/shopify-cli/pull/2458): Fix shop URL in unauthorized error message
9
+ * [#2459](https://github.com/Shopify/shopify-cli/pull/2459): Fix `.json` file ignore issues with `shopify theme push`
10
+ * [#2460](https://github.com/Shopify/shopify-cli/pull/2460): Fix job retries for .json theme file dependencies and support wider range of asset API errors
11
+
5
12
  ## Version 2.20.0 - 2022-07-11
6
13
 
7
14
  ### Added
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify-cli (2.20.0)
4
+ shopify-cli (2.20.1)
5
5
  bugsnag (~> 6.22)
6
6
  listen (~> 3.7.0)
7
7
  theme-check (~> 1.10.3)
@@ -11,7 +11,7 @@ module Theme
11
11
  unauthorized_error: <<~EOD,
12
12
  You can't use Shopify CLI with development stores if you only have Partner staff member access. If you want to use Shopify CLI to work on a development store, then you should be the store owner or create a staff account on the store.
13
13
 
14
- If you're the store owner, then you need to log in to the store directly using the store URL at least once (for example, using %s.myshopify.com/admin) before you log in using Shopify CLI. Logging in to the Shopify admin directly connects the development store with your Shopify login.
14
+ If you're the store owner, then you need to log in to the store directly using the store URL at least once (for example, using %s/admin) before you log in using Shopify CLI. Logging in to the Shopify admin directly connects the development store with your Shopify login.
15
15
  EOD
16
16
  ensure_user_try_this: <<~ENSURE_USER,
17
17
  Check if your user is activated, has permission to edit themes at the store, and try to re-login.
@@ -10,7 +10,7 @@ module ShopifyCLI
10
10
  def enqueue_json_updates(files)
11
11
  # Update remote JSON files and delays `delayed_files` update
12
12
  files = files
13
- .select { |file| !ignore_file?(file) && file.exist? && checksums.file_has_changed?(file) }
13
+ .select { |file| ready_to_update?(file) }
14
14
  .sort_by { |file| delayed_files.include?(file) ? 1 : 0 }
15
15
  .reject { |file| overwrite_json? && delayed_files.include?(file) }
16
16
 
@@ -26,7 +26,7 @@ module ShopifyCLI
26
26
  return unless overwrite_json?
27
27
  # Update delayed files synchronously
28
28
  delayed_files.each do |file|
29
- update(file) if checksums.file_has_changed?(file)
29
+ update(file) if ready_to_update?(file)
30
30
  end
31
31
  end
32
32
 
@@ -86,6 +86,10 @@ module ShopifyCLI
86
86
  def ask_update_strategy(file)
87
87
  Forms::SelectUpdateStrategy.ask(@ctx, [], file: file, exists_remotely: file_exist_remotely?(file)).strategy
88
88
  end
89
+
90
+ def ready_to_update?(file)
91
+ !ignore_file?(file) && file.exist? && checksums.file_has_changed?(file)
92
+ end
89
93
  end
90
94
  end
91
95
  end
@@ -366,17 +366,23 @@ module ShopifyCLI
366
366
  checksums.reject_duplicated_checksums!
367
367
  end
368
368
 
369
- def parse_api_errors(exception)
369
+ def parse_api_errors(operation, exception)
370
370
  parsed_body = if exception&.response&.is_a?(Hash)
371
371
  exception&.response&.[](:body)
372
372
  else
373
373
  JSON.parse(exception&.response&.body)
374
374
  end
375
- message = parsed_body.dig("errors", "asset") || parsed_body["message"] || exception.message
375
+
376
+ errors = parsed_body.dig("errors") # either nil or another type
377
+ errors = errors.dig("asset") if errors&.is_a?(Hash)
378
+
379
+ message = errors || parsed_body["message"] || exception.message
376
380
  # Truncate to first lines
377
381
  [message].flatten.map { |m| m.split("\n", 2).first }
378
382
  rescue JSON::ParserError
379
383
  [exception.message]
384
+ rescue StandardError => e
385
+ ["The asset #{operation.file} is could not be synced (cause: #{e.message})."]
380
386
  end
381
387
 
382
388
  def backoff_if_near_limit!(used, limit)
@@ -400,7 +406,7 @@ module ShopifyCLI
400
406
  end
401
407
 
402
408
  def handle_operation_error(operation, error)
403
- error_suffix = ":\n " + parse_api_errors(error).join("\n ")
409
+ error_suffix = ":\n " + parse_api_errors(operation, error).join("\n ")
404
410
  report_error(operation, error_suffix)
405
411
  end
406
412
 
@@ -10,7 +10,7 @@ module ShopifyCLI
10
10
  class ThemeAdminAPIThrottler
11
11
  class BulkJob < ShopifyCLI::ThreadPool::Job
12
12
  JOB_TIMEOUT = 0.2 # 200ms
13
- MAX_RETRIES = 5
13
+ MAX_RETRIES = 10
14
14
 
15
15
  attr_reader :bulk
16
16
 
@@ -1,3 +1,3 @@
1
1
  module ShopifyCLI
2
- VERSION = "2.20.0"
2
+ VERSION = "2.20.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.20.0
4
+ version: 2.20.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-11 00:00:00.000000000 Z
11
+ date: 2022-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -124,7 +124,7 @@ files:
124
124
  - ".github/ISSUE_TEMPLATE/enhancement.yaml"
125
125
  - ".github/ISSUE_TEMPLATE/feature.yaml"
126
126
  - ".github/PULL_REQUEST_TEMPLATE.md"
127
- - ".github/probots.yml"
127
+ - ".github/workflows/cla.yml"
128
128
  - ".github/workflows/shopify.yml"
129
129
  - ".github/workflows/stale.yml"
130
130
  - ".github/workflows/triage.yml"
data/.github/probots.yml DELETED
@@ -1,3 +0,0 @@
1
- # .github/probots.yml
2
- enabled:
3
- - cla