circleci-bundle-update-pr 1.17.0 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.circleci/config.yml +14 -8
- data/.rubocop.yml +6 -0
- data/.rubocop_todo.yml +1 -1
- data/Gemfile.lock +26 -24
- data/README.md +1 -3
- data/lib/circleci/bundle/update/pr.rb +14 -1
- data/lib/circleci/bundle/update/pr/version.rb +1 -1
- data/spec/circleci/bundle/update/pr_spec.rb +61 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1d5cc504a8708bd911a1547a56cf6734dc9280a1abb914c1e1028c27f4d79dc5
|
|
4
|
+
data.tar.gz: 47dbf8ecf966463318a76f43795a8fcba8e253e42900739efe3f01ad2bf60905
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1f79769e8e306cfb43d985a0db49a5a264e5542e07993ca359d66bda2d783b4510d045a77e5dd54520f920a9eb71da878d271f92db9e3003f48d6c618a7e4076
|
|
7
|
+
data.tar.gz: e898ecce0b82c6d9901e8a8e7a904e0bfb7677839b3b5002f64a7965c03e79375f38b33eaf240b5c8415197fb88f92e1aaa17f5e2e539376754e1c79854babde
|
data/.circleci/config.yml
CHANGED
|
@@ -5,7 +5,7 @@ executors:
|
|
|
5
5
|
parameters:
|
|
6
6
|
ruby_version:
|
|
7
7
|
type: enum
|
|
8
|
-
enum: ['2.3', '2.4', '2.5', '2.6']
|
|
8
|
+
enum: ['2.3', '2.4', '2.5', '2.6', '2.7']
|
|
9
9
|
docker:
|
|
10
10
|
- image: ruby:<< parameters.ruby_version >>-alpine
|
|
11
11
|
working_directory: /work
|
|
@@ -26,7 +26,7 @@ commands:
|
|
|
26
26
|
parameters:
|
|
27
27
|
ruby_version:
|
|
28
28
|
type: enum
|
|
29
|
-
enum: ['2.3', '2.4', '2.5', '2.6']
|
|
29
|
+
enum: ['2.3', '2.4', '2.5', '2.6', '2.7']
|
|
30
30
|
steps:
|
|
31
31
|
- restore_cache:
|
|
32
32
|
name: Restore bundle cache
|
|
@@ -37,7 +37,7 @@ commands:
|
|
|
37
37
|
parameters:
|
|
38
38
|
ruby_version:
|
|
39
39
|
type: enum
|
|
40
|
-
enum: ['2.3', '2.4', '2.5', '2.6']
|
|
40
|
+
enum: ['2.3', '2.4', '2.5', '2.6', '2.7']
|
|
41
41
|
steps:
|
|
42
42
|
- save_cache:
|
|
43
43
|
name: Save bundle cache
|
|
@@ -50,7 +50,7 @@ jobs:
|
|
|
50
50
|
parameters:
|
|
51
51
|
ruby_version:
|
|
52
52
|
type: enum
|
|
53
|
-
enum: ['2.3', '2.4', '2.5', '2.6']
|
|
53
|
+
enum: ['2.3', '2.4', '2.5', '2.6', '2.7']
|
|
54
54
|
executor:
|
|
55
55
|
name: default
|
|
56
56
|
ruby_version: << parameters.ruby_version >>
|
|
@@ -59,11 +59,14 @@ jobs:
|
|
|
59
59
|
- checkout
|
|
60
60
|
- restore_bundle_cache:
|
|
61
61
|
ruby_version: << parameters.ruby_version >>
|
|
62
|
+
- run:
|
|
63
|
+
name: install bundler
|
|
64
|
+
command: gem install -N bundler:1.17.2 # same version as Gemfile.lock
|
|
62
65
|
- run:
|
|
63
66
|
name: bundle install
|
|
64
67
|
command: |
|
|
65
68
|
bundle check || bundle install --jobs=4 --retry=3
|
|
66
|
-
bundle clean
|
|
69
|
+
bundle clean --force
|
|
67
70
|
- save_bundle_cache:
|
|
68
71
|
ruby_version: << parameters.ruby_version >>
|
|
69
72
|
- run: rubocop
|
|
@@ -71,12 +74,12 @@ jobs:
|
|
|
71
74
|
continuous_bundle_update:
|
|
72
75
|
executor:
|
|
73
76
|
name: default
|
|
74
|
-
ruby_version: '2.
|
|
77
|
+
ruby_version: '2.7'
|
|
75
78
|
steps:
|
|
76
79
|
- setup_requirements
|
|
77
80
|
- checkout
|
|
78
81
|
- restore_bundle_cache:
|
|
79
|
-
ruby_version: '2.
|
|
82
|
+
ruby_version: '2.7'
|
|
80
83
|
- run:
|
|
81
84
|
name: Install edge circleci-bundle-update-pr
|
|
82
85
|
command: |
|
|
@@ -102,10 +105,13 @@ workflows:
|
|
|
102
105
|
- build:
|
|
103
106
|
name: ruby-2.6
|
|
104
107
|
ruby_version: '2.6'
|
|
108
|
+
- build:
|
|
109
|
+
name: ruby-2.7
|
|
110
|
+
ruby_version: '2.7'
|
|
105
111
|
nightly:
|
|
106
112
|
triggers:
|
|
107
113
|
- schedule:
|
|
108
|
-
cron: "00 10 * *
|
|
114
|
+
cron: "00 10 * * 2"
|
|
109
115
|
filters:
|
|
110
116
|
branches:
|
|
111
117
|
only: master
|
data/.rubocop.yml
CHANGED
|
@@ -5,12 +5,18 @@ AllCops:
|
|
|
5
5
|
DisplayCopNames: true
|
|
6
6
|
TargetRubyVersion: 2.3
|
|
7
7
|
|
|
8
|
+
Layout/LineLength:
|
|
9
|
+
Enabled: false
|
|
10
|
+
|
|
8
11
|
Metrics:
|
|
9
12
|
Enabled: false
|
|
10
13
|
|
|
11
14
|
RSpec/DescribedClass:
|
|
12
15
|
Enabled: false
|
|
13
16
|
|
|
17
|
+
RSpec/NamedSubject:
|
|
18
|
+
Enabled: false
|
|
19
|
+
|
|
14
20
|
Style/BlockComments:
|
|
15
21
|
Exclude:
|
|
16
22
|
- 'spec/spec_helper.rb'
|
data/.rubocop_todo.yml
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
circleci-bundle-update-pr (1.
|
|
4
|
+
circleci-bundle-update-pr (1.19.0)
|
|
5
5
|
compare_linker (>= 1.4.0)
|
|
6
6
|
octokit
|
|
7
7
|
|
|
@@ -15,52 +15,54 @@ GEM
|
|
|
15
15
|
httpclient
|
|
16
16
|
octokit
|
|
17
17
|
diff-lcs (1.3)
|
|
18
|
-
faraday (0.
|
|
18
|
+
faraday (1.0.0)
|
|
19
19
|
multipart-post (>= 1.2, < 3)
|
|
20
20
|
httpclient (2.8.3)
|
|
21
|
-
jaro_winkler (1.5.
|
|
21
|
+
jaro_winkler (1.5.4)
|
|
22
22
|
multipart-post (2.1.1)
|
|
23
|
-
octokit (4.
|
|
23
|
+
octokit (4.15.0)
|
|
24
|
+
faraday (>= 0.9)
|
|
24
25
|
sawyer (~> 0.8.0, >= 0.5.3)
|
|
25
|
-
parallel (1.
|
|
26
|
-
parser (2.
|
|
26
|
+
parallel (1.19.1)
|
|
27
|
+
parser (2.7.0.2)
|
|
27
28
|
ast (~> 2.4.0)
|
|
28
|
-
public_suffix (4.0.
|
|
29
|
+
public_suffix (4.0.3)
|
|
29
30
|
rainbow (3.0.0)
|
|
30
|
-
rake (
|
|
31
|
-
rspec (3.
|
|
32
|
-
rspec-core (~> 3.
|
|
33
|
-
rspec-expectations (~> 3.
|
|
34
|
-
rspec-mocks (~> 3.
|
|
35
|
-
rspec-core (3.
|
|
36
|
-
rspec-support (~> 3.
|
|
37
|
-
rspec-expectations (3.
|
|
31
|
+
rake (13.0.1)
|
|
32
|
+
rspec (3.9.0)
|
|
33
|
+
rspec-core (~> 3.9.0)
|
|
34
|
+
rspec-expectations (~> 3.9.0)
|
|
35
|
+
rspec-mocks (~> 3.9.0)
|
|
36
|
+
rspec-core (3.9.1)
|
|
37
|
+
rspec-support (~> 3.9.1)
|
|
38
|
+
rspec-expectations (3.9.0)
|
|
38
39
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
39
|
-
rspec-support (~> 3.
|
|
40
|
-
rspec-mocks (3.
|
|
40
|
+
rspec-support (~> 3.9.0)
|
|
41
|
+
rspec-mocks (3.9.1)
|
|
41
42
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
42
|
-
rspec-support (~> 3.
|
|
43
|
-
rspec-support (3.
|
|
44
|
-
rubocop (0.
|
|
43
|
+
rspec-support (~> 3.9.0)
|
|
44
|
+
rspec-support (3.9.2)
|
|
45
|
+
rubocop (0.79.0)
|
|
45
46
|
jaro_winkler (~> 1.5.1)
|
|
46
47
|
parallel (~> 1.10)
|
|
47
|
-
parser (>= 2.
|
|
48
|
+
parser (>= 2.7.0.1)
|
|
48
49
|
rainbow (>= 2.2.2, < 4.0)
|
|
49
50
|
ruby-progressbar (~> 1.7)
|
|
50
51
|
unicode-display_width (>= 1.4.0, < 1.7)
|
|
51
|
-
rubocop-rspec (1.
|
|
52
|
-
rubocop (>= 0.
|
|
52
|
+
rubocop-rspec (1.37.1)
|
|
53
|
+
rubocop (>= 0.68.1)
|
|
53
54
|
ruby-progressbar (1.10.1)
|
|
54
55
|
sawyer (0.8.2)
|
|
55
56
|
addressable (>= 2.3.5)
|
|
56
57
|
faraday (> 0.8, < 2.0)
|
|
57
|
-
unicode-display_width (1.6.
|
|
58
|
+
unicode-display_width (1.6.1)
|
|
58
59
|
|
|
59
60
|
PLATFORMS
|
|
60
61
|
ruby
|
|
61
62
|
x86_64-darwin-16
|
|
62
63
|
x86_64-darwin-17
|
|
63
64
|
x86_64-darwin-18
|
|
65
|
+
x86_64-darwin-19
|
|
64
66
|
|
|
65
67
|
DEPENDENCIES
|
|
66
68
|
bundler
|
data/README.md
CHANGED
|
@@ -189,7 +189,7 @@ jobs:
|
|
|
189
189
|
run: |
|
|
190
190
|
set -x
|
|
191
191
|
|
|
192
|
-
export CIRCLE_BRANCH=$(echo $
|
|
192
|
+
export CIRCLE_BRANCH=$(echo $GITHUB_REF | sed -e 's!refs/heads/!!g')
|
|
193
193
|
export CIRCLE_PROJECT_USERNAME=$(echo $GITHUB_REPOSITORY | cut -d "/" -f 1)
|
|
194
194
|
export CIRCLE_PROJECT_REPONAME=$(echo $GITHUB_REPOSITORY | cut -d "/" -f 2)
|
|
195
195
|
|
|
@@ -198,8 +198,6 @@ jobs:
|
|
|
198
198
|
circleci-bundle-update-pr "${GIT_USER_NAME}" "${GIT_USER_EMAIL}"
|
|
199
199
|
env:
|
|
200
200
|
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
201
|
-
GITHUB_BRANCH: ${{ github.ref }}
|
|
202
|
-
GITHUB_REPOSITORY: ${{ github.repository }}
|
|
203
201
|
GIT_USER_NAME: "your name"
|
|
204
202
|
GIT_USER_EMAIL: "ci@example.com"
|
|
205
203
|
```
|
|
@@ -117,7 +117,7 @@ module Circleci
|
|
|
117
117
|
repo_full_name,
|
|
118
118
|
[
|
|
119
119
|
{
|
|
120
|
-
path:
|
|
120
|
+
path: lockfile_path,
|
|
121
121
|
mode: '100644',
|
|
122
122
|
type: 'blob',
|
|
123
123
|
sha: lockfile_blob_sha
|
|
@@ -236,6 +236,19 @@ Powered by [circleci-bundle-update-pr](https://rubygems.org/gems/circleci-bundle
|
|
|
236
236
|
@now ||= Time.now
|
|
237
237
|
end
|
|
238
238
|
private_class_method :now
|
|
239
|
+
|
|
240
|
+
# Get Gemfile.lock path relative to workdir
|
|
241
|
+
#
|
|
242
|
+
# @return [String]
|
|
243
|
+
def self.lockfile_path
|
|
244
|
+
workdir_env = ENV['CIRCLE_WORKING_DIRECTORY']
|
|
245
|
+
return 'Gemfile.lock' unless workdir_env
|
|
246
|
+
|
|
247
|
+
workdir = Pathname.new(workdir_env).expand_path
|
|
248
|
+
gemfile_lock = Pathname.new(File.expand_path('Gemfile.lock'))
|
|
249
|
+
gemfile_lock.relative_path_from(workdir).to_s
|
|
250
|
+
end
|
|
251
|
+
private_class_method :lockfile_path
|
|
239
252
|
end
|
|
240
253
|
end
|
|
241
254
|
end
|
|
@@ -52,4 +52,65 @@ describe Circleci::Bundle::Update::Pr do
|
|
|
52
52
|
it { is_expected.to be_falsy }
|
|
53
53
|
end
|
|
54
54
|
end
|
|
55
|
+
|
|
56
|
+
describe '.lockfile_path' do
|
|
57
|
+
subject { Circleci::Bundle::Update::Pr.send(:lockfile_path) }
|
|
58
|
+
|
|
59
|
+
let(:workdir_env) { Dir.getwd }
|
|
60
|
+
|
|
61
|
+
around do |e|
|
|
62
|
+
ENV['CIRCLE_WORKING_DIRECTORY'] = workdir_env
|
|
63
|
+
e.run
|
|
64
|
+
ENV['CIRCLE_WORKING_DIRECTORY'] = nil
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
context 'when Gemfile.lock is in the working dir' do
|
|
68
|
+
it { is_expected.to eq 'Gemfile.lock' }
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
context "when ENV['CIRCLE_WORKING_DIRECTORY'] is not set" do
|
|
72
|
+
let(:workdir_env) {}
|
|
73
|
+
|
|
74
|
+
it { is_expected.to eq 'Gemfile.lock' }
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
context "when ENV['CIRCLE_WORKING_DIRECTORY'] is relative path" do
|
|
78
|
+
let(:workdir_env) do
|
|
79
|
+
project_dir = Pathname.getwd.to_s
|
|
80
|
+
home_dir = Pathname.new(ENV['HOME']).to_s
|
|
81
|
+
project_dir.sub(home_dir, '~')
|
|
82
|
+
end
|
|
83
|
+
let(:src_dir) { 'spec/tmp' }
|
|
84
|
+
|
|
85
|
+
around do |e|
|
|
86
|
+
FileUtils.mkdir_p(src_dir)
|
|
87
|
+
FileUtils.touch("#{src_dir}/Gemfile.lock")
|
|
88
|
+
e.run
|
|
89
|
+
FileUtils.rm_rf(src_dir)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
it 'is "spec/tmp/Gemfile.lock"' do
|
|
93
|
+
Dir.chdir(src_dir) do
|
|
94
|
+
expect(subject).to eq 'spec/tmp/Gemfile.lock'
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
context 'when Gemfile.lock is in a nested dir' do
|
|
100
|
+
let(:src_dir) { 'spec/tmp' }
|
|
101
|
+
|
|
102
|
+
around do |e|
|
|
103
|
+
FileUtils.mkdir_p(src_dir)
|
|
104
|
+
FileUtils.touch("#{src_dir}/Gemfile.lock")
|
|
105
|
+
e.run
|
|
106
|
+
FileUtils.rm_rf(src_dir)
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
it 'is "spec/tmp/Gemfile.lock"' do
|
|
110
|
+
Dir.chdir(src_dir) do
|
|
111
|
+
expect(subject).to eq 'spec/tmp/Gemfile.lock'
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
end
|
|
55
116
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: circleci-bundle-update-pr
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.19.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Takashi Masuda
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2020-01-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: compare_linker
|
|
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
153
153
|
- !ruby/object:Gem::Version
|
|
154
154
|
version: '0'
|
|
155
155
|
requirements: []
|
|
156
|
-
rubygems_version: 3.
|
|
156
|
+
rubygems_version: 3.1.2
|
|
157
157
|
signing_key:
|
|
158
158
|
specification_version: 4
|
|
159
159
|
summary: Provide continues bundle update using CircleCI
|