shopify-cli 1.4.0 → 1.4.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: 5832060f2695566da5c38ce98ccd1c67d522e8bb8306a5b2a16d95f92b3e56f1
4
- data.tar.gz: e223c587130318b500d5cd12b494c50aef424957aef5da797dafea4b233e9933
3
+ metadata.gz: 1b440a68e264b97888e3cb181eea5e2465522c3d67338851e08775cc743416a5
4
+ data.tar.gz: a6f2acacf046ab9c6bd174d7bd077a0ea87312f844db05de015c9cacf5d972bf
5
5
  SHA512:
6
- metadata.gz: b85a1e420f5d8b80a46f93ca4d16ebc1198fd31899bc7fbb8c9e0fbfa485c5f38fe9eca820782b0c4743b53e10266ce73bb0010fa90cd5b08fff199bb6a99585
7
- data.tar.gz: 0dfd783ede5fcad7b04d648ec0f4d7084bea778d1fe7c73c0d2a86e683181cce73e8706a53462b7e285c04095dcebcc0c7cc489587f35ceb34716be4ec71efa2
6
+ metadata.gz: dc49412e3aa3f7bc5dde8fa5943d2d52ae09138e92de3fcbd949353430a2ea5275dd157951dcf81770cdb36ccb5c023a570ddea3eb7756a357709360d51bb3b4
7
+ data.tar.gz: 648a9df9b5647e869d92cc23241628fbe336efeeb8c9c6ade691d55b14cb075c419e87a2f97c5eddf851e99bba1da5e595cfcd13d2d78c6c5c0cafbaeaa85dc1
@@ -20,3 +20,11 @@ Fixes #0000 <!-- link to issue if one exists -->
20
20
  Summary of the changes committed.
21
21
  Before / after screenshots appreciated for UI changes.
22
22
  -->
23
+
24
+ ### Update checklist
25
+ <!--
26
+ Ideally, CHANGELOG entries should be in the format
27
+ `* [#PR](PR URL): Message`. You should consider adding your PR
28
+ and then making the CHANGELOG update once you know the PR number.
29
+ -->
30
+ - [ ] I've added a CHANGELOG entry for this PR
@@ -0,0 +1,62 @@
1
+ name: Create Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ jobs:
9
+ create-release:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - name: Extract tag name
13
+ id: tag
14
+ run: echo "::set-output name=value::${GITHUB_REF##*/}"
15
+ - uses: actions/checkout@v2
16
+
17
+ - name: Set up Ruby
18
+ uses: actions/setup-ruby@v1.1.2
19
+ with:
20
+ ruby-version: 2.6
21
+
22
+ - name: Install dependencies
23
+ run: bundle install
24
+
25
+ - name: Create package
26
+ run: bundle exec rake package
27
+
28
+ - name: Get Directory
29
+ id: folder
30
+ run: |
31
+ cd packaging/builds
32
+ echo ::set-output name=name::$(ls)
33
+
34
+ - name: Get Packages
35
+ id: binaries
36
+ run: |
37
+ cd packaging/builds/${{ steps.folder.outputs.name }}
38
+ deb=$(find . -type f -name '*.deb')
39
+ rpm=$(find . -type f -name "*.rpm")
40
+ echo ::set-output name=deb_file::"${deb:2}"
41
+ echo ::set-output name=rpm_file::"${rpm:2}"
42
+
43
+ - uses: dawidd6/action-homebrew-bump-formula@v3
44
+ with:
45
+ token: ${{secrets.BREW_TOKEN}}
46
+ tap: shopify/shopify
47
+ formula: shopify-cli
48
+ tag: ${{ steps.folder.outputs.name }}
49
+ message: "Version bump, created by github actions"
50
+
51
+ - name: Create Release # https://hub.github.com/hub-release.1.html
52
+ env:
53
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54
+ run: |
55
+ cd packaging/builds/${{ steps.folder.outputs.name }}
56
+ hub release create ${{ steps.tag.outputs.value }} \
57
+ -a ${{ steps.binaries.outputs.deb_file }} \
58
+ -a ${{ steps.binaries.outputs.rpm_file }} \
59
+ -m "Version ${{ steps.folder.outputs.name }}
60
+
61
+ Release of version ${{ steps.folder.outputs.name }} of the Shopify App CLI
62
+ Please refer to [CHANGELOG](https://github.com/Shopify/shopify-app-cli/blob/master/CHANGELOG.md) for details."
@@ -1,9 +1,44 @@
1
1
  inherit_from: .rubocop_todo.yml
2
2
 
3
+ require: rubocop-minitest
4
+
3
5
  inherit_gem:
4
6
  rubocop-shopify:
5
7
  - rubocop-cli.yml
6
8
 
9
+ Minitest:
10
+ Enabled: true
11
+ Include:
12
+ - '**/test/**/*'
13
+ - '**/*_test.rb'
14
+
15
+ Minitest/AssertInDelta: # (new in 0.10)
16
+ Enabled: true
17
+ Minitest/AssertionInLifecycleHook: # (new in 0.10)
18
+ Enabled: true
19
+ Minitest/AssertKindOf: # (new in 0.10)
20
+ Enabled: true
21
+ Minitest/AssertOutput: # (new in 0.10)
22
+ Enabled: true
23
+ Minitest/AssertPathExists: # (new in 0.10)
24
+ Enabled: false # only available from minitest 5.13.0
25
+ Minitest/AssertSilent: # (new in 0.10)
26
+ Enabled: true
27
+ Minitest/LiteralAsActualArgument: # (new in 0.10)
28
+ Enabled: true
29
+ Minitest/MultipleAssertions: # (new in 0.10)
30
+ Enabled: true
31
+ Minitest/RefuteInDelta: # (new in 0.10)
32
+ Enabled: true
33
+ Minitest/RefuteKindOf: # (new in 0.10)
34
+ Enabled: true
35
+ Minitest/RefutePathExists: # (new in 0.10)
36
+ Enabled: false # only available from minitest 5.13.0
37
+ Minitest/TestMethodName: # (new in 0.10)
38
+ Enabled: true
39
+ Minitest/UnspecifiedException: # (new in 0.10)
40
+ Enabled: true
41
+
7
42
  AllCops:
8
43
  Exclude:
9
44
  - 'vendor/**/*'
@@ -1,12 +1,16 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2020-10-17 00:53:36 UTC using RuboCop version 0.93.1.
3
+ # on 2020-10-24 22:13:10 UTC using RuboCop version 0.93.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 66
9
+ # Offense count: 29
10
+ Minitest/MultipleAssertions:
11
+ Max: 9
12
+
13
+ # Offense count: 74
10
14
  # Cop supports --auto-correct.
11
15
  # Configuration parameters: IgnoreMacros, IgnoredMethods, IgnoredPatterns, IncludedMacros, AllowParenthesesInMultilineCall, AllowParenthesesInChaining, AllowParenthesesInCamelCaseMethod, EnforcedStyle.
12
16
  # SupportedStyles: require_parentheses, omit_parentheses
@@ -11,3 +11,4 @@ install:
11
11
  - bundle install
12
12
  script:
13
13
  - bundle exec rake
14
+ - if [ -f "~/.config/shopify/config" ]; then echo "Found a config file in home directory. This means the tests would modify a developer's local config. Consider using FakeFS"; exit 1; fi
@@ -1,10 +1,14 @@
1
1
  Unreleased
2
2
  ------
3
3
 
4
+ Version 1.4.1
5
+ ------
6
+ * [#917](https://github.com/Shopify/shopify-app-cli/pull/917): Ensure analytics for create action includes the same fields as other commands
7
+
4
8
  Version 1.4.0
5
9
  ------
6
10
  * Updates to tests, dependencies and internal tooling
7
- * #924: Improve debugging messages on Partner API errors
11
+ * [#924](https://github.com/Shopify/shopify-app-cli/pull/924): Improve debugging messages on Partner API errors
8
12
 
9
13
  Version 1.3.1
10
14
  ------
data/Gemfile CHANGED
@@ -9,6 +9,7 @@ group :development, :test do
9
9
  gem 'pry-byebug'
10
10
  gem 'byebug'
11
11
  gem 'rubocop-shopify', require: false
12
+ gem 'rubocop-minitest', require: false
12
13
  end
13
14
 
14
15
  group :test do
@@ -1,37 +1,34 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- addressable (2.5.2)
5
- public_suffix (>= 2.0.2, < 4.0)
4
+ addressable (2.7.0)
5
+ public_suffix (>= 2.0.2, < 5.0)
6
6
  ansi (1.5.0)
7
7
  ast (2.4.1)
8
- builder (3.2.3)
9
- byebug (8.2.5)
10
- coderay (1.1.2)
11
- crack (0.4.3)
12
- safe_yaml (~> 1.0.0)
8
+ builder (3.2.4)
9
+ byebug (11.1.3)
10
+ coderay (1.1.3)
11
+ crack (0.4.4)
13
12
  fakefs (1.2.2)
14
- hashdiff (0.3.2)
15
- metaclass (0.0.4)
16
- method_source (0.9.2)
17
- minitest (5.11.3)
18
- minitest-reporters (1.3.5)
13
+ hashdiff (1.0.1)
14
+ method_source (1.0.0)
15
+ minitest (5.14.2)
16
+ minitest-reporters (1.4.2)
19
17
  ansi
20
18
  builder
21
19
  minitest (>= 5.0)
22
20
  ruby-progressbar
23
- mocha (1.7.0)
24
- metaclass (~> 0.0.1)
21
+ mocha (1.11.2)
25
22
  parallel (1.19.2)
26
23
  parser (2.7.2.0)
27
24
  ast (~> 2.4.1)
28
- pry (0.12.2)
29
- coderay (~> 1.1.0)
30
- method_source (~> 0.9.0)
31
- pry-byebug (3.3.0)
32
- byebug (~> 8.0)
33
- pry (~> 0.10)
34
- public_suffix (3.0.3)
25
+ pry (0.13.1)
26
+ coderay (~> 1.1)
27
+ method_source (~> 1.0)
28
+ pry-byebug (3.9.0)
29
+ byebug (~> 11.0)
30
+ pry (~> 0.13.0)
31
+ public_suffix (4.0.6)
35
32
  rainbow (3.0.0)
36
33
  rake (13.0.1)
37
34
  regexp_parser (1.8.2)
@@ -45,18 +42,19 @@ GEM
45
42
  rubocop-ast (>= 0.6.0)
46
43
  ruby-progressbar (~> 1.7)
47
44
  unicode-display_width (>= 1.4.0, < 2.0)
48
- rubocop-ast (0.8.0)
45
+ rubocop-ast (1.1.0)
49
46
  parser (>= 2.7.1.5)
47
+ rubocop-minitest (0.10.1)
48
+ rubocop (>= 0.87)
50
49
  rubocop-shopify (1.0.6)
51
50
  rubocop (>= 0.92, < 0.94)
52
51
  ruby-progressbar (1.10.1)
53
- safe_yaml (1.0.4)
54
- timecop (0.9.1)
52
+ timecop (0.9.2)
55
53
  unicode-display_width (1.7.0)
56
- webmock (2.3.2)
54
+ webmock (3.9.3)
57
55
  addressable (>= 2.3.6)
58
56
  crack (>= 0.3.2)
59
- hashdiff
57
+ hashdiff (>= 0.4.0, < 2.0.0)
60
58
 
61
59
  PLATFORMS
62
60
  ruby
@@ -69,6 +67,7 @@ DEPENDENCIES
69
67
  mocha
70
68
  pry-byebug
71
69
  rake
70
+ rubocop-minitest
72
71
  rubocop-shopify
73
72
  timecop
74
73
  webmock
@@ -43,21 +43,7 @@
43
43
  ```
44
44
  This will generate the `.deb`, `.rpm` and brew formula files, which will be located in `packaging/builds/X.Y.Z/`.
45
45
 
46
- 1. Clone the `Shopify/homebrew-shopify` repository (if not already cloned), and then
47
- * create a branch named `release_X_Y_Z_of_shopify-cli`
48
- * update the brew formula in `shopify-cli.rb` with the generated formula in `packaging/builds/X.Y.Z/` in the `Shopify/shopify-app-cli` repo (from step 9)
49
- * commit the change and create a PR on the [Shopify Homebrew repository](https://github.com/Shopify/homebrew-shopify)
50
- * when PR is approved, merge into main branch
51
-
52
- 1. Go to [releases](https://github.com/Shopify/shopify-app-cli/releases) page of `Shopify/shopify-app-cli` repo and create a new release:
53
- * use the tag created in step 8 by Shipit (should be "vX.Y.Z")
54
- * release title = "Version X.Y.Z"
55
- * description should be
56
- ```
57
- Release of version X.Y.Z of Shopify App CLI
58
-
59
- Please refer to [CHANGELOG](https://github.com/Shopify/shopify-app-cli/blob/master/CHANGELOG.md) for details.
60
- ```
61
- * upload the `.deb` and `.rpm` files from `packaging/builds/X.Y.Z/` (generated in step 9)
62
- * if it's a pre-release version, select the "This is a pre-release" checkbox
63
- * and click "Publish release".
46
+ 1. Check the "Actions" tab to see if the _Create Release_ workflow is successful.
47
+ The workflow will automatically create a release with the latest tag and the `.deb`, `.rpm` assets attached.
48
+
49
+ 1. Check the `Shopify/homebrew-shopify` repository for new branch `bump-shopify-cli-{version}` and create PR.
@@ -102,13 +102,14 @@ module ShopifyCli
102
102
  cli_version: ShopifyCli::VERSION,
103
103
  ruby_version: RUBY_VERSION,
104
104
  }.tap do |payload|
105
- payload[:metadata] = JSON.dump(metadata) unless metadata.empty?
106
-
105
+ payload[:api_key] = metadata.delete(:api_key)
106
+ payload[:partner_id] = metadata.delete(:organization_id)
107
107
  if Project.has_current?
108
- project = Project.current
108
+ project = Project.current(force_reload: true)
109
109
  payload[:api_key] = project.env&.api_key
110
110
  payload[:partner_id] = project.config['organization_id']
111
111
  end
112
+ payload[:metadata] = JSON.dump(metadata) unless metadata.empty?
112
113
  end,
113
114
  }
114
115
  end
@@ -17,12 +17,14 @@ module ShopifyCli
17
17
  redir: [OAuth::REDIRECT_HOST]
18
18
  )
19
19
 
20
- user_errors = resp["data"]["appCreate"]["userErrors"]
20
+ user_errors = resp.dig("data", "appCreate", "userErrors")
21
21
  if !user_errors.nil? && user_errors.any?
22
22
  ctx.abort(user_errors.map { |err| "#{err['field']} #{err['message']}" }.join(", "))
23
23
  end
24
24
 
25
- resp["data"]["appCreate"]["app"]
25
+ ShopifyCli::Core::Monorail.metadata[:api_key] = resp.dig("data", "appCreate", "app", "apiKey")
26
+
27
+ resp.dig("data", "appCreate", "app")
26
28
  end
27
29
  end
28
30
  end
@@ -10,6 +10,7 @@ module ShopifyCli
10
10
  return response(organization_id.to_i, shop_domain) unless organization_id.nil? || shop_domain.nil?
11
11
  org = get_organization(organization_id)
12
12
  shop_domain ||= get_shop_domain(org)
13
+ ShopifyCli::Core::Monorail.metadata[:organization_id] = org["id"].to_i
13
14
  response(org["id"].to_i, shop_domain)
14
15
  end
15
16
 
@@ -1,3 +1,3 @@
1
1
  module ShopifyCli
2
- VERSION = '1.4.0'
2
+ VERSION = '1.4.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: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-23 00:00:00.000000000 Z
11
+ date: 2020-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -77,6 +77,7 @@ files:
77
77
  - ".github/ISSUE_TEMPLATE.md"
78
78
  - ".github/PULL_REQUEST_TEMPLATE.md"
79
79
  - ".github/probots.yml"
80
+ - ".github/workflows/release.yml"
80
81
  - ".gitignore"
81
82
  - ".rubocop.yml"
82
83
  - ".rubocop_todo.yml"